@northern.tech/store 0.31.0 → 0.32.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.d.cts +5 -2
- package/dist/actions.d.ts +5 -2
- package/dist/api/general-api.cjs +2 -2
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.js.map +1 -1
- package/dist/api/users-api.cjs +1 -1
- package/dist/api/users-api.cjs.map +1 -1
- package/dist/api/users-api.js.map +1 -1
- package/dist/appSlice/constants.cjs +1 -1
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.js +2 -2
- package/dist/appSlice/constants.js.map +1 -1
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.js.map +1 -1
- package/dist/appSlice/selectors.d.cts +2 -2
- package/dist/appSlice/selectors.d.ts +2 -2
- package/dist/appSlice/thunks.d.cts +1 -1
- package/dist/appSlice/thunks.d.ts +1 -1
- package/dist/auth.cjs +1 -1
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/commonSelectors.cjs +1 -1
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +2 -2
- package/dist/commonSelectors.d.ts +2 -2
- package/dist/commonSelectors.js.map +1 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.js.map +1 -1
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +2 -2
- package/dist/deploymentsSlice/selectors.d.ts +2 -2
- package/dist/deploymentsSlice/selectors.js.map +1 -1
- package/dist/deploymentsSlice/thunks.d.cts +1 -1
- package/dist/deploymentsSlice/thunks.d.ts +1 -1
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.js.map +1 -1
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +2 -2
- package/dist/devicesSlice/selectors.d.ts +2 -2
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +1 -1
- package/dist/devicesSlice/thunks.d.ts +1 -1
- package/dist/{index-WXwgRjLt.d.cts → index-C-q632wO.d.cts} +13 -6
- package/dist/{index-CQo3yTUa.d.ts → index-CyokFK2e.d.ts} +13 -6
- package/dist/liststatehook.cjs +5 -3
- package/dist/liststatehook.cjs.map +1 -1
- package/dist/liststatehook.js +5 -3
- package/dist/liststatehook.js.map +1 -1
- package/dist/locationutils.cjs.map +1 -1
- package/dist/locationutils.js.map +1 -1
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.js.map +1 -1
- package/dist/monitorSlice/mocks.cjs.map +1 -1
- package/dist/monitorSlice/mocks.js.map +1 -1
- package/dist/monitorSlice/selectors.d.cts +1 -1
- package/dist/monitorSlice/selectors.d.ts +1 -1
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +1 -1
- package/dist/monitorSlice/thunks.d.ts +1 -1
- package/dist/monitorSlice/thunks.js.map +1 -1
- package/dist/onboardingSlice/index.cjs.map +1 -1
- package/dist/onboardingSlice/index.js.map +1 -1
- package/dist/onboardingSlice/mocks.cjs.map +1 -1
- package/dist/onboardingSlice/selectors.d.cts +1 -1
- package/dist/onboardingSlice/selectors.d.ts +1 -1
- package/dist/onboardingSlice/thunks.d.cts +1 -1
- package/dist/onboardingSlice/thunks.d.ts +1 -1
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.js.map +1 -1
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +2 -2
- package/dist/organizationSlice/selectors.d.ts +2 -2
- package/dist/organizationSlice/selectors.js.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +1 -1
- package/dist/organizationSlice/thunks.d.ts +1 -1
- package/dist/releasesSlice/index.cjs +26 -2
- package/dist/releasesSlice/index.cjs.map +1 -1
- package/dist/releasesSlice/index.d.cts +2 -2
- package/dist/releasesSlice/index.d.ts +2 -2
- package/dist/releasesSlice/index.js +26 -2
- package/dist/releasesSlice/index.js.map +1 -1
- package/dist/releasesSlice/mocks.d.cts +1 -1
- package/dist/releasesSlice/mocks.d.ts +1 -1
- package/dist/releasesSlice/selectors.cjs +15 -5
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.d.cts +245 -9
- package/dist/releasesSlice/selectors.d.ts +245 -9
- package/dist/releasesSlice/selectors.js +12 -6
- package/dist/releasesSlice/selectors.js.map +1 -1
- package/dist/releasesSlice/thunks.cjs +121 -2
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +91 -7
- package/dist/releasesSlice/thunks.d.ts +91 -7
- package/dist/releasesSlice/thunks.js +115 -3
- package/dist/releasesSlice/thunks.js.map +1 -1
- package/dist/selectors.cjs +4 -0
- package/dist/selectors.d.cts +2 -2
- package/dist/selectors.d.ts +2 -2
- package/dist/selectors.js +2 -2
- package/dist/sockethook.cjs +2 -2
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.js.map +1 -1
- package/dist/{store-Boqp1x2t.d.ts → store-D-xvZXiY.d.ts} +2 -2
- package/dist/{store-NOBz-rVZ.d.cts → store-b5cF2WB5.d.cts} +2 -2
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +1 -1
- package/dist/store.d.ts +1 -1
- package/dist/store.js.map +1 -1
- package/dist/storehooks.cjs +3 -3
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.d.cts +1 -1
- package/dist/storehooks.d.ts +1 -1
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +18 -10
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +2 -2
- package/dist/thunks.d.ts +2 -2
- package/dist/thunks.js +8 -6
- package/dist/thunks.js.map +1 -1
- package/dist/useDeploymentDevice.cjs +1 -1
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js.map +1 -1
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/index.js.map +1 -1
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +2 -2
- package/dist/usersSlice/selectors.d.ts +2 -2
- package/dist/usersSlice/selectors.js.map +1 -1
- package/dist/usersSlice/thunks.d.cts +1 -1
- package/dist/usersSlice/thunks.d.ts +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonSelectors.cjs","names":["getOrganization","getFeatures","PLANS","getCurrentUser","getRolesById","rolesByName","mapUserRolesToUiPermissions","getIsServiceProvider","uiPermissionsById","ADDONS","getGlobalSettings","getFilteringAttributes","ATTRIBUTE_SCOPES","getOnboarding","getUserSettings","onboardingSteps","getDevicesById","getDeviceById","getDeploymentsById","getDeploymentsSelectionState","getReleasesById","getSelectedDeploymentDeviceIds","getIssueCountsByType","DEVICE_ISSUE_OPTIONS","getGroupsById","UNGROUPED_GROUP","ALL_DEVICES","defaultReports","getListedDevices","getSearchedDevices","listItemMapper","getAuditLogEntry","getRolesList","rolesById","serviceProviderRolesById","getHas2FA","getUserSettingsInitialized","getSecurityAlertDismissedTimestamp"],"sources":["../src/commonSelectors.ts"],"sourcesContent":["// 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.\nimport type { AuditLog as AuditLogEvent } from '@northern.tech/types/types.gen';\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\nimport dayjs from 'dayjs';\n\nimport { ADDONS, PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './constants';\nimport type { Role } from './constants';\nimport type { Deployment } from './deploymentsSlice';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport type { Device, DeviceGroup } from './devicesSlice';\nimport { getDeviceById, getDevicesById, getFilteringAttributes, getGroupsById, getListedDevices } from './devicesSlice/selectors';\nimport { getIssueCountsByType } from './monitorSlice/selectors';\nimport { onboardingSteps } from './onboardingSlice/constants';\nimport { getOnboarding } from './onboardingSlice/selectors';\nimport { getAuditLogEntry, getIsServiceProvider, getOrganization } from './organizationSlice/selectors';\nimport { getReleasesById } from './releasesSlice/selectors';\nimport {\n getCurrentUser,\n getGlobalSettings,\n getHas2FA,\n getRolesById,\n getRolesList,\n getSecurityAlertDismissedTimestamp,\n getUserSettings,\n getUserSettingsInitialized\n} from './usersSlice/selectors';\nimport { listItemMapper, mapUserRolesToUiPermissions } from './utils';\n\nexport const getIsEnterprise = createSelector(\n [getOrganization, getFeatures],\n ({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || (isHosted && plan === PLANS.enterprise.id)\n);\n\nexport const getUserRoles = createSelector([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById, isEnterprise) => {\n const isAdmin = currentUser.roles?.length ? currentUser.roles.some(role => role === rolesByName.admin) : !isEnterprise;\n const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n});\n\nconst hasPermission = (thing: Record<string, string[]>, permission: string): boolean =>\n Object.values(thing).some(permissions => permissions.includes(permission));\n\nexport const getUserCapabilities = createSelector([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {\n const canManageReleases = hasPermission(uiPermissions.releases, uiPermissionsById.manage.value);\n const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.read.value);\n const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.upload.value);\n\n const canAuditlog = uiPermissions.auditlog.includes(uiPermissionsById.read.value);\n\n const canReadUsers = uiPermissions.userManagement.includes(uiPermissionsById.read.value);\n const canManageUsers = uiPermissions.userManagement.includes(uiPermissionsById.manage.value);\n\n const canReadDevices = hasPermission(uiPermissions.groups, uiPermissionsById.read.value);\n const canWriteDevices = Object.values(uiPermissions.groups).some(\n groupPermissions => groupPermissions.includes(uiPermissionsById.read.value) && groupPermissions.length > 1\n );\n const canTroubleshoot = hasPermission(uiPermissions.groups, uiPermissionsById.connect.value);\n const canManageDevices = hasPermission(uiPermissions.groups, uiPermissionsById.manage.value);\n const canConfigure = hasPermission(uiPermissions.groups, uiPermissionsById.configure.value);\n\n const canDeploy =\n (uiPermissions.deployments?.includes(uiPermissionsById.deploy.value) ?? false) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments?.includes(uiPermissionsById.read.value) ?? false;\n\n return {\n canAuditlog,\n canConfigure,\n canDeploy,\n canManageDevices,\n canManageReleases,\n canManageUsers,\n canReadDeployments,\n canReadDevices,\n canReadReleases,\n canReadUsers,\n canTroubleshoot,\n canUploadReleases,\n canWriteDevices,\n groupsPermissions: uiPermissions.groups,\n releasesPermissions: uiPermissions.releases,\n SPTenant: isServiceProvider\n };\n});\n\nexport const getTenantCapabilities = createSelector(\n [getFeatures, getOrganization, getIsEnterprise],\n (\n {\n hasAuditlogs: isAuditlogEnabled,\n hasDeviceConfig: isDeviceConfigEnabled,\n hasDeviceConnect: isDeviceConnectEnabled,\n hasMonitor: isMonitorEnabled,\n isHosted\n },\n { addons = [], plan = PLANS.os.id },\n isEnterprise\n ) => {\n const canDelta = isEnterprise || plan === PLANS.professional.id;\n const hasAuditlogs = isAuditlogEnabled && isEnterprise;\n const hasDeviceConfig = addons.some(addon => addon.name === ADDONS.configure.id && addon.enabled) || (isDeviceConfigEnabled && !isHosted);\n const hasDeviceConnect = addons.some(addon => addon.name === ADDONS.troubleshoot.id && addon.enabled) || (isDeviceConnectEnabled && !isHosted);\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === ADDONS.monitor.id && addon.enabled);\n return {\n canDelta,\n canRetry: canDelta,\n canSchedule: canDelta,\n hasAuditlogs,\n hasDeviceConfig,\n hasDeviceConnect,\n hasFullFiltering: canDelta,\n hasMonitor,\n isEnterprise,\n plan\n };\n }\n);\n\nexport const getFilterAttributes = createSelector(\n [getGlobalSettings, getFilteringAttributes],\n ({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {\n const deviceNameAttribute = { key: 'name', value: 'Name', scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };\n const deviceIdAttribute = { key: 'id', value: 'Device ID', scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };\n const checkInAttribute = { key: 'check_in_time', value: 'Latest activity', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const updateAttribute = { ...checkInAttribute, key: 'updated_ts', value: 'Last inventory update' };\n const firstRequestAttribute = { key: 'created_ts', value: 'First request', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const attributes = [\n ...previousFilters.map(item => ({\n ...item,\n value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,\n category: 'recently used',\n priority: 0\n })),\n deviceNameAttribute,\n deviceIdAttribute,\n ...identityAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 })),\n ...inventoryAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.inventory, category: ATTRIBUTE_SCOPES.inventory, priority: 2 })),\n ...tagAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 3 })),\n checkInAttribute,\n updateAttribute,\n firstRequestAttribute,\n ...systemAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))\n ];\n return attributeDuplicateFilter(attributes, 'key');\n }\n);\n\nexport const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({\n ...remainder,\n ...onboarding,\n complete: onboarding.complete || complete,\n progress:\n Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)\n ? progress\n : onboarding.progress,\n showTips: !onboarding.showTips ? onboarding.showTips : showTips\n}));\n\nexport const getDemoDeviceAddress = createSelector([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {\n const demoDeviceAddress = `http://${getDemoDeviceAddressHelper(Object.values(devicesById), approach)}`;\n return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;\n});\n\nexport const getDeviceConfigDeployment = createSelector([getDeviceById, getDeploymentsById], (device, deploymentsById) => {\n const { config = {} } = device;\n const { deployment_id: configDeploymentId = '' } = config;\n const deviceConfigDeployment = deploymentsById[configDeploymentId] ?? {};\n return { device, deviceConfigDeployment };\n});\n\nexport const getDeploymentRelease = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getReleasesById],\n (deploymentsById, { selectedId = '' }, releasesById) => {\n const deployment = deploymentsById[selectedId] ?? {};\n return deployment?.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };\n }\n);\n\nexport const getSelectedDeploymentData = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],\n (deploymentsById, { selectedId = '' }, devicesById, selectedDeviceIds) => {\n const deployment = deploymentsById[selectedId] ?? {};\n const { devices = {} } = deployment as Deployment;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...(devices[deviceId] ?? {}) }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector([getTenantCapabilities, getIssueCountsByType], ({ hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key, needsFullFiltering, needsMonitor, title }) => {\n if (isCategory || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n },\n {} as Record<string, { count: number; key: string; title: string }>\n )\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n return Object.keys(\n Object.entries(groups).reduce(\n (accu, [groupName, group]) => {\n if (group.filters || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n },\n { ...uiPermissions.groups } as Record<string, DeviceGroup>\n )\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) =>\n reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])\n);\n\nconst listTypeDeviceIdMap = {\n deviceList: getListedDevices,\n search: getSearchedDevices\n};\nconst deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };\nconst getDeviceMappingDefaults = () => deviceMapDefault;\n\nexport const getMappedDevicesList = createSelector(\n [getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],\n listItemMapper\n);\n\nexport const getAuditlogDevice = createSelector([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {\n let auditlogDevice: Partial<Device> = {};\n if (auditlogEvent) {\n const { object } = auditlogEvent as AuditLogEvent;\n const objectData = object as AuditLogEvent['object'] | undefined;\n if (objectData?.type === 'device' && objectData.id) {\n auditlogDevice = { id: objectData.id, ...(objectData.device ?? {}) } as Device;\n }\n }\n return { ...auditlogDevice, ...(auditlogDevice.id ? devicesById[auditlogDevice.id] : {}) };\n});\n\ntype RoleItem = Role | { value: string };\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce(\n (accu, role) => {\n if (rolesById[role.value as keyof typeof rolesById]) {\n return accu;\n }\n accu.push(role);\n return accu;\n },\n [...Object.values(serviceProviderRolesById)] as RoleItem[]\n );\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ value }) => value === key);\n if (index >= 0) {\n accu = [accu[index], ...accu.filter((_, itemIndex) => index !== itemIndex)];\n }\n return accu;\n }, roles);\n});\n\nexport const getShowSecurityAlert = createSelector(\n [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],\n (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {\n const isOAuth2 = !!currentUser?.sso?.length;\n const userVerified = !!currentUser.verified;\n\n const isHosted = features?.isHosted;\n const canHave2FA = isEnterprise || isHosted;\n const secureOAuthUser = isOAuth2 && userVerified;\n if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {\n return false;\n }\n\n if (dismissedTimestamp === null) {\n return true;\n }\n\n const today = dayjs();\n const dismissedMonthAgo = today.diff(dismissedTimestamp, 'months');\n\n return dismissedMonthAgo > 0;\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,mBAAA,GAAA,iBAAA,gBACX,CAACA,oCAAAA,iBAAiBC,2BAAAA,YAAY,GAC7B,EAAE,OAAOC,2BAAAA,MAAM,GAAG,MAAM,EAAE,cAAc,eAAe,gBAAiB,YAAY,SAASA,2BAAAA,MAAM,WAAW,GAChH;AAED,MAAa,gBAAA,GAAA,iBAAA,gBAA8B;CAACC,6BAAAA;CAAgBC,6BAAAA;CAAc;CAAgB,GAAG,aAAa,WAAW,iBAAiB;CACpI,MAAM,UAAU,YAAY,OAAO,SAAS,YAAY,MAAM,MAAK,SAAQ,SAASC,+BAAAA,YAAY,MAAM,GAAG,CAAC;AAE1G,QAAO;EAAE;EAAS,eADI,UAAUC,cAAAA,4BAA4B,CAACD,+BAAAA,YAAY,MAAM,EAAE,UAAU,GAAGC,cAAAA,4BAA4B,YAAY,SAAS,EAAE,EAAE,UAAU;EAC5H;EACjC;AAEF,MAAM,iBAAiB,OAAiC,eACtD,OAAO,OAAO,MAAM,CAAC,MAAK,gBAAe,YAAY,SAAS,WAAW,CAAC;AAE5E,MAAa,uBAAA,GAAA,iBAAA,gBAAqC,CAAC,cAAcC,oCAAAA,qBAAqB,GAAG,EAAE,iBAAiB,sBAAsB;CAChI,MAAM,oBAAoB,cAAc,cAAc,UAAUC,+BAAAA,kBAAkB,OAAO,MAAM;CAC/F,MAAM,kBAAkB,qBAAqB,cAAc,cAAc,UAAUA,+BAAAA,kBAAkB,KAAK,MAAM;CAChH,MAAM,oBAAoB,qBAAqB,cAAc,cAAc,UAAUA,+BAAAA,kBAAkB,OAAO,MAAM;CAEpH,MAAM,cAAc,cAAc,SAAS,SAASA,+BAAAA,kBAAkB,KAAK,MAAM;CA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AK,YAAY,eAAe,MAAM,EAAE;EAAG;EAC1F;AAGF,MAAa,oBAAA,GAAA,iBAAA,gBAAkC,CAAChB,oCAAAA,iBAAiBgC,6BAAAA,aAAa,GAAG,EAAE,oBAAoB,UAAU;AAC/G,KAAI,iBACF,QAAO,MAAM,QACV,MAAM,SAAS;AACd,MAAIC,+BAAAA,UAAU,KAAK,OACjB,QAAO;AAET,OAAK,KAAK,KAAK;AACf,SAAO;IAET,CAAC,GAAG,OAAO,OAAOC,+BAAAA,yBAAyB,CAAC,CAC7C;AAEH,QAAO,OAAO,KAAKD,+BAAAA,UAAU,CAC1B,SAAS,CACT,QAAQ,MAAM,QAAQ;EACrB,MAAM,QAAQ,KAAK,WAAW,EAAE,YAAY,UAAU,IAAI;AAC1D,MAAI,SAAS,EACX,QAAO,CAAC,KAAK,QAAQ,GAAG,KAAK,QAAQ,GAAG,cAAc,UAAU,UAAU,CAAC;AAE7E,SAAO;IACN,MAAM;EACX;AAEF,MAAa,wBAAA,GAAA,iBAAA,gBACX;CAAC9B,6BAAAA;CAAgBgC,6BAAAA;CAAWlC,2BAAAA;CAAa;CAAiBmC,6BAAAA;CAA4BC,6BAAAA;CAAmC,GACxH,aAAa,QAAQ,UAAU,cAAc,qBAAqB,uBAAuB;CACxF,MAAM,WAAW,CAAC,CAAC,aAAa,KAAK;CACrC,MAAM,eAAe,CAAC,CAAC,YAAY;CAEnC,MAAM,WAAW,UAAU;AAG3B,KAAI,CAAC,eAAe,CAAC,uBAAuB,UAAU,EAFnC,gBAAgB,aACX,YAAY,aAElC,QAAO;AAGT,KAAI,uBAAuB,KACzB,QAAO;AAMT,SAAA,GAAA,MAAA,UAHqB,CACW,KAAK,oBAAoB,SAAS,GAEvC;EAE9B"}
|
|
1
|
+
{"version":3,"file":"commonSelectors.cjs","names":["getOrganization","getFeatures","PLANS","getCurrentUser","getRolesById","rolesByName","mapUserRolesToUiPermissions","getIsServiceProvider","uiPermissionsById","ADDONS","getGlobalSettings","getFilteringAttributes","ATTRIBUTE_SCOPES","getOnboarding","getUserSettings","onboardingSteps","getDevicesById","getDeviceById","getDeploymentsById","getDeploymentsSelectionState","getReleasesById","getSelectedDeploymentDeviceIds","getIssueCountsByType","DEVICE_ISSUE_OPTIONS","getGroupsById","UNGROUPED_GROUP","ALL_DEVICES","defaultReports","getListedDevices","getSearchedDevices","listItemMapper","getAuditLogEntry","getRolesList","rolesById","serviceProviderRolesById","getHas2FA","getUserSettingsInitialized","getSecurityAlertDismissedTimestamp"],"sources":["../src/commonSelectors.ts"],"sourcesContent":["// 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.\nimport type { AuditLog as AuditLogEvent } from '@northern.tech/types/types.gen';\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\nimport dayjs from 'dayjs';\n\nimport { ADDONS, PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './constants';\nimport type { Role } from './constants';\nimport type { Deployment } from './deploymentsSlice';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport type { Device, DeviceGroup } from './devicesSlice';\nimport { getDeviceById, getDevicesById, getFilteringAttributes, getGroupsById, getListedDevices } from './devicesSlice/selectors';\nimport { getIssueCountsByType } from './monitorSlice/selectors';\nimport { onboardingSteps } from './onboardingSlice/constants';\nimport { getOnboarding } from './onboardingSlice/selectors';\nimport { getAuditLogEntry, getIsServiceProvider, getOrganization } from './organizationSlice/selectors';\nimport { getReleasesById } from './releasesSlice/selectors';\nimport {\n getCurrentUser,\n getGlobalSettings,\n getHas2FA,\n getRolesById,\n getRolesList,\n getSecurityAlertDismissedTimestamp,\n getUserSettings,\n getUserSettingsInitialized\n} from './usersSlice/selectors';\nimport { listItemMapper, mapUserRolesToUiPermissions } from './utils';\n\nexport const getIsEnterprise = createSelector(\n [getOrganization, getFeatures],\n ({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || (isHosted && plan === PLANS.enterprise.id)\n);\n\nexport const getUserRoles = createSelector([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById, isEnterprise) => {\n const isAdmin = currentUser.roles?.length ? currentUser.roles.some(role => role === rolesByName.admin) : !isEnterprise;\n const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n});\n\nconst hasPermission = (thing: Record<string, string[]>, permission: string): boolean =>\n Object.values(thing).some(permissions => permissions.includes(permission));\n\nexport const getUserCapabilities = createSelector([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {\n const canManageReleases = hasPermission(uiPermissions.releases, uiPermissionsById.manage.value);\n const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.read.value);\n const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.upload.value);\n\n const canAuditlog = uiPermissions.auditlog.includes(uiPermissionsById.read.value);\n\n const canReadUsers = uiPermissions.userManagement.includes(uiPermissionsById.read.value);\n const canManageUsers = uiPermissions.userManagement.includes(uiPermissionsById.manage.value);\n\n const canReadDevices = hasPermission(uiPermissions.groups, uiPermissionsById.read.value);\n const canWriteDevices = Object.values(uiPermissions.groups).some(\n groupPermissions => groupPermissions.includes(uiPermissionsById.read.value) && groupPermissions.length > 1\n );\n const canTroubleshoot = hasPermission(uiPermissions.groups, uiPermissionsById.connect.value);\n const canManageDevices = hasPermission(uiPermissions.groups, uiPermissionsById.manage.value);\n const canConfigure = hasPermission(uiPermissions.groups, uiPermissionsById.configure.value);\n\n const canDeploy =\n (uiPermissions.deployments?.includes(uiPermissionsById.deploy.value) ?? false) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments?.includes(uiPermissionsById.read.value) ?? false;\n\n return {\n canAuditlog,\n canConfigure,\n canDeploy,\n canManageDevices,\n canManageReleases,\n canManageUsers,\n canReadDeployments,\n canReadDevices,\n canReadReleases,\n canReadUsers,\n canTroubleshoot,\n canUploadReleases,\n canWriteDevices,\n groupsPermissions: uiPermissions.groups,\n releasesPermissions: uiPermissions.releases,\n SPTenant: isServiceProvider\n };\n});\n\nexport const getTenantCapabilities = createSelector(\n [getFeatures, getOrganization, getIsEnterprise],\n (\n {\n hasAuditlogs: isAuditlogEnabled,\n hasDeviceConfig: isDeviceConfigEnabled,\n hasDeviceConnect: isDeviceConnectEnabled,\n hasMonitor: isMonitorEnabled,\n isHosted\n },\n { addons = [], plan = PLANS.os.id },\n isEnterprise\n ) => {\n const canDelta = isEnterprise || plan === PLANS.professional.id;\n const hasAuditlogs = isAuditlogEnabled && isEnterprise;\n const hasDeviceConfig = addons.some(addon => addon.name === ADDONS.configure.id && addon.enabled) || (isDeviceConfigEnabled && !isHosted);\n const hasDeviceConnect = addons.some(addon => addon.name === ADDONS.troubleshoot.id && addon.enabled) || (isDeviceConnectEnabled && !isHosted);\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === ADDONS.monitor.id && addon.enabled);\n return {\n canDelta,\n canRetry: canDelta,\n canSchedule: canDelta,\n hasAuditlogs,\n hasDeviceConfig,\n hasDeviceConnect,\n hasFullFiltering: canDelta,\n hasMonitor,\n isEnterprise,\n plan\n };\n }\n);\n\nexport const getFilterAttributes = createSelector(\n [getGlobalSettings, getFilteringAttributes],\n ({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {\n const deviceNameAttribute = { key: 'name', value: 'Name', scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };\n const deviceIdAttribute = { key: 'id', value: 'Device ID', scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };\n const checkInAttribute = { key: 'check_in_time', value: 'Latest activity', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const updateAttribute = { ...checkInAttribute, key: 'updated_ts', value: 'Last inventory update' };\n const firstRequestAttribute = { key: 'created_ts', value: 'First request', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const attributes = [\n ...previousFilters.map(item => ({\n ...item,\n value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,\n category: 'recently used',\n priority: 0\n })),\n deviceNameAttribute,\n deviceIdAttribute,\n ...identityAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 })),\n ...inventoryAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.inventory, category: ATTRIBUTE_SCOPES.inventory, priority: 2 })),\n ...tagAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 3 })),\n checkInAttribute,\n updateAttribute,\n firstRequestAttribute,\n ...systemAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))\n ];\n return attributeDuplicateFilter(attributes, 'key');\n }\n);\n\nexport const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({\n ...remainder,\n ...onboarding,\n complete: onboarding.complete || complete,\n progress:\n Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)\n ? progress\n : onboarding.progress,\n showTips: !onboarding.showTips ? onboarding.showTips : showTips\n}));\n\nexport const getDemoDeviceAddress = createSelector([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {\n const demoDeviceAddress = `http://${getDemoDeviceAddressHelper(Object.values(devicesById), approach)}`;\n return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;\n});\n\nexport const getDeviceConfigDeployment = createSelector([getDeviceById, getDeploymentsById], (device, deploymentsById) => {\n const { config = {} } = device;\n const { deployment_id: configDeploymentId = '' } = config;\n const deviceConfigDeployment = deploymentsById[configDeploymentId] ?? {};\n return { device, deviceConfigDeployment };\n});\n\nexport const getDeploymentRelease = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getReleasesById],\n (deploymentsById, { selectedId = '' }, releasesById) => {\n const deployment = deploymentsById[selectedId] ?? {};\n return deployment?.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };\n }\n);\n\nexport const getSelectedDeploymentData = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],\n (deploymentsById, { selectedId = '' }, devicesById, selectedDeviceIds) => {\n const deployment = deploymentsById[selectedId] ?? {};\n const { devices = {} } = deployment as Deployment;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...(devices[deviceId] ?? {}) }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector([getTenantCapabilities, getIssueCountsByType], ({ hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key, needsFullFiltering, needsMonitor, title }) => {\n if (isCategory || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n },\n {} as Record<string, { count: number; key: string; title: string }>\n )\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n return Object.keys(\n Object.entries(groups).reduce(\n (accu, [groupName, group]) => {\n if (group.filters || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n },\n { ...uiPermissions.groups } as Record<string, DeviceGroup>\n )\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) =>\n reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])\n);\n\nconst listTypeDeviceIdMap = {\n deviceList: getListedDevices,\n search: getSearchedDevices\n};\nconst deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };\nconst getDeviceMappingDefaults = () => deviceMapDefault;\n\nexport const getMappedDevicesList = createSelector(\n [getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],\n listItemMapper\n);\n\nexport const getAuditlogDevice = createSelector([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {\n let auditlogDevice: Partial<Device> = {};\n if (auditlogEvent) {\n const { object } = auditlogEvent as AuditLogEvent;\n const objectData = object as AuditLogEvent['object'] | undefined;\n if (objectData?.type === 'device' && objectData.id) {\n auditlogDevice = { id: objectData.id, ...(objectData.device ?? {}) } as Device;\n }\n }\n return { ...auditlogDevice, ...(auditlogDevice.id ? devicesById[auditlogDevice.id] : {}) };\n});\n\ntype RoleItem = Role | { value: string };\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce(\n (accu, role) => {\n if (rolesById[role.value as keyof typeof rolesById]) {\n return accu;\n }\n accu.push(role);\n return accu;\n },\n [...Object.values(serviceProviderRolesById)] as RoleItem[]\n );\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ value }) => value === key);\n if (index >= 0) {\n accu = [accu[index], ...accu.filter((_, itemIndex) => index !== itemIndex)];\n }\n return accu;\n }, roles);\n});\n\nexport const getShowSecurityAlert = createSelector(\n [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],\n (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {\n const isOAuth2 = !!currentUser?.sso?.length;\n const userVerified = !!currentUser.verified;\n\n const isHosted = features?.isHosted;\n const canHave2FA = isEnterprise || isHosted;\n const secureOAuthUser = isOAuth2 && userVerified;\n if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {\n return false;\n }\n\n if (dismissedTimestamp === null) {\n return true;\n }\n\n const today = dayjs();\n const dismissedMonthAgo = today.diff(dismissedTimestamp, 'months');\n\n return dismissedMonthAgo > 0;\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,mBAAA,GAAA,iBAAA,gBACX,CAACA,oCAAAA,iBAAiBC,2BAAAA,YAAY,GAC7B,EAAE,OAAOC,2BAAAA,MAAM,GAAG,MAAM,EAAE,cAAc,eAAe,gBAAiB,YAAY,SAASA,2BAAAA,MAAM,WAAW,GAChH;AAED,MAAa,gBAAA,GAAA,iBAAA,gBAA8B;CAACC,6BAAAA;CAAgBC,6BAAAA;CAAc;CAAgB,GAAG,aAAa,WAAW,iBAAiB;CACpI,MAAM,UAAU,YAAY,OAAO,SAAS,YAAY,MAAM,MAAK,SAAQ,SAASC,+BAAAA,YAAY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;EAE7E,OAAO;IACN,MAAM;EACX;AAEF,MAAa,wBAAA,GAAA,iBAAA,gBACX;CAAC9B,6BAAAA;CAAgBgC,6BAAAA;CAAWlC,2BAAAA;CAAa;CAAiBmC,6BAAAA;CAA4BC,6BAAAA;CAAmC,GACxH,aAAa,QAAQ,UAAU,cAAc,qBAAqB,uBAAuB;CACxF,MAAM,WAAW,CAAC,CAAC,aAAa,KAAK;CACrC,MAAM,eAAe,CAAC,CAAC,YAAY;CAEnC,MAAM,WAAW,UAAU;CAG3B,IAAI,CAAC,eAAe,CAAC,uBAAuB,UAAU,EAFnC,gBAAgB,aACX,YAAY,cAElC,OAAO;CAGT,IAAI,uBAAuB,MACzB,OAAO;CAMT,QAAA,GAAA,MAAA,UAF+B,CAAC,KAAK,oBAAoB,SAEjC,GAAG;EAE9B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as AvailablePlans } from "./constants-BFTS6mge.cjs";
|
|
2
2
|
import { S as Role } from "./constants-BrGIx40B.cjs";
|
|
3
3
|
import { a as UserSettings, n as GlobalSettings, o as UserSliceType, r as User } from "./index-BFlHWzjv.cjs";
|
|
4
|
-
import { i as ReleaseSliceType, r as Release } from "./index-
|
|
4
|
+
import { i as ReleaseSliceType, r as Release } from "./index-C-q632wO.cjs";
|
|
5
5
|
import { i as Organization, n as AuditLogSelectionState } from "./types-COdPU2QQ.cjs";
|
|
6
6
|
import { n as OnboardingSliceType, t as OnboardingApproach } from "./index-UPc3wvVd.cjs";
|
|
7
7
|
import { l as SelectionState, o as DeploymentsSliceType, s as DeviceDeployment, t as Deployment } from "./index-BP0uAq36.cjs";
|
|
@@ -9,7 +9,7 @@ import { c as InventoryAttributes, r as DeviceGroup, s as DeviceSliceType, t as
|
|
|
9
9
|
import { t as AppSliceType } from "./index-DwACbyUg.cjs";
|
|
10
10
|
import { t as MonitorSliceType } from "./index-CT5hgXm9.cjs";
|
|
11
11
|
import { t as OrganizationSliceType } from "./index-BbaS7MzW.cjs";
|
|
12
|
-
import { r as RootState } from "./store-
|
|
12
|
+
import { r as RootState } from "./store-b5cF2WB5.cjs";
|
|
13
13
|
import * as _$_northern_tech_types_types_gen0 from "@northern.tech/types/types.gen";
|
|
14
14
|
import { AuditLog } from "@northern.tech/types/types.gen";
|
|
15
15
|
import * as _$reselect from "reselect";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as AvailablePlans } from "./constants-BIIEMVoG.js";
|
|
2
2
|
import { S as Role } from "./constants-CjO3_FOH.js";
|
|
3
3
|
import { a as UserSettings, n as GlobalSettings, o as UserSliceType, r as User } from "./index-ez3oxfRo.js";
|
|
4
|
-
import { i as ReleaseSliceType, r as Release } from "./index-
|
|
4
|
+
import { i as ReleaseSliceType, r as Release } from "./index-CyokFK2e.js";
|
|
5
5
|
import { i as Organization, n as AuditLogSelectionState } from "./types-BPyM8Inu.js";
|
|
6
6
|
import { n as OnboardingSliceType, t as OnboardingApproach } from "./index-CJkrL0oA.js";
|
|
7
7
|
import { l as SelectionState, o as DeploymentsSliceType, s as DeviceDeployment, t as Deployment } from "./index-CkwVnIqd.js";
|
|
@@ -9,7 +9,7 @@ import { c as InventoryAttributes, r as DeviceGroup, s as DeviceSliceType, t as
|
|
|
9
9
|
import { t as AppSliceType } from "./index-Bp1WpATs.js";
|
|
10
10
|
import { t as MonitorSliceType } from "./index-DUvrw_Ed.js";
|
|
11
11
|
import { t as OrganizationSliceType } from "./index-C6wNUfiV.js";
|
|
12
|
-
import { r as RootState } from "./store-
|
|
12
|
+
import { r as RootState } from "./store-D-xvZXiY.js";
|
|
13
13
|
import * as _$_northern_tech_types_types_gen0 from "@northern.tech/types/types.gen";
|
|
14
14
|
import { AuditLog } from "@northern.tech/types/types.gen";
|
|
15
15
|
import * as _$reselect from "reselect";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonSelectors.js","names":["getDemoDeviceAddressHelper"],"sources":["../src/commonSelectors.ts"],"sourcesContent":["// 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.\nimport type { AuditLog as AuditLogEvent } from '@northern.tech/types/types.gen';\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\nimport dayjs from 'dayjs';\n\nimport { ADDONS, PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './constants';\nimport type { Role } from './constants';\nimport type { Deployment } from './deploymentsSlice';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport type { Device, DeviceGroup } from './devicesSlice';\nimport { getDeviceById, getDevicesById, getFilteringAttributes, getGroupsById, getListedDevices } from './devicesSlice/selectors';\nimport { getIssueCountsByType } from './monitorSlice/selectors';\nimport { onboardingSteps } from './onboardingSlice/constants';\nimport { getOnboarding } from './onboardingSlice/selectors';\nimport { getAuditLogEntry, getIsServiceProvider, getOrganization } from './organizationSlice/selectors';\nimport { getReleasesById } from './releasesSlice/selectors';\nimport {\n getCurrentUser,\n getGlobalSettings,\n getHas2FA,\n getRolesById,\n getRolesList,\n getSecurityAlertDismissedTimestamp,\n getUserSettings,\n getUserSettingsInitialized\n} from './usersSlice/selectors';\nimport { listItemMapper, mapUserRolesToUiPermissions } from './utils';\n\nexport const getIsEnterprise = createSelector(\n [getOrganization, getFeatures],\n ({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || (isHosted && plan === PLANS.enterprise.id)\n);\n\nexport const getUserRoles = createSelector([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById, isEnterprise) => {\n const isAdmin = currentUser.roles?.length ? currentUser.roles.some(role => role === rolesByName.admin) : !isEnterprise;\n const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n});\n\nconst hasPermission = (thing: Record<string, string[]>, permission: string): boolean =>\n Object.values(thing).some(permissions => permissions.includes(permission));\n\nexport const getUserCapabilities = createSelector([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {\n const canManageReleases = hasPermission(uiPermissions.releases, uiPermissionsById.manage.value);\n const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.read.value);\n const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.upload.value);\n\n const canAuditlog = uiPermissions.auditlog.includes(uiPermissionsById.read.value);\n\n const canReadUsers = uiPermissions.userManagement.includes(uiPermissionsById.read.value);\n const canManageUsers = uiPermissions.userManagement.includes(uiPermissionsById.manage.value);\n\n const canReadDevices = hasPermission(uiPermissions.groups, uiPermissionsById.read.value);\n const canWriteDevices = Object.values(uiPermissions.groups).some(\n groupPermissions => groupPermissions.includes(uiPermissionsById.read.value) && groupPermissions.length > 1\n );\n const canTroubleshoot = hasPermission(uiPermissions.groups, uiPermissionsById.connect.value);\n const canManageDevices = hasPermission(uiPermissions.groups, uiPermissionsById.manage.value);\n const canConfigure = hasPermission(uiPermissions.groups, uiPermissionsById.configure.value);\n\n const canDeploy =\n (uiPermissions.deployments?.includes(uiPermissionsById.deploy.value) ?? false) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments?.includes(uiPermissionsById.read.value) ?? false;\n\n return {\n canAuditlog,\n canConfigure,\n canDeploy,\n canManageDevices,\n canManageReleases,\n canManageUsers,\n canReadDeployments,\n canReadDevices,\n canReadReleases,\n canReadUsers,\n canTroubleshoot,\n canUploadReleases,\n canWriteDevices,\n groupsPermissions: uiPermissions.groups,\n releasesPermissions: uiPermissions.releases,\n SPTenant: isServiceProvider\n };\n});\n\nexport const getTenantCapabilities = createSelector(\n [getFeatures, getOrganization, getIsEnterprise],\n (\n {\n hasAuditlogs: isAuditlogEnabled,\n hasDeviceConfig: isDeviceConfigEnabled,\n hasDeviceConnect: isDeviceConnectEnabled,\n hasMonitor: isMonitorEnabled,\n isHosted\n },\n { addons = [], plan = PLANS.os.id },\n isEnterprise\n ) => {\n const canDelta = isEnterprise || plan === PLANS.professional.id;\n const hasAuditlogs = isAuditlogEnabled && isEnterprise;\n const hasDeviceConfig = addons.some(addon => addon.name === ADDONS.configure.id && addon.enabled) || (isDeviceConfigEnabled && !isHosted);\n const hasDeviceConnect = addons.some(addon => addon.name === ADDONS.troubleshoot.id && addon.enabled) || (isDeviceConnectEnabled && !isHosted);\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === ADDONS.monitor.id && addon.enabled);\n return {\n canDelta,\n canRetry: canDelta,\n canSchedule: canDelta,\n hasAuditlogs,\n hasDeviceConfig,\n hasDeviceConnect,\n hasFullFiltering: canDelta,\n hasMonitor,\n isEnterprise,\n plan\n };\n }\n);\n\nexport const getFilterAttributes = createSelector(\n [getGlobalSettings, getFilteringAttributes],\n ({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {\n const deviceNameAttribute = { key: 'name', value: 'Name', scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };\n const deviceIdAttribute = { key: 'id', value: 'Device ID', scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };\n const checkInAttribute = { key: 'check_in_time', value: 'Latest activity', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const updateAttribute = { ...checkInAttribute, key: 'updated_ts', value: 'Last inventory update' };\n const firstRequestAttribute = { key: 'created_ts', value: 'First request', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const attributes = [\n ...previousFilters.map(item => ({\n ...item,\n value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,\n category: 'recently used',\n priority: 0\n })),\n deviceNameAttribute,\n deviceIdAttribute,\n ...identityAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 })),\n ...inventoryAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.inventory, category: ATTRIBUTE_SCOPES.inventory, priority: 2 })),\n ...tagAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 3 })),\n checkInAttribute,\n updateAttribute,\n firstRequestAttribute,\n ...systemAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))\n ];\n return attributeDuplicateFilter(attributes, 'key');\n }\n);\n\nexport const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({\n ...remainder,\n ...onboarding,\n complete: onboarding.complete || complete,\n progress:\n Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)\n ? progress\n : onboarding.progress,\n showTips: !onboarding.showTips ? onboarding.showTips : showTips\n}));\n\nexport const getDemoDeviceAddress = createSelector([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {\n const demoDeviceAddress = `http://${getDemoDeviceAddressHelper(Object.values(devicesById), approach)}`;\n return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;\n});\n\nexport const getDeviceConfigDeployment = createSelector([getDeviceById, getDeploymentsById], (device, deploymentsById) => {\n const { config = {} } = device;\n const { deployment_id: configDeploymentId = '' } = config;\n const deviceConfigDeployment = deploymentsById[configDeploymentId] ?? {};\n return { device, deviceConfigDeployment };\n});\n\nexport const getDeploymentRelease = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getReleasesById],\n (deploymentsById, { selectedId = '' }, releasesById) => {\n const deployment = deploymentsById[selectedId] ?? {};\n return deployment?.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };\n }\n);\n\nexport const getSelectedDeploymentData = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],\n (deploymentsById, { selectedId = '' }, devicesById, selectedDeviceIds) => {\n const deployment = deploymentsById[selectedId] ?? {};\n const { devices = {} } = deployment as Deployment;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...(devices[deviceId] ?? {}) }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector([getTenantCapabilities, getIssueCountsByType], ({ hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key, needsFullFiltering, needsMonitor, title }) => {\n if (isCategory || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n },\n {} as Record<string, { count: number; key: string; title: string }>\n )\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n return Object.keys(\n Object.entries(groups).reduce(\n (accu, [groupName, group]) => {\n if (group.filters || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n },\n { ...uiPermissions.groups } as Record<string, DeviceGroup>\n )\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) =>\n reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])\n);\n\nconst listTypeDeviceIdMap = {\n deviceList: getListedDevices,\n search: getSearchedDevices\n};\nconst deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };\nconst getDeviceMappingDefaults = () => deviceMapDefault;\n\nexport const getMappedDevicesList = createSelector(\n [getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],\n listItemMapper\n);\n\nexport const getAuditlogDevice = createSelector([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {\n let auditlogDevice: Partial<Device> = {};\n if (auditlogEvent) {\n const { object } = auditlogEvent as AuditLogEvent;\n const objectData = object as AuditLogEvent['object'] | undefined;\n if (objectData?.type === 'device' && objectData.id) {\n auditlogDevice = { id: objectData.id, ...(objectData.device ?? {}) } as Device;\n }\n }\n return { ...auditlogDevice, ...(auditlogDevice.id ? devicesById[auditlogDevice.id] : {}) };\n});\n\ntype RoleItem = Role | { value: string };\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce(\n (accu, role) => {\n if (rolesById[role.value as keyof typeof rolesById]) {\n return accu;\n }\n accu.push(role);\n return accu;\n },\n [...Object.values(serviceProviderRolesById)] as RoleItem[]\n );\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ value }) => value === key);\n if (index >= 0) {\n accu = [accu[index], ...accu.filter((_, itemIndex) => index !== itemIndex)];\n }\n return accu;\n }, roles);\n});\n\nexport const getShowSecurityAlert = createSelector(\n [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],\n (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {\n const isOAuth2 = !!currentUser?.sso?.length;\n const userVerified = !!currentUser.verified;\n\n const isHosted = features?.isHosted;\n const canHave2FA = isEnterprise || isHosted;\n const secureOAuthUser = isOAuth2 && userVerified;\n if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {\n return false;\n }\n\n if (dismissedTimestamp === null) {\n return true;\n }\n\n const today = dayjs();\n const dismissedMonthAgo = today.diff(dismissedTimestamp, 'months');\n\n return dismissedMonthAgo > 0;\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;AA6CA,MAAa,kBAAkB,eAC7B,CAAC,iBAAiB,YAAY,GAC7B,EAAE,OAAO,MAAM,GAAG,MAAM,EAAE,cAAc,eAAe,gBAAiB,YAAY,SAAS,MAAM,WAAW,GAChH;AAED,MAAa,eAAe,eAAe;CAAC;CAAgB;CAAc;CAAgB,GAAG,aAAa,WAAW,iBAAiB;CACpI,MAAM,UAAU,YAAY,OAAO,SAAS,YAAY,MAAM,MAAK,SAAQ,SAAS,YAAY,MAAM,GAAG,CAAC;AAE1G,QAAO;EAAE;EAAS,eADI,UAAU,4BAA4B,CAAC,YAAY,MAAM,EAAE,UAAU,GAAG,4BAA4B,YAAY,SAAS,EAAE,EAAE,UAAU;EAC5H;EACjC;AAEF,MAAM,iBAAiB,OAAiC,eACtD,OAAO,OAAO,MAAM,CAAC,MAAK,gBAAe,YAAY,SAAS,WAAW,CAAC;AAE5E,MAAa,sBAAsB,eAAe,CAAC,cAAc,qBAAqB,GAAG,EAAE,iBAAiB,sBAAsB;CAChI,MAAM,oBAAoB,cAAc,cAAc,UAAU,kBAAkB,OAAO,MAAM;CAC/F,MAAM,kBAAkB,qBAAqB,cAAc,cAAc,UAAU,kBAAkB,KAAK,MAAM;CA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AM,WAAW,CAAC,CAAC,aAAa,KAAK;CACrC,MAAM,eAAe,CAAC,CAAC,YAAY;CAEnC,MAAM,WAAW,UAAU;AAG3B,KAAI,CAAC,eAAe,CAAC,uBAAuB,UAAU,EAFnC,gBAAgB,aACX,YAAY,aAElC,QAAO;AAGT,KAAI,uBAAuB,KACzB,QAAO;AAMT,QAHc,OAAO,CACW,KAAK,oBAAoB,SAAS,GAEvC;EAE9B"}
|
|
1
|
+
{"version":3,"file":"commonSelectors.js","names":["getDemoDeviceAddressHelper"],"sources":["../src/commonSelectors.ts"],"sourcesContent":["// 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.\nimport type { AuditLog as AuditLogEvent } from '@northern.tech/types/types.gen';\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\nimport dayjs from 'dayjs';\n\nimport { ADDONS, PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './constants';\nimport type { Role } from './constants';\nimport type { Deployment } from './deploymentsSlice';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport type { Device, DeviceGroup } from './devicesSlice';\nimport { getDeviceById, getDevicesById, getFilteringAttributes, getGroupsById, getListedDevices } from './devicesSlice/selectors';\nimport { getIssueCountsByType } from './monitorSlice/selectors';\nimport { onboardingSteps } from './onboardingSlice/constants';\nimport { getOnboarding } from './onboardingSlice/selectors';\nimport { getAuditLogEntry, getIsServiceProvider, getOrganization } from './organizationSlice/selectors';\nimport { getReleasesById } from './releasesSlice/selectors';\nimport {\n getCurrentUser,\n getGlobalSettings,\n getHas2FA,\n getRolesById,\n getRolesList,\n getSecurityAlertDismissedTimestamp,\n getUserSettings,\n getUserSettingsInitialized\n} from './usersSlice/selectors';\nimport { listItemMapper, mapUserRolesToUiPermissions } from './utils';\n\nexport const getIsEnterprise = createSelector(\n [getOrganization, getFeatures],\n ({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || (isHosted && plan === PLANS.enterprise.id)\n);\n\nexport const getUserRoles = createSelector([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById, isEnterprise) => {\n const isAdmin = currentUser.roles?.length ? currentUser.roles.some(role => role === rolesByName.admin) : !isEnterprise;\n const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n});\n\nconst hasPermission = (thing: Record<string, string[]>, permission: string): boolean =>\n Object.values(thing).some(permissions => permissions.includes(permission));\n\nexport const getUserCapabilities = createSelector([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {\n const canManageReleases = hasPermission(uiPermissions.releases, uiPermissionsById.manage.value);\n const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.read.value);\n const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.upload.value);\n\n const canAuditlog = uiPermissions.auditlog.includes(uiPermissionsById.read.value);\n\n const canReadUsers = uiPermissions.userManagement.includes(uiPermissionsById.read.value);\n const canManageUsers = uiPermissions.userManagement.includes(uiPermissionsById.manage.value);\n\n const canReadDevices = hasPermission(uiPermissions.groups, uiPermissionsById.read.value);\n const canWriteDevices = Object.values(uiPermissions.groups).some(\n groupPermissions => groupPermissions.includes(uiPermissionsById.read.value) && groupPermissions.length > 1\n );\n const canTroubleshoot = hasPermission(uiPermissions.groups, uiPermissionsById.connect.value);\n const canManageDevices = hasPermission(uiPermissions.groups, uiPermissionsById.manage.value);\n const canConfigure = hasPermission(uiPermissions.groups, uiPermissionsById.configure.value);\n\n const canDeploy =\n (uiPermissions.deployments?.includes(uiPermissionsById.deploy.value) ?? false) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments?.includes(uiPermissionsById.read.value) ?? false;\n\n return {\n canAuditlog,\n canConfigure,\n canDeploy,\n canManageDevices,\n canManageReleases,\n canManageUsers,\n canReadDeployments,\n canReadDevices,\n canReadReleases,\n canReadUsers,\n canTroubleshoot,\n canUploadReleases,\n canWriteDevices,\n groupsPermissions: uiPermissions.groups,\n releasesPermissions: uiPermissions.releases,\n SPTenant: isServiceProvider\n };\n});\n\nexport const getTenantCapabilities = createSelector(\n [getFeatures, getOrganization, getIsEnterprise],\n (\n {\n hasAuditlogs: isAuditlogEnabled,\n hasDeviceConfig: isDeviceConfigEnabled,\n hasDeviceConnect: isDeviceConnectEnabled,\n hasMonitor: isMonitorEnabled,\n isHosted\n },\n { addons = [], plan = PLANS.os.id },\n isEnterprise\n ) => {\n const canDelta = isEnterprise || plan === PLANS.professional.id;\n const hasAuditlogs = isAuditlogEnabled && isEnterprise;\n const hasDeviceConfig = addons.some(addon => addon.name === ADDONS.configure.id && addon.enabled) || (isDeviceConfigEnabled && !isHosted);\n const hasDeviceConnect = addons.some(addon => addon.name === ADDONS.troubleshoot.id && addon.enabled) || (isDeviceConnectEnabled && !isHosted);\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === ADDONS.monitor.id && addon.enabled);\n return {\n canDelta,\n canRetry: canDelta,\n canSchedule: canDelta,\n hasAuditlogs,\n hasDeviceConfig,\n hasDeviceConnect,\n hasFullFiltering: canDelta,\n hasMonitor,\n isEnterprise,\n plan\n };\n }\n);\n\nexport const getFilterAttributes = createSelector(\n [getGlobalSettings, getFilteringAttributes],\n ({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {\n const deviceNameAttribute = { key: 'name', value: 'Name', scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };\n const deviceIdAttribute = { key: 'id', value: 'Device ID', scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };\n const checkInAttribute = { key: 'check_in_time', value: 'Latest activity', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const updateAttribute = { ...checkInAttribute, key: 'updated_ts', value: 'Last inventory update' };\n const firstRequestAttribute = { key: 'created_ts', value: 'First request', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const attributes = [\n ...previousFilters.map(item => ({\n ...item,\n value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,\n category: 'recently used',\n priority: 0\n })),\n deviceNameAttribute,\n deviceIdAttribute,\n ...identityAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 })),\n ...inventoryAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.inventory, category: ATTRIBUTE_SCOPES.inventory, priority: 2 })),\n ...tagAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 3 })),\n checkInAttribute,\n updateAttribute,\n firstRequestAttribute,\n ...systemAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))\n ];\n return attributeDuplicateFilter(attributes, 'key');\n }\n);\n\nexport const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({\n ...remainder,\n ...onboarding,\n complete: onboarding.complete || complete,\n progress:\n Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)\n ? progress\n : onboarding.progress,\n showTips: !onboarding.showTips ? onboarding.showTips : showTips\n}));\n\nexport const getDemoDeviceAddress = createSelector([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {\n const demoDeviceAddress = `http://${getDemoDeviceAddressHelper(Object.values(devicesById), approach)}`;\n return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;\n});\n\nexport const getDeviceConfigDeployment = createSelector([getDeviceById, getDeploymentsById], (device, deploymentsById) => {\n const { config = {} } = device;\n const { deployment_id: configDeploymentId = '' } = config;\n const deviceConfigDeployment = deploymentsById[configDeploymentId] ?? {};\n return { device, deviceConfigDeployment };\n});\n\nexport const getDeploymentRelease = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getReleasesById],\n (deploymentsById, { selectedId = '' }, releasesById) => {\n const deployment = deploymentsById[selectedId] ?? {};\n return deployment?.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };\n }\n);\n\nexport const getSelectedDeploymentData = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],\n (deploymentsById, { selectedId = '' }, devicesById, selectedDeviceIds) => {\n const deployment = deploymentsById[selectedId] ?? {};\n const { devices = {} } = deployment as Deployment;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...(devices[deviceId] ?? {}) }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector([getTenantCapabilities, getIssueCountsByType], ({ hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key, needsFullFiltering, needsMonitor, title }) => {\n if (isCategory || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n },\n {} as Record<string, { count: number; key: string; title: string }>\n )\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n return Object.keys(\n Object.entries(groups).reduce(\n (accu, [groupName, group]) => {\n if (group.filters || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n },\n { ...uiPermissions.groups } as Record<string, DeviceGroup>\n )\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) =>\n reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])\n);\n\nconst listTypeDeviceIdMap = {\n deviceList: getListedDevices,\n search: getSearchedDevices\n};\nconst deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };\nconst getDeviceMappingDefaults = () => deviceMapDefault;\n\nexport const getMappedDevicesList = createSelector(\n [getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],\n listItemMapper\n);\n\nexport const getAuditlogDevice = createSelector([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {\n let auditlogDevice: Partial<Device> = {};\n if (auditlogEvent) {\n const { object } = auditlogEvent as AuditLogEvent;\n const objectData = object as AuditLogEvent['object'] | undefined;\n if (objectData?.type === 'device' && objectData.id) {\n auditlogDevice = { id: objectData.id, ...(objectData.device ?? {}) } as Device;\n }\n }\n return { ...auditlogDevice, ...(auditlogDevice.id ? devicesById[auditlogDevice.id] : {}) };\n});\n\ntype RoleItem = Role | { value: string };\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce(\n (accu, role) => {\n if (rolesById[role.value as keyof typeof rolesById]) {\n return accu;\n }\n accu.push(role);\n return accu;\n },\n [...Object.values(serviceProviderRolesById)] as RoleItem[]\n );\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ value }) => value === key);\n if (index >= 0) {\n accu = [accu[index], ...accu.filter((_, itemIndex) => index !== itemIndex)];\n }\n return accu;\n }, roles);\n});\n\nexport const getShowSecurityAlert = createSelector(\n [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],\n (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {\n const isOAuth2 = !!currentUser?.sso?.length;\n const userVerified = !!currentUser.verified;\n\n const isHosted = features?.isHosted;\n const canHave2FA = isEnterprise || isHosted;\n const secureOAuthUser = isOAuth2 && userVerified;\n if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {\n return false;\n }\n\n if (dismissedTimestamp === null) {\n return true;\n }\n\n const today = dayjs();\n const dismissedMonthAgo = today.diff(dismissedTimestamp, 'months');\n\n return dismissedMonthAgo > 0;\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;AA6CA,MAAa,kBAAkB,eAC7B,CAAC,iBAAiB,YAAY,GAC7B,EAAE,OAAO,MAAM,GAAG,MAAM,EAAE,cAAc,eAAe,gBAAiB,YAAY,SAAS,MAAM,WAAW,GAChH;AAED,MAAa,eAAe,eAAe;CAAC;CAAgB;CAAc;CAAgB,GAAG,aAAa,WAAW,iBAAiB;CACpI,MAAM,UAAU,YAAY,OAAO,SAAS,YAAY,MAAM,MAAK,SAAQ,SAAS,YAAY,MAAM,GAAG,CAAC;CAE1G,OAAO;EAAE;EAAS,eADI,UAAU,4BAA4B,CAAC,YAAY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AEH,OAAO,OAAO,KAAK,UAAU,CAC1B,SAAS,CACT,QAAQ,MAAM,QAAQ;EACrB,MAAM,QAAQ,KAAK,WAAW,EAAE,YAAY,UAAU,IAAI;EAC1D,IAAI,SAAS,GACX,OAAO,CAAC,KAAK,QAAQ,GAAG,KAAK,QAAQ,GAAG,cAAc,UAAU,UAAU,CAAC;EAE7E,OAAO;IACN,MAAM;EACX;AAEF,MAAa,uBAAuB,eAClC;CAAC;CAAgB;CAAW;CAAa;CAAiB;CAA4B;CAAmC,GACxH,aAAa,QAAQ,UAAU,cAAc,qBAAqB,uBAAuB;CACxF,MAAM,WAAW,CAAC,CAAC,aAAa,KAAK;CACrC,MAAM,eAAe,CAAC,CAAC,YAAY;CAEnC,MAAM,WAAW,UAAU;CAG3B,IAAI,CAAC,eAAe,CAAC,uBAAuB,UAAU,EAFnC,gBAAgB,aACX,YAAY,cAElC,OAAO;CAGT,IAAI,uBAAuB,MACzB,OAAO;CAMT,OAHc,OACiB,CAAC,KAAK,oBAAoB,SAEjC,GAAG;EAE9B"}
|
package/dist/constants.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","names":["ATTRIBUTE_SCOPES","AWS","Azure","DEVICE_LIST_DEFAULTS","SORTING_OPTIONS","DEVICE_FILTERING_OPTIONS","useradmApiUrl","uiPermissionsById"],"sources":["../src/commonConstants.tsx","../src/deploymentsSlice/constants.ts","../src/devicesSlice/constants.ts","../src/organizationSlice/constants.ts","../src/usersSlice/constants.ts"],"sourcesContent":["// 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 { mdiAws as AWS, mdiMicrosoftAzure as Azure } from '@mdi/js';\nimport type { Integration } from '@northern.tech/types/MenderTypes';\n\nimport type { DEVICE_FILTERING_OPTIONS } from './constants';\nimport { ATTRIBUTE_SCOPES } from './constants';\n\nexport const timeUnits = {\n days: 'days',\n minutes: 'minutes',\n hours: 'hours'\n};\n\nexport const UNGROUPED_GROUP = { id: '*|=ungrouped=|*', name: 'Unassigned' };\n\nexport const DEVICE_LIST_MAXIMUM_LENGTH = 50;\n\nexport type FilterOperator = keyof typeof DEVICE_FILTERING_OPTIONS;\n\nconst oneSecond = 1000;\nexport const TIMEOUTS = {\n debounceDefault: 700,\n debounceShort: 300,\n halfASecond: 0.5 * oneSecond,\n oneSecond,\n twoSeconds: 2 * oneSecond,\n threeSeconds: 3 * oneSecond,\n fiveSeconds: 5 * oneSecond,\n refreshDefault: 10 * oneSecond,\n refreshLong: 60 * oneSecond\n};\n\nexport const DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };\n\nexport interface IdAttribute {\n attribute: string;\n scope: string;\n}\nexport const defaultIdAttribute: Readonly<IdAttribute> = Object.freeze({ attribute: 'id', scope: ATTRIBUTE_SCOPES.identity });\n\nexport const productOrder = ['micro', 'standard', 'system'];\n\nexport const credentialTypes = {\n aws: 'aws',\n http: 'http',\n sas: 'sas',\n x509: 'x509'\n};\nexport const EXTERNAL_PROVIDER = {\n 'iot-core': {\n credentialsType: credentialTypes.aws,\n icon: AWS,\n title: 'AWS IoT Core',\n twinTitle: 'Device Shadow',\n provider: 'iot-core',\n enabled: true,\n deviceTwin: true,\n configHint: <>For help finding your AWS IoT Core connection string, check the AWS IoT documentation.</>\n },\n 'iot-hub': {\n credentialsType: credentialTypes.sas,\n icon: Azure,\n title: 'Azure IoT Hub',\n twinTitle: 'Device Twin',\n provider: 'iot-hub',\n enabled: true,\n deviceTwin: true,\n configHint: (\n <span>\n For help finding your Azure IoT Hub connection string, look under 'Shared access policies' in the Microsoft Azure UI as described{' '}\n {\n <a\n href=\"https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n here\n </a>\n }\n .\n </span>\n )\n },\n webhook: {\n credentialsType: credentialTypes.http,\n deviceTwin: false,\n twinTitle: '',\n // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.\n enabled: false,\n provider: 'webhook'\n }\n} as const;\n\nexport interface Webhook extends Integration {\n provider: 'webhook';\n}\n\nexport const emptyWebhook: Webhook = {\n description: '',\n provider: 'webhook',\n credentials: {\n type: EXTERNAL_PROVIDER.webhook.credentialsType,\n [EXTERNAL_PROVIDER.webhook.credentialsType]: {\n secret: '',\n url: ''\n }\n }\n};\n\ninterface CountryType {\n code: string;\n label: string;\n}\nexport const MAX_PAGE_SIZE = 500;\nconst regionNames = new Intl.DisplayNames(['en'], { type: 'region' });\nexport const countries: readonly CountryType[] = [\n 'AD',\n 'AE',\n 'AF',\n 'AG',\n 'AI',\n 'AL',\n 'AM',\n 'AO',\n 'AQ',\n 'AR',\n 'AS',\n 'AT',\n 'AU',\n 'AW',\n 'AX',\n 'AZ',\n 'BA',\n 'BB',\n 'BD',\n 'BE',\n 'BF',\n 'BG',\n 'BH',\n 'BI',\n 'BJ',\n 'BL',\n 'BM',\n 'BN',\n 'BO',\n 'BR',\n 'BS',\n 'BT',\n 'BV',\n 'BW',\n 'BY',\n 'BZ',\n 'CA',\n 'CC',\n 'CD',\n 'CF',\n 'CG',\n 'CH',\n 'CI',\n 'CK',\n 'CL',\n 'CM',\n 'CN',\n 'CO',\n 'CR',\n 'CU',\n 'CV',\n 'CW',\n 'CX',\n 'CY',\n 'CZ',\n 'DE',\n 'DJ',\n 'DK',\n 'DM',\n 'DO',\n 'DZ',\n 'EC',\n 'EE',\n 'EG',\n 'EH',\n 'ER',\n 'ES',\n 'ET',\n 'FI',\n 'FJ',\n 'FK',\n 'FM',\n 'FO',\n 'FR',\n 'GA',\n 'GB',\n 'GD',\n 'GE',\n 'GF',\n 'GG',\n 'GH',\n 'GI',\n 'GL',\n 'GM',\n 'GN',\n 'GP',\n 'GQ',\n 'GR',\n 'GS',\n 'GT',\n 'GU',\n 'GW',\n 'GY',\n 'HK',\n 'HM',\n 'HN',\n 'HR',\n 'HT',\n 'HU',\n 'ID',\n 'IE',\n 'IL',\n 'IM',\n 'IN',\n 'IO',\n 'IQ',\n 'IR',\n 'IS',\n 'IT',\n 'JE',\n 'JM',\n 'JO',\n 'JP',\n 'KE',\n 'KG',\n 'KH',\n 'KI',\n 'KM',\n 'KN',\n 'KP',\n 'KR',\n 'KW',\n 'KY',\n 'KZ',\n 'LA',\n 'LB',\n 'LC',\n 'LI',\n 'LK',\n 'LR',\n 'LS',\n 'LT',\n 'LU',\n 'LV',\n 'LY',\n 'MA',\n 'MC',\n 'MD',\n 'ME',\n 'MF',\n 'MG',\n 'MH',\n 'MK',\n 'ML',\n 'MM',\n 'MN',\n 'MO',\n 'MP',\n 'MQ',\n 'MR',\n 'MS',\n 'MT',\n 'MU',\n 'MV',\n 'MW',\n 'MX',\n 'MY',\n 'MZ',\n 'NA',\n 'NC',\n 'NE',\n 'NF',\n 'NG',\n 'NI',\n 'NL',\n 'NO',\n 'NP',\n 'NR',\n 'NU',\n 'NZ',\n 'OM',\n 'PA',\n 'PE',\n 'PF',\n 'PG',\n 'PH',\n 'PK',\n 'PL',\n 'PM',\n 'PN',\n 'PR',\n 'PS',\n 'PT',\n 'PW',\n 'PY',\n 'QA',\n 'RE',\n 'RO',\n 'RS',\n 'RU',\n 'RW',\n 'SA',\n 'SB',\n 'SC',\n 'SD',\n 'SE',\n 'SG',\n 'SH',\n 'SI',\n 'SJ',\n 'SK',\n 'SL',\n 'SM',\n 'SN',\n 'SO',\n 'SR',\n 'SS',\n 'ST',\n 'SV',\n 'SX',\n 'SY',\n 'SZ',\n 'TC',\n 'TD',\n 'TF',\n 'TG',\n 'TH',\n 'TJ',\n 'TK',\n 'TL',\n 'TM',\n 'TN',\n 'TO',\n 'TR',\n 'TT',\n 'TV',\n 'TW',\n 'TZ',\n 'UA',\n 'UG',\n 'US',\n 'UY',\n 'UZ',\n 'VA',\n 'VC',\n 'VE',\n 'VG',\n 'VI',\n 'VN',\n 'VU',\n 'WF',\n 'WS',\n 'XK',\n 'YE',\n 'YT',\n 'ZA',\n 'ZM',\n 'ZW'\n]\n .map(code => ({ code, label: regionNames.of(code) }))\n .sort((a, b) => a.label.localeCompare(b.label));\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DeploymentStatistics } from '@northern.tech/types/MenderTypes';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS } from '../constants';\n\nconst alreadyInstalled = 'already-installed';\n\nexport const deploymentSubstates = {\n aborted: 'aborted',\n alreadyInstalled,\n decommissioned: 'decommissioned',\n downloading: 'downloading',\n failure: 'failure',\n installing: 'installing',\n noartifact: 'noartifact',\n artifact_too_big: 'artifact_too_big',\n pause_before_committing: 'pause_before_committing',\n pause_before_installing: 'pause_before_installing',\n pause_before_rebooting: 'pause_before_rebooting',\n pending: 'pending',\n rebooting: 'rebooting',\n success: 'success'\n};\n\nexport type DeploymentSubstateMapping = {\n failures: string[];\n inprogress: string[];\n paused: string[];\n pending: string[];\n skipped?: string[];\n successes: string[];\n};\n\nexport const deploymentStatesToSubstates: DeploymentSubstateMapping = {\n failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],\n inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],\n paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],\n pending: [deploymentSubstates.pending],\n successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact, deploymentSubstates.artifact_too_big]\n};\n\nexport const deploymentStatesToSubstatesWithSkipped: DeploymentSubstateMapping = {\n ...deploymentStatesToSubstates,\n failures: [deploymentSubstates.failure],\n skipped: [\n deploymentSubstates.aborted,\n deploymentSubstates.noartifact,\n deploymentSubstates.artifact_too_big,\n deploymentSubstates.alreadyInstalled,\n deploymentSubstates.decommissioned\n ],\n successes: [deploymentSubstates.success]\n};\nexport const installationSubstatesMap = {\n download: {\n title: 'download',\n done: 'downloaded',\n successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactInstall_Enter'\n },\n install: {\n title: 'install',\n done: 'installed',\n successIndicators: [\n deploymentSubstates.rebooting,\n deploymentSubstates.pause_before_rebooting,\n deploymentSubstates.pause_before_committing,\n deploymentSubstates.success\n ],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactReboot_Enter'\n },\n reboot: {\n title: 'reboot',\n done: 'rebooted',\n successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactCommit_Enter'\n },\n commit: {\n title: 'commit',\n done: 'committed',\n successIndicators: deploymentStatesToSubstates.successes,\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: undefined\n }\n};\n\nexport const DEPLOYMENT_STATES = {\n finished: 'finished',\n inprogress: 'inprogress',\n pending: 'pending',\n scheduled: 'scheduled'\n} as const;\n\nexport const listDefaultsByState = {\n [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },\n [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },\n sort: { direction: SORTING_OPTIONS.desc }\n};\n\nexport const DEFAULT_PENDING_INPROGRESS_COUNT = 10;\nexport const DEPLOYMENT_ROUTES = {\n active: {\n key: 'active',\n route: '/deployments/active',\n states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],\n title: 'Active'\n },\n finished: {\n key: 'finished',\n route: '/deployments/finished',\n states: [DEPLOYMENT_STATES.finished],\n title: 'Finished'\n },\n scheduled: {\n key: 'scheduled',\n route: '/deployments/scheduled',\n states: [DEPLOYMENT_STATES.scheduled],\n title: 'Scheduled'\n }\n} as const;\nexport const DEPLOYMENT_TYPES = {\n software: 'software',\n configuration: 'configuration'\n};\nexport const defaultStats = {\n [deploymentSubstates.aborted]: 0,\n [deploymentSubstates.alreadyInstalled]: 0,\n [deploymentSubstates.decommissioned]: 0,\n [deploymentSubstates.downloading]: 0,\n [deploymentSubstates.failure]: 0,\n [deploymentSubstates.installing]: 0,\n [deploymentSubstates.noartifact]: 0,\n [deploymentSubstates.pause_before_committing]: 0,\n [deploymentSubstates.pause_before_installing]: 0,\n [deploymentSubstates.pause_before_rebooting]: 0,\n [deploymentSubstates.pending]: 0,\n [deploymentSubstates.rebooting]: 0,\n [deploymentSubstates.success]: 0\n};\nexport const deploymentDisplayStates = {\n finished: 'Finished',\n scheduled: 'Scheduled',\n skipped: 'Skipped',\n paused: 'Paused',\n pending: 'Pending',\n inprogress: 'In Progress',\n success: 'Success',\n successes: 'Success',\n failure: 'Fail',\n failures: 'Fail'\n};\n\nexport const deploymentPrototype = {\n devices: {},\n name: undefined,\n statistics: { status: {} } as DeploymentStatistics\n};\n\nexport const pauseMap = {\n [deploymentSubstates.pause_before_installing]: {\n title: installationSubstatesMap.download.done,\n followUp: installationSubstatesMap.download.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_rebooting]: {\n title: installationSubstatesMap.install.done,\n followUp: installationSubstatesMap.install.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_committing]: {\n title: installationSubstatesMap.reboot.done,\n followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator\n }\n};\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DEVICE_STATES, FilterOperator } from '../constants';\nimport { DEVICE_FILTERING_OPTIONS } from '../constants';\n\nexport const emptyFilter = { key: null, value: '', operator: DEVICE_FILTERING_OPTIONS.$eq.key as FilterOperator, scope: 'inventory' };\n\n// see https://github.com/mendersoftware/go-lib-micro/tree/master/ws\n// for the description of proto_header and the consts\n// *Note*: this needs to be aligned with mender-connect and deviceconnect.\nexport const DEVICE_MESSAGE_PROTOCOLS = {\n Shell: 1\n};\nexport const DEVICE_MESSAGE_TYPES = {\n Delay: 'delay',\n New: 'new',\n Ping: 'ping',\n Pong: 'pong',\n Resize: 'resize',\n Shell: 'shell',\n Stop: 'stop'\n};\n\n// we can't include the dismiss state with the rest since this would include dismissed devices in several queries\nexport const DEVICE_DISMISSAL_STATE = 'dismiss';\n\nexport type DeviceAuthState = (typeof DEVICE_STATES)[keyof typeof DEVICE_STATES];\n\nexport const DEVICE_CONNECT_STATES = {\n connected: 'connected',\n disconnected: 'disconnected',\n unknown: 'unknown'\n};\n\nexport const geoAttributes = ['geo-lat', 'geo-lon'].map(attribute => ({ attribute, scope: 'inventory' }));\n\nexport const REPORT_CHART_SIZE_LIMIT = 6;\n","// Copyright 2020 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 { useradmApiUrl } from '../constants';\n\nexport const XML_METADATA_FORMAT = 'xml';\nexport const JSON_METADATA_FORMAT = 'json';\n\nexport const getSamlStartUrl = id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/login`;\nexport const getOidcStartUrl = id => `${window.location.origin}${useradmApiUrl}/oidc/${id}/start`;\n\nexport const SSO_TYPES = {\n saml: {\n id: 'saml',\n type: 'saml',\n title: 'SAML',\n metadataFormat: XML_METADATA_FORMAT,\n editorLanguage: XML_METADATA_FORMAT,\n contentType: 'application/samlmetadata+xml',\n getStartUrl: getSamlStartUrl,\n configDetails: [\n { key: 'entityID', label: 'Entity ID', getValue: id => `${window.location.origin}${useradmApiUrl}/sso/sp/metadata/${id}` },\n { key: 'acs', label: 'ACS URL', getValue: id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/acs` },\n { key: 'startURL', label: 'Start URL', getValue: getSamlStartUrl }\n ]\n },\n oidc: {\n id: 'oidc',\n type: 'oidc',\n title: 'OpenID Connect',\n metadataFormat: JSON_METADATA_FORMAT,\n editorLanguage: JSON_METADATA_FORMAT,\n contentType: 'application/json',\n getStartUrl: getOidcStartUrl,\n configDetails: [{ key: 'startURL', label: 'Start Url', getValue: getOidcStartUrl }]\n }\n} as const;\n\nexport type ContentType = (typeof SSO_TYPES)[keyof typeof SSO_TYPES]['contentType'];\n\nexport const auditlogTypes = {\n artifact: { title: 'Artifact', queryParameter: 'object_type', value: 'artifact' },\n deployment: { title: 'Deployment', queryParameter: 'object_deployment_name', value: 'deployment' },\n device: { title: 'Device', queryParameter: 'object_id', value: 'device' },\n user_access_token: { title: 'Personal Access Token', queryParameter: 'user_access_token', value: 'user_access_token' },\n user: { title: 'User', queryParameter: 'object_id', value: 'user' },\n tenant: { title: 'Tenant', queryParameter: 'object_id', value: 'tenant' }\n};\n\nexport const AUDIT_LOGS_TYPES = [auditlogTypes.artifact, auditlogTypes.deployment, auditlogTypes.device, auditlogTypes.user_access_token, auditlogTypes.user];\nexport const SP_AUDIT_LOGS_TYPES = [auditlogTypes.user, auditlogTypes.tenant];\n\nexport const TENANT_LIST_DEFAULT = {\n page: 1,\n perPage: 20\n};\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":";;;;;;;;;AAoBA,MAAa,YAAY;CACvB,MAAM;CACN,SAAS;CACT,OAAO;CACR;AAED,MAAa,kBAAkB;CAAE,IAAI;CAAmB,MAAM;CAAc;AAE5E,MAAa,6BAA6B;AAI1C,MAAM,YAAY;AAClB,MAAa,WAAW;CACtB,iBAAiB;CACjB,eAAe;CACf,aAAa,KAAM;CACnB;CACA,YAAY,IAAI;CAChB,cAAc,IAAI;CAClB,aAAa,IAAI;CACjB,gBAAgB,KAAK;CACrB,aAAa,KAAK;CACnB;AAED,MAAa,uBAAuB;CAAE,UAAU;CAAG,cAAc,UAAU;CAAM;AAMjF,MAAa,qBAA4C,OAAO,OAAO;CAAE,WAAW;CAAM,OAAOA,+BAAAA,iBAAiB;CAAU,CAAC;AAE7H,MAAa,eAAe;CAAC;CAAS;CAAY;CAAS;AAE3D,MAAa,kBAAkB;CAC7B,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACP;AACD,MAAa,oBAAoB;CAC/B,YAAY;EACV,iBAAiB,gBAAgB;EACjC,MAAMC,QAAAA;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YAAY,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,UAAE,0FAAyF,CAAA;EACxG;CACD,WAAW;EACT,iBAAiB,gBAAgB;EACjC,MAAMC,QAAAA;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YACE,iBAAA,GAAA,kBAAA,MAAC,QAAD,EAAA,UAAA;GAAM;GACwI;GAE1I,iBAAA,GAAA,kBAAA,KAAC,KAAD;IACE,MAAK;IACL,QAAO;IACP,KAAI;cACL;IAEG,CAAA;GACL;GAEI,EAAA,CAAA;EAEV;CACD,SAAS;EACP,iBAAiB,gBAAgB;EACjC,YAAY;EACZ,WAAW;EAEX,SAAS;EACT,UAAU;EACX;CACF;AAMD,MAAa,eAAwB;CACnC,aAAa;CACb,UAAU;CACV,aAAa;EACX,MAAM,kBAAkB,QAAQ;GAC/B,kBAAkB,QAAQ,kBAAkB;GAC3C,QAAQ;GACR,KAAK;GACN;EACF;CACF;AAMD,MAAa,gBAAgB;AAC7B,MAAM,cAAc,IAAI,KAAK,aAAa,CAAC,KAAK,EAAE,EAAE,MAAM,UAAU,CAAC;AACrE,MAAa,YAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CACE,KAAI,UAAS;CAAE;CAAM,OAAO,YAAY,GAAG,KAAK;CAAE,EAAE,CACpD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,MAAM,CAAC;ACxWjD,MAAa,sBAAsB;CACjC,SAAS;CACT,kBAJuB;CAKvB,gBAAgB;CAChB,aAAa;CACb,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,kBAAkB;CAClB,yBAAyB;CACzB,yBAAyB;CACzB,wBAAwB;CACxB,SAAS;CACT,WAAW;CACX,SAAS;CACV;AAWD,MAAa,8BAAyD;CACpE,UAAU;EAAC,oBAAoB;EAAS,oBAAoB;EAAS,oBAAoB;EAAe;CACxG,YAAY;EAAC,oBAAoB;EAAa,oBAAoB;EAAY,oBAAoB;EAAU;CAC5G,QAAQ;EAAC,oBAAoB;EAAyB,oBAAoB;EAAwB,oBAAoB;EAAwB;CAC9I,SAAS,CAAC,oBAAoB,QAAQ;CACtC,WAAW;EAAC,oBAAoB;EAAS,oBAAoB;EAAkB,oBAAoB;EAAY,oBAAoB;EAAiB;CACrJ;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B;EAAE,OAAO;EAAyB,gBAAgB;EAAqB,OAAO;EAAqB;CACtH,MAAM;EAAE,OAAO;EAAQ,gBAAgB;EAAa,OAAO;EAAQ;CACnE,QAAQ;EAAE,OAAO;EAAU,gBAAgB;EAAa,OAAO;EAAU;CAC1E;AAED,MAAa,mBAAmB;CAAC,cAAc;CAAU,cAAc;CAAY,cAAc;CAAQ,cAAc;CAAmB,cAAc;CAAK;AAC7J,MAAa,sBAAsB,CAAC,cAAc,MAAM,cAAc,OAAO;AAE7E,MAAa,sBAAsB;CACjC,MAAM;CACN,SAAS;CACV;;;ACVD,MAAa,4BAA4B,MAAM,EAAE,MAAM,oBAAqB,OAAO;CAAE,GAAG;EAAO,OAAO;CAAe,GAAG;AAExH,MAAM,yBAAyB,YAAY,uBACzC,uBAAuB,cAAcC,+BAAAA,kBAAkB,YAAY,kBAAkBA,+BAAAA,kBAAkB,oBAAoB;AAE7H,MAAa,0BAA0B,aAAa,oBAAoB,cAAc,gBACpF,YAAY,cAAc,MAAK,eAAc,sBAAsB,YAAY,mBAAmB,CAAC,IACnG,YAAY,eAAe,MAAK,eAAc,sBAAsB,YAAY,mBAAmB,CAAC;AAEtG,MAAa,cAAc;AAE3B,MAAa,cAAc;AAE3B,MAAa,eAAe,EAAE,aAAa,wBAAwB;AAEnE,MAAa,cAAc;CACzB,MAAM;CACN,MAAM;CACN,QAAQ;CACT"}
|
|
1
|
+
{"version":3,"file":"constants.cjs","names":["ATTRIBUTE_SCOPES","AWS","Azure","DEVICE_LIST_DEFAULTS","SORTING_OPTIONS","DEVICE_FILTERING_OPTIONS","useradmApiUrl","uiPermissionsById"],"sources":["../src/commonConstants.tsx","../src/deploymentsSlice/constants.ts","../src/devicesSlice/constants.ts","../src/organizationSlice/constants.ts","../src/usersSlice/constants.ts"],"sourcesContent":["// 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 { mdiAws as AWS, mdiMicrosoftAzure as Azure } from '@mdi/js';\nimport type { Integration } from '@northern.tech/types/MenderTypes';\n\nimport type { DEVICE_FILTERING_OPTIONS } from './constants';\nimport { ATTRIBUTE_SCOPES } from './constants';\n\nexport const timeUnits = {\n days: 'days',\n minutes: 'minutes',\n hours: 'hours'\n};\n\nexport const UNGROUPED_GROUP = { id: '*|=ungrouped=|*', name: 'Unassigned' };\n\nexport const DEVICE_LIST_MAXIMUM_LENGTH = 50;\n\nexport type FilterOperator = keyof typeof DEVICE_FILTERING_OPTIONS;\n\nconst oneSecond = 1000;\nexport const TIMEOUTS = {\n debounceDefault: 700,\n debounceShort: 300,\n halfASecond: 0.5 * oneSecond,\n oneSecond,\n twoSeconds: 2 * oneSecond,\n threeSeconds: 3 * oneSecond,\n fiveSeconds: 5 * oneSecond,\n refreshDefault: 10 * oneSecond,\n refreshLong: 60 * oneSecond\n};\n\nexport const DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };\n\nexport interface IdAttribute {\n attribute: string;\n scope: string;\n}\nexport const defaultIdAttribute: Readonly<IdAttribute> = Object.freeze({ attribute: 'id', scope: ATTRIBUTE_SCOPES.identity });\n\nexport const productOrder = ['micro', 'standard', 'system'];\n\nexport const credentialTypes = {\n aws: 'aws',\n http: 'http',\n sas: 'sas',\n x509: 'x509'\n};\nexport const EXTERNAL_PROVIDER = {\n 'iot-core': {\n credentialsType: credentialTypes.aws,\n icon: AWS,\n title: 'AWS IoT Core',\n twinTitle: 'Device Shadow',\n provider: 'iot-core',\n enabled: true,\n deviceTwin: true,\n configHint: <>For help finding your AWS IoT Core connection string, check the AWS IoT documentation.</>\n },\n 'iot-hub': {\n credentialsType: credentialTypes.sas,\n icon: Azure,\n title: 'Azure IoT Hub',\n twinTitle: 'Device Twin',\n provider: 'iot-hub',\n enabled: true,\n deviceTwin: true,\n configHint: (\n <span>\n For help finding your Azure IoT Hub connection string, look under 'Shared access policies' in the Microsoft Azure UI as described{' '}\n {\n <a\n href=\"https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n here\n </a>\n }\n .\n </span>\n )\n },\n webhook: {\n credentialsType: credentialTypes.http,\n deviceTwin: false,\n twinTitle: '',\n // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.\n enabled: false,\n provider: 'webhook'\n }\n} as const;\n\nexport interface Webhook extends Integration {\n provider: 'webhook';\n}\n\nexport const emptyWebhook: Webhook = {\n description: '',\n provider: 'webhook',\n credentials: {\n type: EXTERNAL_PROVIDER.webhook.credentialsType,\n [EXTERNAL_PROVIDER.webhook.credentialsType]: {\n secret: '',\n url: ''\n }\n }\n};\n\ninterface CountryType {\n code: string;\n label: string;\n}\nexport const MAX_PAGE_SIZE = 500;\nconst regionNames = new Intl.DisplayNames(['en'], { type: 'region' });\nexport const countries: readonly CountryType[] = [\n 'AD',\n 'AE',\n 'AF',\n 'AG',\n 'AI',\n 'AL',\n 'AM',\n 'AO',\n 'AQ',\n 'AR',\n 'AS',\n 'AT',\n 'AU',\n 'AW',\n 'AX',\n 'AZ',\n 'BA',\n 'BB',\n 'BD',\n 'BE',\n 'BF',\n 'BG',\n 'BH',\n 'BI',\n 'BJ',\n 'BL',\n 'BM',\n 'BN',\n 'BO',\n 'BR',\n 'BS',\n 'BT',\n 'BV',\n 'BW',\n 'BY',\n 'BZ',\n 'CA',\n 'CC',\n 'CD',\n 'CF',\n 'CG',\n 'CH',\n 'CI',\n 'CK',\n 'CL',\n 'CM',\n 'CN',\n 'CO',\n 'CR',\n 'CU',\n 'CV',\n 'CW',\n 'CX',\n 'CY',\n 'CZ',\n 'DE',\n 'DJ',\n 'DK',\n 'DM',\n 'DO',\n 'DZ',\n 'EC',\n 'EE',\n 'EG',\n 'EH',\n 'ER',\n 'ES',\n 'ET',\n 'FI',\n 'FJ',\n 'FK',\n 'FM',\n 'FO',\n 'FR',\n 'GA',\n 'GB',\n 'GD',\n 'GE',\n 'GF',\n 'GG',\n 'GH',\n 'GI',\n 'GL',\n 'GM',\n 'GN',\n 'GP',\n 'GQ',\n 'GR',\n 'GS',\n 'GT',\n 'GU',\n 'GW',\n 'GY',\n 'HK',\n 'HM',\n 'HN',\n 'HR',\n 'HT',\n 'HU',\n 'ID',\n 'IE',\n 'IL',\n 'IM',\n 'IN',\n 'IO',\n 'IQ',\n 'IR',\n 'IS',\n 'IT',\n 'JE',\n 'JM',\n 'JO',\n 'JP',\n 'KE',\n 'KG',\n 'KH',\n 'KI',\n 'KM',\n 'KN',\n 'KP',\n 'KR',\n 'KW',\n 'KY',\n 'KZ',\n 'LA',\n 'LB',\n 'LC',\n 'LI',\n 'LK',\n 'LR',\n 'LS',\n 'LT',\n 'LU',\n 'LV',\n 'LY',\n 'MA',\n 'MC',\n 'MD',\n 'ME',\n 'MF',\n 'MG',\n 'MH',\n 'MK',\n 'ML',\n 'MM',\n 'MN',\n 'MO',\n 'MP',\n 'MQ',\n 'MR',\n 'MS',\n 'MT',\n 'MU',\n 'MV',\n 'MW',\n 'MX',\n 'MY',\n 'MZ',\n 'NA',\n 'NC',\n 'NE',\n 'NF',\n 'NG',\n 'NI',\n 'NL',\n 'NO',\n 'NP',\n 'NR',\n 'NU',\n 'NZ',\n 'OM',\n 'PA',\n 'PE',\n 'PF',\n 'PG',\n 'PH',\n 'PK',\n 'PL',\n 'PM',\n 'PN',\n 'PR',\n 'PS',\n 'PT',\n 'PW',\n 'PY',\n 'QA',\n 'RE',\n 'RO',\n 'RS',\n 'RU',\n 'RW',\n 'SA',\n 'SB',\n 'SC',\n 'SD',\n 'SE',\n 'SG',\n 'SH',\n 'SI',\n 'SJ',\n 'SK',\n 'SL',\n 'SM',\n 'SN',\n 'SO',\n 'SR',\n 'SS',\n 'ST',\n 'SV',\n 'SX',\n 'SY',\n 'SZ',\n 'TC',\n 'TD',\n 'TF',\n 'TG',\n 'TH',\n 'TJ',\n 'TK',\n 'TL',\n 'TM',\n 'TN',\n 'TO',\n 'TR',\n 'TT',\n 'TV',\n 'TW',\n 'TZ',\n 'UA',\n 'UG',\n 'US',\n 'UY',\n 'UZ',\n 'VA',\n 'VC',\n 'VE',\n 'VG',\n 'VI',\n 'VN',\n 'VU',\n 'WF',\n 'WS',\n 'XK',\n 'YE',\n 'YT',\n 'ZA',\n 'ZM',\n 'ZW'\n]\n .map(code => ({ code, label: regionNames.of(code) }))\n .sort((a, b) => a.label.localeCompare(b.label));\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DeploymentStatistics } from '@northern.tech/types/MenderTypes';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS } from '../constants';\n\nconst alreadyInstalled = 'already-installed';\n\nexport const deploymentSubstates = {\n aborted: 'aborted',\n alreadyInstalled,\n decommissioned: 'decommissioned',\n downloading: 'downloading',\n failure: 'failure',\n installing: 'installing',\n noartifact: 'noartifact',\n artifact_too_big: 'artifact_too_big',\n pause_before_committing: 'pause_before_committing',\n pause_before_installing: 'pause_before_installing',\n pause_before_rebooting: 'pause_before_rebooting',\n pending: 'pending',\n rebooting: 'rebooting',\n success: 'success'\n};\n\nexport type DeploymentSubstateMapping = {\n failures: string[];\n inprogress: string[];\n paused: string[];\n pending: string[];\n skipped?: string[];\n successes: string[];\n};\n\nexport const deploymentStatesToSubstates: DeploymentSubstateMapping = {\n failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],\n inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],\n paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],\n pending: [deploymentSubstates.pending],\n successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact, deploymentSubstates.artifact_too_big]\n};\n\nexport const deploymentStatesToSubstatesWithSkipped: DeploymentSubstateMapping = {\n ...deploymentStatesToSubstates,\n failures: [deploymentSubstates.failure],\n skipped: [\n deploymentSubstates.aborted,\n deploymentSubstates.noartifact,\n deploymentSubstates.artifact_too_big,\n deploymentSubstates.alreadyInstalled,\n deploymentSubstates.decommissioned\n ],\n successes: [deploymentSubstates.success]\n};\nexport const installationSubstatesMap = {\n download: {\n title: 'download',\n done: 'downloaded',\n successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactInstall_Enter'\n },\n install: {\n title: 'install',\n done: 'installed',\n successIndicators: [\n deploymentSubstates.rebooting,\n deploymentSubstates.pause_before_rebooting,\n deploymentSubstates.pause_before_committing,\n deploymentSubstates.success\n ],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactReboot_Enter'\n },\n reboot: {\n title: 'reboot',\n done: 'rebooted',\n successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactCommit_Enter'\n },\n commit: {\n title: 'commit',\n done: 'committed',\n successIndicators: deploymentStatesToSubstates.successes,\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: undefined\n }\n};\n\nexport const DEPLOYMENT_STATES = {\n finished: 'finished',\n inprogress: 'inprogress',\n pending: 'pending',\n scheduled: 'scheduled'\n} as const;\n\nexport const listDefaultsByState = {\n [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },\n [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },\n sort: { direction: SORTING_OPTIONS.desc }\n};\n\nexport const DEFAULT_PENDING_INPROGRESS_COUNT = 10;\nexport const DEPLOYMENT_ROUTES = {\n active: {\n key: 'active',\n route: '/deployments/active',\n states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],\n title: 'Active'\n },\n finished: {\n key: 'finished',\n route: '/deployments/finished',\n states: [DEPLOYMENT_STATES.finished],\n title: 'Finished'\n },\n scheduled: {\n key: 'scheduled',\n route: '/deployments/scheduled',\n states: [DEPLOYMENT_STATES.scheduled],\n title: 'Scheduled'\n }\n} as const;\nexport const DEPLOYMENT_TYPES = {\n software: 'software',\n configuration: 'configuration'\n};\nexport const defaultStats = {\n [deploymentSubstates.aborted]: 0,\n [deploymentSubstates.alreadyInstalled]: 0,\n [deploymentSubstates.decommissioned]: 0,\n [deploymentSubstates.downloading]: 0,\n [deploymentSubstates.failure]: 0,\n [deploymentSubstates.installing]: 0,\n [deploymentSubstates.noartifact]: 0,\n [deploymentSubstates.pause_before_committing]: 0,\n [deploymentSubstates.pause_before_installing]: 0,\n [deploymentSubstates.pause_before_rebooting]: 0,\n [deploymentSubstates.pending]: 0,\n [deploymentSubstates.rebooting]: 0,\n [deploymentSubstates.success]: 0\n};\nexport const deploymentDisplayStates = {\n finished: 'Finished',\n scheduled: 'Scheduled',\n skipped: 'Skipped',\n paused: 'Paused',\n pending: 'Pending',\n inprogress: 'In Progress',\n success: 'Success',\n successes: 'Success',\n failure: 'Fail',\n failures: 'Fail'\n};\n\nexport const deploymentPrototype = {\n devices: {},\n name: undefined,\n statistics: { status: {} } as DeploymentStatistics\n};\n\nexport const pauseMap = {\n [deploymentSubstates.pause_before_installing]: {\n title: installationSubstatesMap.download.done,\n followUp: installationSubstatesMap.download.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_rebooting]: {\n title: installationSubstatesMap.install.done,\n followUp: installationSubstatesMap.install.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_committing]: {\n title: installationSubstatesMap.reboot.done,\n followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator\n }\n};\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DEVICE_STATES, FilterOperator } from '../constants';\nimport { DEVICE_FILTERING_OPTIONS } from '../constants';\n\nexport const emptyFilter = { key: null, value: '', operator: DEVICE_FILTERING_OPTIONS.$eq.key as FilterOperator, scope: 'inventory' };\n\n// see https://github.com/mendersoftware/go-lib-micro/tree/master/ws\n// for the description of proto_header and the consts\n// *Note*: this needs to be aligned with mender-connect and deviceconnect.\nexport const DEVICE_MESSAGE_PROTOCOLS = {\n Shell: 1\n};\nexport const DEVICE_MESSAGE_TYPES = {\n Delay: 'delay',\n New: 'new',\n Ping: 'ping',\n Pong: 'pong',\n Resize: 'resize',\n Shell: 'shell',\n Stop: 'stop'\n};\n\n// we can't include the dismiss state with the rest since this would include dismissed devices in several queries\nexport const DEVICE_DISMISSAL_STATE = 'dismiss';\n\nexport type DeviceAuthState = (typeof DEVICE_STATES)[keyof typeof DEVICE_STATES];\n\nexport const DEVICE_CONNECT_STATES = {\n connected: 'connected',\n disconnected: 'disconnected',\n unknown: 'unknown'\n};\n\nexport const geoAttributes = ['geo-lat', 'geo-lon'].map(attribute => ({ attribute, scope: 'inventory' }));\n\nexport const REPORT_CHART_SIZE_LIMIT = 6;\n","// Copyright 2020 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 { useradmApiUrl } from '../constants';\n\nexport const XML_METADATA_FORMAT = 'xml';\nexport const JSON_METADATA_FORMAT = 'json';\n\nexport const getSamlStartUrl = id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/login`;\nexport const getOidcStartUrl = id => `${window.location.origin}${useradmApiUrl}/oidc/${id}/start`;\n\nexport const SSO_TYPES = {\n saml: {\n id: 'saml',\n type: 'saml',\n title: 'SAML',\n metadataFormat: XML_METADATA_FORMAT,\n editorLanguage: XML_METADATA_FORMAT,\n contentType: 'application/samlmetadata+xml',\n getStartUrl: getSamlStartUrl,\n configDetails: [\n { key: 'entityID', label: 'Entity ID', getValue: id => `${window.location.origin}${useradmApiUrl}/sso/sp/metadata/${id}` },\n { key: 'acs', label: 'ACS URL', getValue: id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/acs` },\n { key: 'startURL', label: 'Start URL', getValue: getSamlStartUrl }\n ]\n },\n oidc: {\n id: 'oidc',\n type: 'oidc',\n title: 'OpenID Connect',\n metadataFormat: JSON_METADATA_FORMAT,\n editorLanguage: JSON_METADATA_FORMAT,\n contentType: 'application/json',\n getStartUrl: getOidcStartUrl,\n configDetails: [{ key: 'startURL', label: 'Start Url', getValue: getOidcStartUrl }]\n }\n} as const;\n\nexport type ContentType = (typeof SSO_TYPES)[keyof typeof SSO_TYPES]['contentType'];\n\nexport const auditlogTypes = {\n artifact: { title: 'Artifact', queryParameter: 'object_type', value: 'artifact' },\n deployment: { title: 'Deployment', queryParameter: 'object_deployment_name', value: 'deployment' },\n device: { title: 'Device', queryParameter: 'object_id', value: 'device' },\n user_access_token: { title: 'Personal Access Token', queryParameter: 'user_access_token', value: 'user_access_token' },\n user: { title: 'User', queryParameter: 'object_id', value: 'user' },\n tenant: { title: 'Tenant', queryParameter: 'object_id', value: 'tenant' }\n};\n\nexport const AUDIT_LOGS_TYPES = [auditlogTypes.artifact, auditlogTypes.deployment, auditlogTypes.device, auditlogTypes.user_access_token, auditlogTypes.user];\nexport const SP_AUDIT_LOGS_TYPES = [auditlogTypes.user, auditlogTypes.tenant];\n\nexport const TENANT_LIST_DEFAULT = {\n page: 1,\n perPage: 20\n};\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":";;;;;;;;;AAoBA,MAAa,YAAY;CACvB,MAAM;CACN,SAAS;CACT,OAAO;CACR;AAED,MAAa,kBAAkB;CAAE,IAAI;CAAmB,MAAM;CAAc;AAE5E,MAAa,6BAA6B;AAI1C,MAAM,YAAY;AAClB,MAAa,WAAW;CACtB,iBAAiB;CACjB,eAAe;CACf,aAAa,KAAM;CACnB;CACA,YAAY,IAAI;CAChB,cAAc,IAAI;CAClB,aAAa,IAAI;CACjB,gBAAgB,KAAK;CACrB,aAAa,KAAK;CACnB;AAED,MAAa,uBAAuB;CAAE,UAAU;CAAG,cAAc,UAAU;CAAM;AAMjF,MAAa,qBAA4C,OAAO,OAAO;CAAE,WAAW;CAAM,OAAOA,+BAAAA,iBAAiB;CAAU,CAAC;AAE7H,MAAa,eAAe;CAAC;CAAS;CAAY;CAAS;AAE3D,MAAa,kBAAkB;CAC7B,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACP;AACD,MAAa,oBAAoB;CAC/B,YAAY;EACV,iBAAiB,gBAAgB;EACjC,MAAMC,QAAAA;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YAAY,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,UAAE,0FAAyF,CAAA;EACxG;CACD,WAAW;EACT,iBAAiB,gBAAgB;EACjC,MAAMC,QAAAA;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YACE,iBAAA,GAAA,kBAAA,MAAC,QAAD,EAAA,UAAA;GAAM;GACwI;GAE1I,iBAAA,GAAA,kBAAA,KAAC,KAAD;IACE,MAAK;IACL,QAAO;IACP,KAAI;cACL;IAEG,CAAA;GACL;GAEI,EAAA,CAAA;EAEV;CACD,SAAS;EACP,iBAAiB,gBAAgB;EACjC,YAAY;EACZ,WAAW;EAEX,SAAS;EACT,UAAU;EACX;CACF;AAMD,MAAa,eAAwB;CACnC,aAAa;CACb,UAAU;CACV,aAAa;EACX,MAAM,kBAAkB,QAAQ;GAC/B,kBAAkB,QAAQ,kBAAkB;GAC3C,QAAQ;GACR,KAAK;GACN;EACF;CACF;AAMD,MAAa,gBAAgB;AAC7B,MAAM,cAAc,IAAI,KAAK,aAAa,CAAC,KAAK,EAAE,EAAE,MAAM,UAAU,CAAC;AACrE,MAAa,YAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CACE,KAAI,UAAS;CAAE;CAAM,OAAO,YAAY,GAAG,KAAK;CAAE,EAAE,CACpD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,MAAM,CAAC;ACxWjD,MAAa,sBAAsB;CACjC,SAAS;CACT;CACA,gBAAgB;CAChB,aAAa;CACb,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,kBAAkB;CAClB,yBAAyB;CACzB,yBAAyB;CACzB,wBAAwB;CACxB,SAAS;CACT,WAAW;CACX,SAAS;CACV;AAWD,MAAa,8BAAyD;CACpE,UAAU;EAAC,oBAAoB;EAAS,oBAAoB;EAAS,oBAAoB;EAAe;CACxG,YAAY;EAAC,oBAAoB;EAAa,oBAAoB;EAAY,oBAAoB;EAAU;CAC5G,QAAQ;EAAC,oBAAoB;EAAyB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BAAgB;EAAe,OAAO;EAAY;CACjF,YAAY;EAAE,OAAO;EAAc,gBAAgB;EAA0B,OAAO;EAAc;CAClG,QAAQ;EAAE,OAAO;EAAU,gBAAgB;EAAa,OAAO;EAAU;CACzE,mBAAmB;EAAE,OAAO;EAAyB,gBAAgB;EAAqB,OAAO;EAAqB;CACtH,MAAM;EAAE,OAAO;EAAQ,gBAAgB;EAAa,OAAO;EAAQ;CACnE,QAAQ;EAAE,OAAO;EAAU,gBAAgB;EAAa,OAAO;EAAU;CAC1E;AAED,MAAa,mBAAmB;CAAC,cAAc;CAAU,cAAc;CAAY,cAAc;CAAQ,cAAc;CAAmB,cAAc;CAAK;AAC7J,MAAa,sBAAsB,CAAC,cAAc,MAAM,cAAc,OAAO;AAE7E,MAAa,sBAAsB;CACjC,MAAM;CACN,SAAS;CACV;;;ACVD,MAAa,4BAA4B,MAAM,EAAE,MAAM,oBAAqB,OAAO;CAAE,GAAG;EAAO,OAAO;CAAe,GAAG;AAExH,MAAM,yBAAyB,YAAY,uBACzC,uBAAuB,cAAcC,+BAAAA,kBAAkB,YAAY,kBAAkBA,+BAAAA,kBAAkB,oBAAoB;AAE7H,MAAa,0BAA0B,aAAa,oBAAoB,cAAc,gBACpF,YAAY,cAAc,MAAK,eAAc,sBAAsB,YAAY,mBAAmB,CAAC,IACnG,YAAY,eAAe,MAAK,eAAc,sBAAsB,YAAY,mBAAmB,CAAC;AAEtG,MAAa,cAAc;AAE3B,MAAa,cAAc;AAE3B,MAAa,eAAe,EAAE,aAAa,wBAAwB;AAEnE,MAAa,cAAc;CACzB,MAAM;CACN,MAAM;CACN,QAAQ;CACT"}
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["AWS","Azure"],"sources":["../src/commonConstants.tsx","../src/deploymentsSlice/constants.ts","../src/devicesSlice/constants.ts","../src/organizationSlice/constants.ts","../src/usersSlice/constants.ts"],"sourcesContent":["// 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 { mdiAws as AWS, mdiMicrosoftAzure as Azure } from '@mdi/js';\nimport type { Integration } from '@northern.tech/types/MenderTypes';\n\nimport type { DEVICE_FILTERING_OPTIONS } from './constants';\nimport { ATTRIBUTE_SCOPES } from './constants';\n\nexport const timeUnits = {\n days: 'days',\n minutes: 'minutes',\n hours: 'hours'\n};\n\nexport const UNGROUPED_GROUP = { id: '*|=ungrouped=|*', name: 'Unassigned' };\n\nexport const DEVICE_LIST_MAXIMUM_LENGTH = 50;\n\nexport type FilterOperator = keyof typeof DEVICE_FILTERING_OPTIONS;\n\nconst oneSecond = 1000;\nexport const TIMEOUTS = {\n debounceDefault: 700,\n debounceShort: 300,\n halfASecond: 0.5 * oneSecond,\n oneSecond,\n twoSeconds: 2 * oneSecond,\n threeSeconds: 3 * oneSecond,\n fiveSeconds: 5 * oneSecond,\n refreshDefault: 10 * oneSecond,\n refreshLong: 60 * oneSecond\n};\n\nexport const DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };\n\nexport interface IdAttribute {\n attribute: string;\n scope: string;\n}\nexport const defaultIdAttribute: Readonly<IdAttribute> = Object.freeze({ attribute: 'id', scope: ATTRIBUTE_SCOPES.identity });\n\nexport const productOrder = ['micro', 'standard', 'system'];\n\nexport const credentialTypes = {\n aws: 'aws',\n http: 'http',\n sas: 'sas',\n x509: 'x509'\n};\nexport const EXTERNAL_PROVIDER = {\n 'iot-core': {\n credentialsType: credentialTypes.aws,\n icon: AWS,\n title: 'AWS IoT Core',\n twinTitle: 'Device Shadow',\n provider: 'iot-core',\n enabled: true,\n deviceTwin: true,\n configHint: <>For help finding your AWS IoT Core connection string, check the AWS IoT documentation.</>\n },\n 'iot-hub': {\n credentialsType: credentialTypes.sas,\n icon: Azure,\n title: 'Azure IoT Hub',\n twinTitle: 'Device Twin',\n provider: 'iot-hub',\n enabled: true,\n deviceTwin: true,\n configHint: (\n <span>\n For help finding your Azure IoT Hub connection string, look under 'Shared access policies' in the Microsoft Azure UI as described{' '}\n {\n <a\n href=\"https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n here\n </a>\n }\n .\n </span>\n )\n },\n webhook: {\n credentialsType: credentialTypes.http,\n deviceTwin: false,\n twinTitle: '',\n // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.\n enabled: false,\n provider: 'webhook'\n }\n} as const;\n\nexport interface Webhook extends Integration {\n provider: 'webhook';\n}\n\nexport const emptyWebhook: Webhook = {\n description: '',\n provider: 'webhook',\n credentials: {\n type: EXTERNAL_PROVIDER.webhook.credentialsType,\n [EXTERNAL_PROVIDER.webhook.credentialsType]: {\n secret: '',\n url: ''\n }\n }\n};\n\ninterface CountryType {\n code: string;\n label: string;\n}\nexport const MAX_PAGE_SIZE = 500;\nconst regionNames = new Intl.DisplayNames(['en'], { type: 'region' });\nexport const countries: readonly CountryType[] = [\n 'AD',\n 'AE',\n 'AF',\n 'AG',\n 'AI',\n 'AL',\n 'AM',\n 'AO',\n 'AQ',\n 'AR',\n 'AS',\n 'AT',\n 'AU',\n 'AW',\n 'AX',\n 'AZ',\n 'BA',\n 'BB',\n 'BD',\n 'BE',\n 'BF',\n 'BG',\n 'BH',\n 'BI',\n 'BJ',\n 'BL',\n 'BM',\n 'BN',\n 'BO',\n 'BR',\n 'BS',\n 'BT',\n 'BV',\n 'BW',\n 'BY',\n 'BZ',\n 'CA',\n 'CC',\n 'CD',\n 'CF',\n 'CG',\n 'CH',\n 'CI',\n 'CK',\n 'CL',\n 'CM',\n 'CN',\n 'CO',\n 'CR',\n 'CU',\n 'CV',\n 'CW',\n 'CX',\n 'CY',\n 'CZ',\n 'DE',\n 'DJ',\n 'DK',\n 'DM',\n 'DO',\n 'DZ',\n 'EC',\n 'EE',\n 'EG',\n 'EH',\n 'ER',\n 'ES',\n 'ET',\n 'FI',\n 'FJ',\n 'FK',\n 'FM',\n 'FO',\n 'FR',\n 'GA',\n 'GB',\n 'GD',\n 'GE',\n 'GF',\n 'GG',\n 'GH',\n 'GI',\n 'GL',\n 'GM',\n 'GN',\n 'GP',\n 'GQ',\n 'GR',\n 'GS',\n 'GT',\n 'GU',\n 'GW',\n 'GY',\n 'HK',\n 'HM',\n 'HN',\n 'HR',\n 'HT',\n 'HU',\n 'ID',\n 'IE',\n 'IL',\n 'IM',\n 'IN',\n 'IO',\n 'IQ',\n 'IR',\n 'IS',\n 'IT',\n 'JE',\n 'JM',\n 'JO',\n 'JP',\n 'KE',\n 'KG',\n 'KH',\n 'KI',\n 'KM',\n 'KN',\n 'KP',\n 'KR',\n 'KW',\n 'KY',\n 'KZ',\n 'LA',\n 'LB',\n 'LC',\n 'LI',\n 'LK',\n 'LR',\n 'LS',\n 'LT',\n 'LU',\n 'LV',\n 'LY',\n 'MA',\n 'MC',\n 'MD',\n 'ME',\n 'MF',\n 'MG',\n 'MH',\n 'MK',\n 'ML',\n 'MM',\n 'MN',\n 'MO',\n 'MP',\n 'MQ',\n 'MR',\n 'MS',\n 'MT',\n 'MU',\n 'MV',\n 'MW',\n 'MX',\n 'MY',\n 'MZ',\n 'NA',\n 'NC',\n 'NE',\n 'NF',\n 'NG',\n 'NI',\n 'NL',\n 'NO',\n 'NP',\n 'NR',\n 'NU',\n 'NZ',\n 'OM',\n 'PA',\n 'PE',\n 'PF',\n 'PG',\n 'PH',\n 'PK',\n 'PL',\n 'PM',\n 'PN',\n 'PR',\n 'PS',\n 'PT',\n 'PW',\n 'PY',\n 'QA',\n 'RE',\n 'RO',\n 'RS',\n 'RU',\n 'RW',\n 'SA',\n 'SB',\n 'SC',\n 'SD',\n 'SE',\n 'SG',\n 'SH',\n 'SI',\n 'SJ',\n 'SK',\n 'SL',\n 'SM',\n 'SN',\n 'SO',\n 'SR',\n 'SS',\n 'ST',\n 'SV',\n 'SX',\n 'SY',\n 'SZ',\n 'TC',\n 'TD',\n 'TF',\n 'TG',\n 'TH',\n 'TJ',\n 'TK',\n 'TL',\n 'TM',\n 'TN',\n 'TO',\n 'TR',\n 'TT',\n 'TV',\n 'TW',\n 'TZ',\n 'UA',\n 'UG',\n 'US',\n 'UY',\n 'UZ',\n 'VA',\n 'VC',\n 'VE',\n 'VG',\n 'VI',\n 'VN',\n 'VU',\n 'WF',\n 'WS',\n 'XK',\n 'YE',\n 'YT',\n 'ZA',\n 'ZM',\n 'ZW'\n]\n .map(code => ({ code, label: regionNames.of(code) }))\n .sort((a, b) => a.label.localeCompare(b.label));\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DeploymentStatistics } from '@northern.tech/types/MenderTypes';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS } from '../constants';\n\nconst alreadyInstalled = 'already-installed';\n\nexport const deploymentSubstates = {\n aborted: 'aborted',\n alreadyInstalled,\n decommissioned: 'decommissioned',\n downloading: 'downloading',\n failure: 'failure',\n installing: 'installing',\n noartifact: 'noartifact',\n artifact_too_big: 'artifact_too_big',\n pause_before_committing: 'pause_before_committing',\n pause_before_installing: 'pause_before_installing',\n pause_before_rebooting: 'pause_before_rebooting',\n pending: 'pending',\n rebooting: 'rebooting',\n success: 'success'\n};\n\nexport type DeploymentSubstateMapping = {\n failures: string[];\n inprogress: string[];\n paused: string[];\n pending: string[];\n skipped?: string[];\n successes: string[];\n};\n\nexport const deploymentStatesToSubstates: DeploymentSubstateMapping = {\n failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],\n inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],\n paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],\n pending: [deploymentSubstates.pending],\n successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact, deploymentSubstates.artifact_too_big]\n};\n\nexport const deploymentStatesToSubstatesWithSkipped: DeploymentSubstateMapping = {\n ...deploymentStatesToSubstates,\n failures: [deploymentSubstates.failure],\n skipped: [\n deploymentSubstates.aborted,\n deploymentSubstates.noartifact,\n deploymentSubstates.artifact_too_big,\n deploymentSubstates.alreadyInstalled,\n deploymentSubstates.decommissioned\n ],\n successes: [deploymentSubstates.success]\n};\nexport const installationSubstatesMap = {\n download: {\n title: 'download',\n done: 'downloaded',\n successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactInstall_Enter'\n },\n install: {\n title: 'install',\n done: 'installed',\n successIndicators: [\n deploymentSubstates.rebooting,\n deploymentSubstates.pause_before_rebooting,\n deploymentSubstates.pause_before_committing,\n deploymentSubstates.success\n ],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactReboot_Enter'\n },\n reboot: {\n title: 'reboot',\n done: 'rebooted',\n successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactCommit_Enter'\n },\n commit: {\n title: 'commit',\n done: 'committed',\n successIndicators: deploymentStatesToSubstates.successes,\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: undefined\n }\n};\n\nexport const DEPLOYMENT_STATES = {\n finished: 'finished',\n inprogress: 'inprogress',\n pending: 'pending',\n scheduled: 'scheduled'\n} as const;\n\nexport const listDefaultsByState = {\n [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },\n [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },\n sort: { direction: SORTING_OPTIONS.desc }\n};\n\nexport const DEFAULT_PENDING_INPROGRESS_COUNT = 10;\nexport const DEPLOYMENT_ROUTES = {\n active: {\n key: 'active',\n route: '/deployments/active',\n states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],\n title: 'Active'\n },\n finished: {\n key: 'finished',\n route: '/deployments/finished',\n states: [DEPLOYMENT_STATES.finished],\n title: 'Finished'\n },\n scheduled: {\n key: 'scheduled',\n route: '/deployments/scheduled',\n states: [DEPLOYMENT_STATES.scheduled],\n title: 'Scheduled'\n }\n} as const;\nexport const DEPLOYMENT_TYPES = {\n software: 'software',\n configuration: 'configuration'\n};\nexport const defaultStats = {\n [deploymentSubstates.aborted]: 0,\n [deploymentSubstates.alreadyInstalled]: 0,\n [deploymentSubstates.decommissioned]: 0,\n [deploymentSubstates.downloading]: 0,\n [deploymentSubstates.failure]: 0,\n [deploymentSubstates.installing]: 0,\n [deploymentSubstates.noartifact]: 0,\n [deploymentSubstates.pause_before_committing]: 0,\n [deploymentSubstates.pause_before_installing]: 0,\n [deploymentSubstates.pause_before_rebooting]: 0,\n [deploymentSubstates.pending]: 0,\n [deploymentSubstates.rebooting]: 0,\n [deploymentSubstates.success]: 0\n};\nexport const deploymentDisplayStates = {\n finished: 'Finished',\n scheduled: 'Scheduled',\n skipped: 'Skipped',\n paused: 'Paused',\n pending: 'Pending',\n inprogress: 'In Progress',\n success: 'Success',\n successes: 'Success',\n failure: 'Fail',\n failures: 'Fail'\n};\n\nexport const deploymentPrototype = {\n devices: {},\n name: undefined,\n statistics: { status: {} } as DeploymentStatistics\n};\n\nexport const pauseMap = {\n [deploymentSubstates.pause_before_installing]: {\n title: installationSubstatesMap.download.done,\n followUp: installationSubstatesMap.download.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_rebooting]: {\n title: installationSubstatesMap.install.done,\n followUp: installationSubstatesMap.install.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_committing]: {\n title: installationSubstatesMap.reboot.done,\n followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator\n }\n};\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DEVICE_STATES, FilterOperator } from '../constants';\nimport { DEVICE_FILTERING_OPTIONS } from '../constants';\n\nexport const emptyFilter = { key: null, value: '', operator: DEVICE_FILTERING_OPTIONS.$eq.key as FilterOperator, scope: 'inventory' };\n\n// see https://github.com/mendersoftware/go-lib-micro/tree/master/ws\n// for the description of proto_header and the consts\n// *Note*: this needs to be aligned with mender-connect and deviceconnect.\nexport const DEVICE_MESSAGE_PROTOCOLS = {\n Shell: 1\n};\nexport const DEVICE_MESSAGE_TYPES = {\n Delay: 'delay',\n New: 'new',\n Ping: 'ping',\n Pong: 'pong',\n Resize: 'resize',\n Shell: 'shell',\n Stop: 'stop'\n};\n\n// we can't include the dismiss state with the rest since this would include dismissed devices in several queries\nexport const DEVICE_DISMISSAL_STATE = 'dismiss';\n\nexport type DeviceAuthState = (typeof DEVICE_STATES)[keyof typeof DEVICE_STATES];\n\nexport const DEVICE_CONNECT_STATES = {\n connected: 'connected',\n disconnected: 'disconnected',\n unknown: 'unknown'\n};\n\nexport const geoAttributes = ['geo-lat', 'geo-lon'].map(attribute => ({ attribute, scope: 'inventory' }));\n\nexport const REPORT_CHART_SIZE_LIMIT = 6;\n","// Copyright 2020 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 { useradmApiUrl } from '../constants';\n\nexport const XML_METADATA_FORMAT = 'xml';\nexport const JSON_METADATA_FORMAT = 'json';\n\nexport const getSamlStartUrl = id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/login`;\nexport const getOidcStartUrl = id => `${window.location.origin}${useradmApiUrl}/oidc/${id}/start`;\n\nexport const SSO_TYPES = {\n saml: {\n id: 'saml',\n type: 'saml',\n title: 'SAML',\n metadataFormat: XML_METADATA_FORMAT,\n editorLanguage: XML_METADATA_FORMAT,\n contentType: 'application/samlmetadata+xml',\n getStartUrl: getSamlStartUrl,\n configDetails: [\n { key: 'entityID', label: 'Entity ID', getValue: id => `${window.location.origin}${useradmApiUrl}/sso/sp/metadata/${id}` },\n { key: 'acs', label: 'ACS URL', getValue: id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/acs` },\n { key: 'startURL', label: 'Start URL', getValue: getSamlStartUrl }\n ]\n },\n oidc: {\n id: 'oidc',\n type: 'oidc',\n title: 'OpenID Connect',\n metadataFormat: JSON_METADATA_FORMAT,\n editorLanguage: JSON_METADATA_FORMAT,\n contentType: 'application/json',\n getStartUrl: getOidcStartUrl,\n configDetails: [{ key: 'startURL', label: 'Start Url', getValue: getOidcStartUrl }]\n }\n} as const;\n\nexport type ContentType = (typeof SSO_TYPES)[keyof typeof SSO_TYPES]['contentType'];\n\nexport const auditlogTypes = {\n artifact: { title: 'Artifact', queryParameter: 'object_type', value: 'artifact' },\n deployment: { title: 'Deployment', queryParameter: 'object_deployment_name', value: 'deployment' },\n device: { title: 'Device', queryParameter: 'object_id', value: 'device' },\n user_access_token: { title: 'Personal Access Token', queryParameter: 'user_access_token', value: 'user_access_token' },\n user: { title: 'User', queryParameter: 'object_id', value: 'user' },\n tenant: { title: 'Tenant', queryParameter: 'object_id', value: 'tenant' }\n};\n\nexport const AUDIT_LOGS_TYPES = [auditlogTypes.artifact, auditlogTypes.deployment, auditlogTypes.device, auditlogTypes.user_access_token, auditlogTypes.user];\nexport const SP_AUDIT_LOGS_TYPES = [auditlogTypes.user, auditlogTypes.tenant];\n\nexport const TENANT_LIST_DEFAULT = {\n page: 1,\n perPage: 20\n};\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":";;;;;;;AAoBA,MAAa,YAAY;CACvB,MAAM;CACN,SAAS;CACT,OAAO;CACR;AAED,MAAa,kBAAkB;CAAE,IAAI;CAAmB,MAAM;CAAc;AAE5E,MAAa,6BAA6B;AAI1C,MAAM,YAAY;AAClB,MAAa,WAAW;CACtB,iBAAiB;CACjB,eAAe;CACf,aAAa,KAAM;CACnB;CACA,YAAY,IAAI;CAChB,cAAc,IAAI;CAClB,aAAa,IAAI;CACjB,gBAAgB,KAAK;CACrB,aAAa,KAAK;CACnB;AAED,MAAa,uBAAuB;CAAE,UAAU;CAAG,cAAc,UAAU;CAAM;AAMjF,MAAa,qBAA4C,OAAO,OAAO;CAAE,WAAW;CAAM,OAAO,iBAAiB;CAAU,CAAC;AAE7H,MAAa,eAAe;CAAC;CAAS;CAAY;CAAS;AAE3D,MAAa,kBAAkB;CAC7B,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACP;AACD,MAAa,oBAAoB;CAC/B,YAAY;EACV,iBAAiB,gBAAgB;EACjC,MAAMA;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YAAY,oBAAA,UAAA,EAAA,UAAE,0FAAyF,CAAA;EACxG;CACD,WAAW;EACT,iBAAiB,gBAAgB;EACjC,MAAMC;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YACE,qBAAC,QAAD,EAAA,UAAA;GAAM;GACwI;GAE1I,oBAAC,KAAD;IACE,MAAK;IACL,QAAO;IACP,KAAI;cACL;IAEG,CAAA;GACL;GAEI,EAAA,CAAA;EAEV;CACD,SAAS;EACP,iBAAiB,gBAAgB;EACjC,YAAY;EACZ,WAAW;EAEX,SAAS;EACT,UAAU;EACX;CACF;AAMD,MAAa,eAAwB;CACnC,aAAa;CACb,UAAU;CACV,aAAa;EACX,MAAM,kBAAkB,QAAQ;GAC/B,kBAAkB,QAAQ,kBAAkB;GAC3C,QAAQ;GACR,KAAK;GACN;EACF;CACF;AAMD,MAAa,gBAAgB;AAC7B,MAAM,cAAc,IAAI,KAAK,aAAa,CAAC,KAAK,EAAE,EAAE,MAAM,UAAU,CAAC;AACrE,MAAa,YAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CACE,KAAI,UAAS;CAAE;CAAM,OAAO,YAAY,GAAG,KAAK;CAAE,EAAE,CACpD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,MAAM,CAAC;ACxWjD,MAAa,sBAAsB;CACjC,SAAS;CACT,kBAJuB;CAKvB,gBAAgB;CAChB,aAAa;CACb,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,kBAAkB;CAClB,yBAAyB;CACzB,yBAAyB;CACzB,wBAAwB;CACxB,SAAS;CACT,WAAW;CACX,SAAS;CACV;AAWD,MAAa,8BAAyD;CACpE,UAAU;EAAC,oBAAoB;EAAS,oBAAoB;EAAS,oBAAoB;EAAe;CACxG,YAAY;EAAC,oBAAoB;EAAa,oBAAoB;EAAY,oBAAoB;EAAU;CAC5G,QAAQ;EAAC,o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AgB;EAA0B,OAAO;EAAc;CAClG,QAAQ;EAAE,OAAO;EAAU,gBAAgB;EAAa,OAAO;EAAU;CACzE,mBAAmB;EAAE,OAAO;EAAyB,gBAAgB;EAAqB,OAAO;EAAqB;CACtH,MAAM;EAAE,OAAO;EAAQ,gBAAgB;EAAa,OAAO;EAAQ;CACnE,QAAQ;EAAE,OAAO;EAAU,gBAAgB;EAAa,OAAO;EAAU;CAC1E;AAED,MAAa,mBAAmB;CAAC,cAAc;CAAU,cAAc;CAAY,cAAc;CAAQ,cAAc;CAAmB,cAAc;CAAK;AAC7J,MAAa,sBAAsB,CAAC,cAAc,MAAM,cAAc,OAAO;AAE7E,MAAa,sBAAsB;CACjC,MAAM;CACN,SAAS;CACV;;;ACVD,MAAa,4BAA4B,MAAM,EAAE,MAAM,oBAAqB,OAAO;CAAE,GAAG;EAAO,OAAO;CAAe,GAAG;AAExH,MAAM,yBAAyB,YAAY,uBACzC,uBAAuB,cAAc,kBAAkB,YAAY,kBAAkB,kBAAkB,oBAAoB;AAE7H,MAAa,0BAA0B,aAAa,oBAAoB,cAAc,gBACpF,YAAY,cAAc,MAAK,eAAc,sBAAsB,YAAY,mBAAmB,CAAC,IACnG,YAAY,eAAe,MAAK,eAAc,sBAAsB,YAAY,mBAAmB,CAAC;AAEtG,MAAa,cAAc;AAE3B,MAAa,cAAc;AAE3B,MAAa,eAAe,EAAE,aAAa,wBAAwB;AAEnE,MAAa,cAAc;CACzB,MAAM;CACN,MAAM;CACN,QAAQ;CACT"}
|
|
1
|
+
{"version":3,"file":"constants.js","names":["AWS","Azure"],"sources":["../src/commonConstants.tsx","../src/deploymentsSlice/constants.ts","../src/devicesSlice/constants.ts","../src/organizationSlice/constants.ts","../src/usersSlice/constants.ts"],"sourcesContent":["// 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 { mdiAws as AWS, mdiMicrosoftAzure as Azure } from '@mdi/js';\nimport type { Integration } from '@northern.tech/types/MenderTypes';\n\nimport type { DEVICE_FILTERING_OPTIONS } from './constants';\nimport { ATTRIBUTE_SCOPES } from './constants';\n\nexport const timeUnits = {\n days: 'days',\n minutes: 'minutes',\n hours: 'hours'\n};\n\nexport const UNGROUPED_GROUP = { id: '*|=ungrouped=|*', name: 'Unassigned' };\n\nexport const DEVICE_LIST_MAXIMUM_LENGTH = 50;\n\nexport type FilterOperator = keyof typeof DEVICE_FILTERING_OPTIONS;\n\nconst oneSecond = 1000;\nexport const TIMEOUTS = {\n debounceDefault: 700,\n debounceShort: 300,\n halfASecond: 0.5 * oneSecond,\n oneSecond,\n twoSeconds: 2 * oneSecond,\n threeSeconds: 3 * oneSecond,\n fiveSeconds: 5 * oneSecond,\n refreshDefault: 10 * oneSecond,\n refreshLong: 60 * oneSecond\n};\n\nexport const DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };\n\nexport interface IdAttribute {\n attribute: string;\n scope: string;\n}\nexport const defaultIdAttribute: Readonly<IdAttribute> = Object.freeze({ attribute: 'id', scope: ATTRIBUTE_SCOPES.identity });\n\nexport const productOrder = ['micro', 'standard', 'system'];\n\nexport const credentialTypes = {\n aws: 'aws',\n http: 'http',\n sas: 'sas',\n x509: 'x509'\n};\nexport const EXTERNAL_PROVIDER = {\n 'iot-core': {\n credentialsType: credentialTypes.aws,\n icon: AWS,\n title: 'AWS IoT Core',\n twinTitle: 'Device Shadow',\n provider: 'iot-core',\n enabled: true,\n deviceTwin: true,\n configHint: <>For help finding your AWS IoT Core connection string, check the AWS IoT documentation.</>\n },\n 'iot-hub': {\n credentialsType: credentialTypes.sas,\n icon: Azure,\n title: 'Azure IoT Hub',\n twinTitle: 'Device Twin',\n provider: 'iot-hub',\n enabled: true,\n deviceTwin: true,\n configHint: (\n <span>\n For help finding your Azure IoT Hub connection string, look under 'Shared access policies' in the Microsoft Azure UI as described{' '}\n {\n <a\n href=\"https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n here\n </a>\n }\n .\n </span>\n )\n },\n webhook: {\n credentialsType: credentialTypes.http,\n deviceTwin: false,\n twinTitle: '',\n // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.\n enabled: false,\n provider: 'webhook'\n }\n} as const;\n\nexport interface Webhook extends Integration {\n provider: 'webhook';\n}\n\nexport const emptyWebhook: Webhook = {\n description: '',\n provider: 'webhook',\n credentials: {\n type: EXTERNAL_PROVIDER.webhook.credentialsType,\n [EXTERNAL_PROVIDER.webhook.credentialsType]: {\n secret: '',\n url: ''\n }\n }\n};\n\ninterface CountryType {\n code: string;\n label: string;\n}\nexport const MAX_PAGE_SIZE = 500;\nconst regionNames = new Intl.DisplayNames(['en'], { type: 'region' });\nexport const countries: readonly CountryType[] = [\n 'AD',\n 'AE',\n 'AF',\n 'AG',\n 'AI',\n 'AL',\n 'AM',\n 'AO',\n 'AQ',\n 'AR',\n 'AS',\n 'AT',\n 'AU',\n 'AW',\n 'AX',\n 'AZ',\n 'BA',\n 'BB',\n 'BD',\n 'BE',\n 'BF',\n 'BG',\n 'BH',\n 'BI',\n 'BJ',\n 'BL',\n 'BM',\n 'BN',\n 'BO',\n 'BR',\n 'BS',\n 'BT',\n 'BV',\n 'BW',\n 'BY',\n 'BZ',\n 'CA',\n 'CC',\n 'CD',\n 'CF',\n 'CG',\n 'CH',\n 'CI',\n 'CK',\n 'CL',\n 'CM',\n 'CN',\n 'CO',\n 'CR',\n 'CU',\n 'CV',\n 'CW',\n 'CX',\n 'CY',\n 'CZ',\n 'DE',\n 'DJ',\n 'DK',\n 'DM',\n 'DO',\n 'DZ',\n 'EC',\n 'EE',\n 'EG',\n 'EH',\n 'ER',\n 'ES',\n 'ET',\n 'FI',\n 'FJ',\n 'FK',\n 'FM',\n 'FO',\n 'FR',\n 'GA',\n 'GB',\n 'GD',\n 'GE',\n 'GF',\n 'GG',\n 'GH',\n 'GI',\n 'GL',\n 'GM',\n 'GN',\n 'GP',\n 'GQ',\n 'GR',\n 'GS',\n 'GT',\n 'GU',\n 'GW',\n 'GY',\n 'HK',\n 'HM',\n 'HN',\n 'HR',\n 'HT',\n 'HU',\n 'ID',\n 'IE',\n 'IL',\n 'IM',\n 'IN',\n 'IO',\n 'IQ',\n 'IR',\n 'IS',\n 'IT',\n 'JE',\n 'JM',\n 'JO',\n 'JP',\n 'KE',\n 'KG',\n 'KH',\n 'KI',\n 'KM',\n 'KN',\n 'KP',\n 'KR',\n 'KW',\n 'KY',\n 'KZ',\n 'LA',\n 'LB',\n 'LC',\n 'LI',\n 'LK',\n 'LR',\n 'LS',\n 'LT',\n 'LU',\n 'LV',\n 'LY',\n 'MA',\n 'MC',\n 'MD',\n 'ME',\n 'MF',\n 'MG',\n 'MH',\n 'MK',\n 'ML',\n 'MM',\n 'MN',\n 'MO',\n 'MP',\n 'MQ',\n 'MR',\n 'MS',\n 'MT',\n 'MU',\n 'MV',\n 'MW',\n 'MX',\n 'MY',\n 'MZ',\n 'NA',\n 'NC',\n 'NE',\n 'NF',\n 'NG',\n 'NI',\n 'NL',\n 'NO',\n 'NP',\n 'NR',\n 'NU',\n 'NZ',\n 'OM',\n 'PA',\n 'PE',\n 'PF',\n 'PG',\n 'PH',\n 'PK',\n 'PL',\n 'PM',\n 'PN',\n 'PR',\n 'PS',\n 'PT',\n 'PW',\n 'PY',\n 'QA',\n 'RE',\n 'RO',\n 'RS',\n 'RU',\n 'RW',\n 'SA',\n 'SB',\n 'SC',\n 'SD',\n 'SE',\n 'SG',\n 'SH',\n 'SI',\n 'SJ',\n 'SK',\n 'SL',\n 'SM',\n 'SN',\n 'SO',\n 'SR',\n 'SS',\n 'ST',\n 'SV',\n 'SX',\n 'SY',\n 'SZ',\n 'TC',\n 'TD',\n 'TF',\n 'TG',\n 'TH',\n 'TJ',\n 'TK',\n 'TL',\n 'TM',\n 'TN',\n 'TO',\n 'TR',\n 'TT',\n 'TV',\n 'TW',\n 'TZ',\n 'UA',\n 'UG',\n 'US',\n 'UY',\n 'UZ',\n 'VA',\n 'VC',\n 'VE',\n 'VG',\n 'VI',\n 'VN',\n 'VU',\n 'WF',\n 'WS',\n 'XK',\n 'YE',\n 'YT',\n 'ZA',\n 'ZM',\n 'ZW'\n]\n .map(code => ({ code, label: regionNames.of(code) }))\n .sort((a, b) => a.label.localeCompare(b.label));\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DeploymentStatistics } from '@northern.tech/types/MenderTypes';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS } from '../constants';\n\nconst alreadyInstalled = 'already-installed';\n\nexport const deploymentSubstates = {\n aborted: 'aborted',\n alreadyInstalled,\n decommissioned: 'decommissioned',\n downloading: 'downloading',\n failure: 'failure',\n installing: 'installing',\n noartifact: 'noartifact',\n artifact_too_big: 'artifact_too_big',\n pause_before_committing: 'pause_before_committing',\n pause_before_installing: 'pause_before_installing',\n pause_before_rebooting: 'pause_before_rebooting',\n pending: 'pending',\n rebooting: 'rebooting',\n success: 'success'\n};\n\nexport type DeploymentSubstateMapping = {\n failures: string[];\n inprogress: string[];\n paused: string[];\n pending: string[];\n skipped?: string[];\n successes: string[];\n};\n\nexport const deploymentStatesToSubstates: DeploymentSubstateMapping = {\n failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],\n inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],\n paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],\n pending: [deploymentSubstates.pending],\n successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact, deploymentSubstates.artifact_too_big]\n};\n\nexport const deploymentStatesToSubstatesWithSkipped: DeploymentSubstateMapping = {\n ...deploymentStatesToSubstates,\n failures: [deploymentSubstates.failure],\n skipped: [\n deploymentSubstates.aborted,\n deploymentSubstates.noartifact,\n deploymentSubstates.artifact_too_big,\n deploymentSubstates.alreadyInstalled,\n deploymentSubstates.decommissioned\n ],\n successes: [deploymentSubstates.success]\n};\nexport const installationSubstatesMap = {\n download: {\n title: 'download',\n done: 'downloaded',\n successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactInstall_Enter'\n },\n install: {\n title: 'install',\n done: 'installed',\n successIndicators: [\n deploymentSubstates.rebooting,\n deploymentSubstates.pause_before_rebooting,\n deploymentSubstates.pause_before_committing,\n deploymentSubstates.success\n ],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactReboot_Enter'\n },\n reboot: {\n title: 'reboot',\n done: 'rebooted',\n successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactCommit_Enter'\n },\n commit: {\n title: 'commit',\n done: 'committed',\n successIndicators: deploymentStatesToSubstates.successes,\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: undefined\n }\n};\n\nexport const DEPLOYMENT_STATES = {\n finished: 'finished',\n inprogress: 'inprogress',\n pending: 'pending',\n scheduled: 'scheduled'\n} as const;\n\nexport const listDefaultsByState = {\n [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },\n [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },\n sort: { direction: SORTING_OPTIONS.desc }\n};\n\nexport const DEFAULT_PENDING_INPROGRESS_COUNT = 10;\nexport const DEPLOYMENT_ROUTES = {\n active: {\n key: 'active',\n route: '/deployments/active',\n states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],\n title: 'Active'\n },\n finished: {\n key: 'finished',\n route: '/deployments/finished',\n states: [DEPLOYMENT_STATES.finished],\n title: 'Finished'\n },\n scheduled: {\n key: 'scheduled',\n route: '/deployments/scheduled',\n states: [DEPLOYMENT_STATES.scheduled],\n title: 'Scheduled'\n }\n} as const;\nexport const DEPLOYMENT_TYPES = {\n software: 'software',\n configuration: 'configuration'\n};\nexport const defaultStats = {\n [deploymentSubstates.aborted]: 0,\n [deploymentSubstates.alreadyInstalled]: 0,\n [deploymentSubstates.decommissioned]: 0,\n [deploymentSubstates.downloading]: 0,\n [deploymentSubstates.failure]: 0,\n [deploymentSubstates.installing]: 0,\n [deploymentSubstates.noartifact]: 0,\n [deploymentSubstates.pause_before_committing]: 0,\n [deploymentSubstates.pause_before_installing]: 0,\n [deploymentSubstates.pause_before_rebooting]: 0,\n [deploymentSubstates.pending]: 0,\n [deploymentSubstates.rebooting]: 0,\n [deploymentSubstates.success]: 0\n};\nexport const deploymentDisplayStates = {\n finished: 'Finished',\n scheduled: 'Scheduled',\n skipped: 'Skipped',\n paused: 'Paused',\n pending: 'Pending',\n inprogress: 'In Progress',\n success: 'Success',\n successes: 'Success',\n failure: 'Fail',\n failures: 'Fail'\n};\n\nexport const deploymentPrototype = {\n devices: {},\n name: undefined,\n statistics: { status: {} } as DeploymentStatistics\n};\n\nexport const pauseMap = {\n [deploymentSubstates.pause_before_installing]: {\n title: installationSubstatesMap.download.done,\n followUp: installationSubstatesMap.download.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_rebooting]: {\n title: installationSubstatesMap.install.done,\n followUp: installationSubstatesMap.install.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_committing]: {\n title: installationSubstatesMap.reboot.done,\n followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator\n }\n};\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DEVICE_STATES, FilterOperator } from '../constants';\nimport { DEVICE_FILTERING_OPTIONS } from '../constants';\n\nexport const emptyFilter = { key: null, value: '', operator: DEVICE_FILTERING_OPTIONS.$eq.key as FilterOperator, scope: 'inventory' };\n\n// see https://github.com/mendersoftware/go-lib-micro/tree/master/ws\n// for the description of proto_header and the consts\n// *Note*: this needs to be aligned with mender-connect and deviceconnect.\nexport const DEVICE_MESSAGE_PROTOCOLS = {\n Shell: 1\n};\nexport const DEVICE_MESSAGE_TYPES = {\n Delay: 'delay',\n New: 'new',\n Ping: 'ping',\n Pong: 'pong',\n Resize: 'resize',\n Shell: 'shell',\n Stop: 'stop'\n};\n\n// we can't include the dismiss state with the rest since this would include dismissed devices in several queries\nexport const DEVICE_DISMISSAL_STATE = 'dismiss';\n\nexport type DeviceAuthState = (typeof DEVICE_STATES)[keyof typeof DEVICE_STATES];\n\nexport const DEVICE_CONNECT_STATES = {\n connected: 'connected',\n disconnected: 'disconnected',\n unknown: 'unknown'\n};\n\nexport const geoAttributes = ['geo-lat', 'geo-lon'].map(attribute => ({ attribute, scope: 'inventory' }));\n\nexport const REPORT_CHART_SIZE_LIMIT = 6;\n","// Copyright 2020 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 { useradmApiUrl } from '../constants';\n\nexport const XML_METADATA_FORMAT = 'xml';\nexport const JSON_METADATA_FORMAT = 'json';\n\nexport const getSamlStartUrl = id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/login`;\nexport const getOidcStartUrl = id => `${window.location.origin}${useradmApiUrl}/oidc/${id}/start`;\n\nexport const SSO_TYPES = {\n saml: {\n id: 'saml',\n type: 'saml',\n title: 'SAML',\n metadataFormat: XML_METADATA_FORMAT,\n editorLanguage: XML_METADATA_FORMAT,\n contentType: 'application/samlmetadata+xml',\n getStartUrl: getSamlStartUrl,\n configDetails: [\n { key: 'entityID', label: 'Entity ID', getValue: id => `${window.location.origin}${useradmApiUrl}/sso/sp/metadata/${id}` },\n { key: 'acs', label: 'ACS URL', getValue: id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/acs` },\n { key: 'startURL', label: 'Start URL', getValue: getSamlStartUrl }\n ]\n },\n oidc: {\n id: 'oidc',\n type: 'oidc',\n title: 'OpenID Connect',\n metadataFormat: JSON_METADATA_FORMAT,\n editorLanguage: JSON_METADATA_FORMAT,\n contentType: 'application/json',\n getStartUrl: getOidcStartUrl,\n configDetails: [{ key: 'startURL', label: 'Start Url', getValue: getOidcStartUrl }]\n }\n} as const;\n\nexport type ContentType = (typeof SSO_TYPES)[keyof typeof SSO_TYPES]['contentType'];\n\nexport const auditlogTypes = {\n artifact: { title: 'Artifact', queryParameter: 'object_type', value: 'artifact' },\n deployment: { title: 'Deployment', queryParameter: 'object_deployment_name', value: 'deployment' },\n device: { title: 'Device', queryParameter: 'object_id', value: 'device' },\n user_access_token: { title: 'Personal Access Token', queryParameter: 'user_access_token', value: 'user_access_token' },\n user: { title: 'User', queryParameter: 'object_id', value: 'user' },\n tenant: { title: 'Tenant', queryParameter: 'object_id', value: 'tenant' }\n};\n\nexport const AUDIT_LOGS_TYPES = [auditlogTypes.artifact, auditlogTypes.deployment, auditlogTypes.device, auditlogTypes.user_access_token, auditlogTypes.user];\nexport const SP_AUDIT_LOGS_TYPES = [auditlogTypes.user, auditlogTypes.tenant];\n\nexport const TENANT_LIST_DEFAULT = {\n page: 1,\n perPage: 20\n};\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":";;;;;;;AAoBA,MAAa,YAAY;CACvB,MAAM;CACN,SAAS;CACT,OAAO;CACR;AAED,MAAa,kBAAkB;CAAE,IAAI;CAAmB,MAAM;CAAc;AAE5E,MAAa,6BAA6B;AAI1C,MAAM,YAAY;AAClB,MAAa,WAAW;CACtB,iBAAiB;CACjB,eAAe;CACf,aAAa,KAAM;CACnB;CACA,YAAY,IAAI;CAChB,cAAc,IAAI;CAClB,aAAa,IAAI;CACjB,gBAAgB,KAAK;CACrB,aAAa,KAAK;CACnB;AAED,MAAa,uBAAuB;CAAE,UAAU;CAAG,cAAc,UAAU;CAAM;AAMjF,MAAa,qBAA4C,OAAO,OAAO;CAAE,WAAW;CAAM,OAAO,iBAAiB;CAAU,CAAC;AAE7H,MAAa,eAAe;CAAC;CAAS;CAAY;CAAS;AAE3D,MAAa,kBAAkB;CAC7B,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACP;AACD,MAAa,oBAAoB;CAC/B,YAAY;EACV,iBAAiB,gBAAgB;EACjC,MAAMA;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YAAY,oBAAA,UAAA,EAAA,UAAE,0FAAyF,CAAA;EACxG;CACD,WAAW;EACT,iBAAiB,gBAAgB;EACjC,MAAMC;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,SAAS;EACT,YAAY;EACZ,YACE,qBAAC,QAAD,EAAA,UAAA;GAAM;GACwI;GAE1I,oBAAC,KAAD;IACE,MAAK;IACL,QAAO;IACP,KAAI;cACL;IAEG,CAAA;GACL;GAEI,EAAA,CAAA;EAEV;CACD,SAAS;EACP,iBAAiB,gBAAgB;EACjC,YAAY;EACZ,WAAW;EAEX,SAAS;EACT,UAAU;EACX;CACF;AAMD,MAAa,eAAwB;CACnC,aAAa;CACb,UAAU;CACV,aAAa;EACX,MAAM,kBAAkB,QAAQ;GAC/B,kBAAkB,QAAQ,kBAAkB;GAC3C,QAAQ;GACR,KAAK;GACN;EACF;CACF;AAMD,MAAa,gBAAgB;AAC7B,MAAM,cAAc,IAAI,KAAK,aAAa,CAAC,KAAK,EAAE,EAAE,MAAM,UAAU,CAAC;AACrE,MAAa,YAAoC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CACE,KAAI,UAAS;CAAE;CAAM,OAAO,YAAY,GAAG,KAAK;CAAE,EAAE,CACpD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,MAAM,CAAC;ACxWjD,MAAa,sBAAsB;CACjC,SAAS;CACT;CACA,gBAAgB;CAChB,aAAa;CACb,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,kBAAkB;CAClB,yBAAyB;CACzB,yBAAyB;CACzB,wBAAwB;CACxB,SAAS;CACT,WAAW;CACX,SAAS;CACV;AAWD,MAAa,8BAAyD;CACpE,UAAU;EAAC,oBAAoB;EAAS,oBAAoB;EAAS,oBAAoB;EAAe;CACxG,YAAY;EAAC,oBAAoB;EAAa,oBAAoB;EAAY,oBAAoB;EAAU;CAC5G,QAAQ;EAAC,oBAAoB;EAAyB,oBAAoB;EAAwB,oBAAoB;EAAwB;CAC9I,SAAS,CAAC,oBAAoB,QAAQ;CACtC,WAAW;EAAC,oBAAoB;EAAS,oBAAoB;EAAkB,oBA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