@northern.tech/store 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.cjs +6 -1
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +1 -0
- package/dist/actions.d.ts +1 -0
- package/dist/actions.js +4 -4
- package/dist/api/general-api.js +1 -1
- package/dist/api/users-api.js +1 -1
- package/dist/appSlice/constants.cjs +3 -3
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.d.cts +4 -1
- package/dist/appSlice/constants.d.ts +4 -1
- package/dist/appSlice/constants.js +1 -1
- package/dist/appSlice/index.cjs +6 -1
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.d.cts +3 -0
- package/dist/appSlice/index.d.ts +3 -0
- package/dist/appSlice/index.js +2 -2
- package/dist/appSlice/mocks.cjs +6 -1
- package/dist/appSlice/mocks.cjs.map +1 -1
- package/dist/appSlice/mocks.d.cts +1 -0
- package/dist/appSlice/mocks.d.ts +1 -0
- package/dist/appSlice/mocks.js +2 -2
- package/dist/appSlice/selectors.cjs +3 -0
- package/dist/appSlice/selectors.cjs.map +1 -1
- package/dist/appSlice/selectors.d.cts +2 -1
- package/dist/appSlice/selectors.d.ts +2 -1
- package/dist/appSlice/selectors.js +3 -1
- package/dist/appSlice/thunks.cjs +9 -4
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.js +13 -13
- package/dist/auth.js +1 -1
- package/dist/{chunk-EOZ665GA.js → chunk-2IGDYPTR.js} +6 -6
- package/dist/{chunk-7QKCBSFU.js → chunk-3YJY7KQW.js} +2 -2
- package/dist/{chunk-BYUPW7RA.js → chunk-4BHM6WVX.js} +3 -1
- package/dist/{chunk-BYUPW7RA.js.map → chunk-4BHM6WVX.js.map} +1 -1
- package/dist/{chunk-BZAXFAGT.js → chunk-BTE6UIGL.js} +6 -6
- package/dist/{chunk-OWWCFJZ5.js → chunk-EL672W25.js} +4 -4
- package/dist/chunk-EL672W25.js.map +1 -0
- package/dist/{chunk-GGBE6KJV.js → chunk-GEQ2QQEE.js} +2 -2
- package/dist/{chunk-AR4FTKSL.js → chunk-KE7R7GYG.js} +3 -3
- package/dist/{chunk-ETZVJXPD.js → chunk-LROF3FA4.js} +11 -11
- package/dist/chunk-LROF3FA4.js.map +1 -0
- package/dist/{chunk-7MTM3BDT.js → chunk-O3DM73SJ.js} +7 -2
- package/dist/chunk-O3DM73SJ.js.map +1 -0
- package/dist/{chunk-6KAV62BW.js → chunk-OEFIAB26.js} +5 -5
- package/dist/{chunk-GX2TWNLC.js → chunk-U5TPV5X5.js} +8 -8
- package/dist/{chunk-GX2TWNLC.js.map → chunk-U5TPV5X5.js.map} +1 -1
- package/dist/{chunk-5PUF4LA5.js → chunk-VCEFZTWS.js} +1 -1
- package/dist/{chunk-5PUF4LA5.js.map → chunk-VCEFZTWS.js.map} +1 -1
- package/dist/{chunk-YFAIYNQG.js → chunk-ZNSCXTKF.js} +4 -4
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +3 -3
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.js +6 -6
- package/dist/constants.cjs +3 -3
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/mocks.js +1 -1
- package/dist/deploymentsSlice/selectors.js +1 -1
- package/dist/deploymentsSlice/thunks.cjs +9 -4
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.js +13 -13
- package/dist/devicesSlice/constants.js +1 -1
- package/dist/devicesSlice/index.js +1 -1
- package/dist/devicesSlice/mocks.js +1 -1
- package/dist/devicesSlice/selectors.js +1 -1
- package/dist/devicesSlice/thunks.cjs +9 -4
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.js +13 -13
- package/dist/liststatehook.js +1 -1
- package/dist/locationutils.js +1 -1
- package/dist/monitorSlice/index.js +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/thunks.cjs +9 -4
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.js +11 -11
- package/dist/onboardingSlice/thunks.cjs +9 -4
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.js +13 -13
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.js +2 -2
- package/dist/organizationSlice/mocks.cjs.map +1 -1
- package/dist/organizationSlice/mocks.js +2 -2
- package/dist/organizationSlice/selectors.js +1 -1
- package/dist/organizationSlice/thunks.cjs +15 -10
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.js +13 -13
- package/dist/organizationSlice/types.cjs.map +1 -1
- package/dist/releasesSlice/index.js +1 -1
- package/dist/releasesSlice/mocks.js +1 -1
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.js +3 -3
- package/dist/releasesSlice/thunks.cjs +9 -4
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.js +11 -11
- package/dist/selectors.cjs +6 -3
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +1 -1
- package/dist/selectors.d.ts +1 -1
- package/dist/selectors.js +8 -6
- package/dist/sockethook.js +1 -1
- package/dist/store.cjs +6 -1
- package/dist/store.cjs.map +1 -1
- package/dist/store.js +5 -5
- package/dist/storehooks.cjs +19 -11
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +18 -14
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +15 -10
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +13 -13
- package/dist/useDeploymentDevice.cjs +9 -4
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +13 -13
- package/dist/useDeploymentDevice.js.map +1 -1
- package/dist/usersSlice/constants.js +1 -1
- package/dist/usersSlice/index.js +1 -1
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.cjs +3 -3
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.js +3 -3
- package/dist/usersSlice/thunks.cjs +9 -4
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.js +13 -13
- package/dist/utils.cjs +9 -9
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +7 -7
- package/dist/chunk-7MTM3BDT.js.map +0 -1
- package/dist/chunk-ETZVJXPD.js.map +0 -1
- package/dist/chunk-OWWCFJZ5.js.map +0 -1
- /package/dist/{chunk-EOZ665GA.js.map → chunk-2IGDYPTR.js.map} +0 -0
- /package/dist/{chunk-7QKCBSFU.js.map → chunk-3YJY7KQW.js.map} +0 -0
- /package/dist/{chunk-BZAXFAGT.js.map → chunk-BTE6UIGL.js.map} +0 -0
- /package/dist/{chunk-GGBE6KJV.js.map → chunk-GEQ2QQEE.js.map} +0 -0
- /package/dist/{chunk-AR4FTKSL.js.map → chunk-KE7R7GYG.js.map} +0 -0
- /package/dist/{chunk-6KAV62BW.js.map → chunk-OEFIAB26.js.map} +0 -0
- /package/dist/{chunk-YFAIYNQG.js.map → chunk-ZNSCXTKF.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// 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 { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nconst startingDeviceCount = {\n os: 'for first 50 devices',\n professional: 'for first 250 devices'\n} as const;\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n deviceCount: string;\n features: string[];\n id: AvailablePlans;\n minimalDeviceCount: number;\n name: string;\n offer?: boolean;\n offerprice?: string;\n price: string;\n price2?: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n minimalDeviceCount: 50,\n offer: true,\n price: '$34 / month',\n deviceCount: startingDeviceCount.os,\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.',\n features: ['Access to core features of Mender', 'Basic support']\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n minimalDeviceCount: 250,\n offer: true,\n price: '$291 / month',\n deviceCount: startingDeviceCount.professional,\n description: 'Everything in Basic, plus enhanced update management and automation features.',\n features: ['Advanced OTA features', 'Higher priority support']\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n minimalDeviceCount: 1000,\n price: 'Custom pricing',\n deviceCount: 'Unlimited devices',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.',\n features: ['All Mender features', 'Advanced security features', 'SLA-backed support']\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n} & {\n [key in Exclude<AvailablePlans, 'enterprise'>]: {\n deviceCount: string;\n price: string;\n };\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Expand your plan with device configuration features',\n needs: ['hasDeviceConfig'],\n os: {\n price: '$11/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$65/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Expand your plan with device monitoring features',\n needs: ['hasMonitor'],\n os: {\n price: '-',\n deviceCount: '-'\n },\n professional: {\n price: '$86/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Expand your plan with device troubleshooting features',\n needs: ['hasDeviceConnect'],\n os: {\n price: '$27/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$72/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: { id: 'auditlog', benefit: 'trace change across your devices and access troubleshooting session replay', requiredPlan: PLANS.professional.id },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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YAAY;AAClB,IAAM,aAAa;","names":["BarChartIcon","PieChartIcon","yesUtil"]}
|
|
1
|
+
{"version":3,"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// 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 { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nconst startingDeviceCount = {\n os: 'for first 50 devices',\n professional: 'for first 250 devices'\n} as const;\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n deviceCount: string;\n features: string[];\n id: AvailablePlans;\n minimalDeviceCount: { micro: number; standard: number };\n name: string;\n offer?: boolean;\n offerprice?: string;\n price: string;\n price2?: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n minimalDeviceCount: { standard: 50, micro: 100 },\n offer: true,\n price: '$34 / month',\n deviceCount: startingDeviceCount.os,\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.',\n features: ['Access to core features of Mender', 'Basic support']\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n minimalDeviceCount: { standard: 250, micro: 500 },\n offer: true,\n price: '$291 / month',\n deviceCount: startingDeviceCount.professional,\n description: 'Everything in Basic, plus enhanced update management and automation features.',\n features: ['Advanced OTA features', 'Higher priority support']\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n minimalDeviceCount: { standard: 1000, micro: 2000 },\n price: 'Custom pricing',\n deviceCount: 'Unlimited devices',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.',\n features: ['All Mender features', 'Advanced security features', 'SLA-backed support']\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n} & {\n [key in Exclude<AvailablePlans, 'enterprise'>]: {\n deviceCount: string;\n price: string;\n };\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Expand your plan with device configuration features',\n needs: ['hasDeviceConfig'],\n os: {\n price: '$11/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$65/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Expand your plan with device monitoring features',\n needs: ['hasMonitor'],\n os: {\n price: '-',\n deviceCount: '-'\n },\n professional: {\n price: '$86/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Expand your plan with device troubleshooting features',\n needs: ['hasDeviceConnect'],\n os: {\n price: '$27/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$72/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: { id: 'auditlog', benefit: 'trace change across your devices and access troubleshooting session replay', requiredPlan: PLANS.professional.id },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,4BAA0E;AAE1E,mBAA+B;AAE/B,IAAM,sBAAsB;AAAA,EAC1B,IAAI;AAAA,EACJ,cAAc;AAChB;AAEO,IAAM,aAAa;AAAA,EACxB,KAAK,EAAE,KAAK,OAAO,MAAM,sBAAAA,SAAa;AAAA,EACtC,KAAK,EAAE,KAAK,OAAO,MAAM,sBAAAC,gBAAa;AACxC;AACO,IAAM,sBAAsB,EAAE,UAAU,IAAI,OAAO,IAAI,WAAW,WAAW,IAAI,KAAK,WAAW,gBAAgB;AACjH,IAAM,oBAAoB;AAC1B,IAAM,iBAAiB,CAAC,EAAE,GAAG,qBAAqB,OAAO,MAAM,WAAW,iBAAiB,MAAM,kBAAkB,CAAC;AAEpH,IAAM,oBAAoB;AAE1B,IAAM,YAAY;AAAA,EACvB,IAAI,EAAE,KAAK,MAAM,OAAO,SAAS,UAAU,mBAAmB;AAAA,EAC9D,IAAI,EAAE,KAAK,MAAM,OAAO,MAAM,UAAU,sBAAsB;AAAA,EAC9D,IAAI,EAAE,KAAK,MAAM,OAAO,MAAM,UAAU,mBAAmB;AAC7D;AAkBO,IAAM,QAA2C;AAAA,EACtD,IAAI;AAAA,IACF,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,oBAAoB,EAAE,UAAU,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E,IAAI,QAAQ,SAAS,sCAAsC,cAAc,MAAM,WAAW,GAAG;AAAA,EACrG,kBAAkB,EAAE,IAAI,oBAAoB,SAAS,gDAAgD,cAAc,MAAM,aAAa,GAAG;AAAA,EACzI,sBAAsB;AAAA,IACpB,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,cAAc,MAAM,aAAa;AAAA,EACnC;AAAA,EACA,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,cAAc,MAAM,aAAa;AAAA,EACnC;AAAA,EAEA,SAAS,EAAE,IAAI,WAAW,SAAS,+BAA+B,cAAc,MAAM,WAAW,GAAG;AACtG;AAEO,IAAM,MAAM,aAAAC;AACZ,IAAM,YAAY;AAElB,IAAM,YAAY;AAClB,IAAM,aAAa;","names":["BarChartIcon","PieChartIcon","yesUtil"]}
|
package/dist/appSlice/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ var getYesterday = () => {
|
|
|
40
40
|
return today.toISOString();
|
|
41
41
|
};
|
|
42
42
|
var initialState = {
|
|
43
|
+
appInitDone: false,
|
|
43
44
|
cancelSource: void 0,
|
|
44
45
|
commit: "",
|
|
45
46
|
demoArtifactLink: "https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender",
|
|
@@ -61,6 +62,7 @@ var initialState = {
|
|
|
61
62
|
hasDeviceConnect: false,
|
|
62
63
|
hasFeedbackEnabled: false,
|
|
63
64
|
hasMonitor: false,
|
|
65
|
+
hasMCUEnabled: false,
|
|
64
66
|
hasReporting: false,
|
|
65
67
|
isHosted: true,
|
|
66
68
|
isEnterprise: false
|
|
@@ -165,7 +167,10 @@ var appSlice = (0, import_toolkit.createSlice)({
|
|
|
165
167
|
...action.payload
|
|
166
168
|
};
|
|
167
169
|
},
|
|
168
|
-
setEnvironmentData: (state, action) => ({ ...state, ...action.payload })
|
|
170
|
+
setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),
|
|
171
|
+
setAppInitDone: (state) => {
|
|
172
|
+
state.appInitDone = true;
|
|
173
|
+
}
|
|
169
174
|
}
|
|
170
175
|
});
|
|
171
176
|
var actions = appSlice.actions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/appSlice/index.ts","../../src/constants.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasMonitor: false,\n hasReporting: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Client': '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload })\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,qBAA4B;;;ACF5B,uBA8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AA,IACA,eAAe,CAAC,OAAO,WAAkC;AAEvD,YAAM,EAAE,CAAC,OAAO,OAAO,GAAG,SAAS,GAAG,UAAU,IAAI,MAAM;AAC1D,YAAM,cAAc;AAAA,IACtB;AAAA,IACA,uBAAuB,CAAC,OAAO,WAA8C;AAC3E,YAAM,qBAAqB;AAAA,QACzB,GAAG,MAAM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB,CAAC,OAAO,YAAY,EAAE,GAAG,OAAO,GAAG,OAAO,QAAQ;AAAA,EACxE;AACF,CAAC;AAEM,IAAM,UAAU,SAAS;AAChC,IAAO,mBAAQ,SAAS;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/appSlice/index.ts","../../src/constants.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n hasReporting: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Client': '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,qBAA4B;;;ACF5B,uBA8CO;;;ADvCA,IAAM,YAAY;AAEzB,IAAM,eAAe,MAAM;AACzB,QAAM,QAAQ,oBAAI,KAAK;AACvB,QAAM,QAAQ,MAAM,QAAQ,IAAI,CAAC;AACjC,SAAO,MAAM,YAAY;AAC3B;AA6FO,IAAM,eAA6B;AAAA,EACxC,aAAa;AAAA,EACb,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,SAAS;AAAA,IACT,MAAM;AAAA,IACN,oBAAoB;AAAA,EACtB;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,cAAc;AAAA,IACd,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,cAAc;AAAA,IACd,UAAU;AAAA,IACV,cAAc;AAAA,EAChB;AAAA,EACA,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,IACX,WAAW,CAAC;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb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AM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB,CAAC,OAAO,WAAkC;AAC7D,YAAM,mBAAmB,OAAO;AAAA,IAClC;AAAA,IACA,YAAY,CAAC,OAAO,WAA0D;AAC5E,YAAM,EAAE,IAAI,OAAO,IAAI,OAAO;AAC9B,YAAM,YAAY,EAAE,IAAI;AAAA,IAC1B;AAAA,IACA,gBAAgB,CAAC,OAAO,WAA4D;AAClF,YAAM,EAAE,IAAI,SAAS,IAAI,OAAO;AAChC,YAAM,YAAY,EAAE,IAAI;AAAA,QACtB,GAAG,MAAM,YAAY,EAAE;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAAA,IACA,eAAe,CAAC,OAAO,WAAkC;AAEvD,YAAM,EAAE,CAAC,OAAO,OAAO,GAAG,SAAS,GAAG,UAAU,IAAI,MAAM;AAC1D,YAAM,cAAc;AAAA,IACtB;AAAA,IACA,uBAAuB,CAAC,OAAO,WAA8C;AAC3E,YAAM,qBAAqB;AAAA,QACzB,GAAG,MAAM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB,CAAC,OAAO,YAAY,EAAE,GAAG,OAAO,GAAG,OAAO,QAAQ;AAAA,IACtE,gBAAgB,WAAS;AACvB,YAAM,cAAc;AAAA,IACtB;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,SAAS;AAChC,IAAO,mBAAQ,SAAS;","names":[]}
|
|
@@ -68,6 +68,7 @@ type SentryConfig = {
|
|
|
68
68
|
tracesSampleRate?: number;
|
|
69
69
|
};
|
|
70
70
|
type AppSliceType = {
|
|
71
|
+
appInitDone: boolean;
|
|
71
72
|
cancelSource: any;
|
|
72
73
|
commit: string;
|
|
73
74
|
demoArtifactLink: string;
|
|
@@ -114,6 +115,7 @@ declare const appSlice: _reduxjs_toolkit.Slice<AppSliceType, {
|
|
|
114
115
|
payload: any;
|
|
115
116
|
type: string;
|
|
116
117
|
}) => any;
|
|
118
|
+
setAppInitDone: (state: immer.WritableDraft<AppSliceType>) => void;
|
|
117
119
|
}, "app", "app", _reduxjs_toolkit.SliceSelectors<AppSliceType>>;
|
|
118
120
|
declare const actions: _reduxjs_toolkit.CaseReducerActions<{
|
|
119
121
|
setFeatures: (state: immer.WritableDraft<AppSliceType>, action: PayloadAction<Record<string, boolean>>) => void;
|
|
@@ -139,6 +141,7 @@ declare const actions: _reduxjs_toolkit.CaseReducerActions<{
|
|
|
139
141
|
payload: any;
|
|
140
142
|
type: string;
|
|
141
143
|
}) => any;
|
|
144
|
+
setAppInitDone: (state: immer.WritableDraft<AppSliceType>) => void;
|
|
142
145
|
}, "app">;
|
|
143
146
|
declare const _default: redux.Reducer<AppSliceType>;
|
|
144
147
|
|
package/dist/appSlice/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ type SentryConfig = {
|
|
|
68
68
|
tracesSampleRate?: number;
|
|
69
69
|
};
|
|
70
70
|
type AppSliceType = {
|
|
71
|
+
appInitDone: boolean;
|
|
71
72
|
cancelSource: any;
|
|
72
73
|
commit: string;
|
|
73
74
|
demoArtifactLink: string;
|
|
@@ -114,6 +115,7 @@ declare const appSlice: _reduxjs_toolkit.Slice<AppSliceType, {
|
|
|
114
115
|
payload: any;
|
|
115
116
|
type: string;
|
|
116
117
|
}) => any;
|
|
118
|
+
setAppInitDone: (state: immer.WritableDraft<AppSliceType>) => void;
|
|
117
119
|
}, "app", "app", _reduxjs_toolkit.SliceSelectors<AppSliceType>>;
|
|
118
120
|
declare const actions: _reduxjs_toolkit.CaseReducerActions<{
|
|
119
121
|
setFeatures: (state: immer.WritableDraft<AppSliceType>, action: PayloadAction<Record<string, boolean>>) => void;
|
|
@@ -139,6 +141,7 @@ declare const actions: _reduxjs_toolkit.CaseReducerActions<{
|
|
|
139
141
|
payload: any;
|
|
140
142
|
type: string;
|
|
141
143
|
}) => any;
|
|
144
|
+
setAppInitDone: (state: immer.WritableDraft<AppSliceType>) => void;
|
|
142
145
|
}, "app">;
|
|
143
146
|
declare const _default: redux.Reducer<AppSliceType>;
|
|
144
147
|
|
package/dist/appSlice/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
appSlice_default,
|
|
5
5
|
initialState,
|
|
6
6
|
sliceName
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-O3DM73SJ.js";
|
|
8
8
|
import "../chunk-WWED74SG.js";
|
|
9
9
|
import "../chunk-2DYA3X77.js";
|
|
10
10
|
import "../chunk-FAJ3I2UQ.js";
|
|
11
11
|
import "../chunk-ZKAH3APE.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-EL672W25.js";
|
|
13
13
|
export {
|
|
14
14
|
actions,
|
|
15
15
|
appSlice,
|
package/dist/appSlice/mocks.cjs
CHANGED
|
@@ -38,6 +38,7 @@ var getYesterday = () => {
|
|
|
38
38
|
return today.toISOString();
|
|
39
39
|
};
|
|
40
40
|
var initialState = {
|
|
41
|
+
appInitDone: false,
|
|
41
42
|
cancelSource: void 0,
|
|
42
43
|
commit: "",
|
|
43
44
|
demoArtifactLink: "https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender",
|
|
@@ -59,6 +60,7 @@ var initialState = {
|
|
|
59
60
|
hasDeviceConnect: false,
|
|
60
61
|
hasFeedbackEnabled: false,
|
|
61
62
|
hasMonitor: false,
|
|
63
|
+
hasMCUEnabled: false,
|
|
62
64
|
hasReporting: false,
|
|
63
65
|
isHosted: true,
|
|
64
66
|
isEnterprise: false
|
|
@@ -163,7 +165,10 @@ var appSlice = (0, import_toolkit.createSlice)({
|
|
|
163
165
|
...action.payload
|
|
164
166
|
};
|
|
165
167
|
},
|
|
166
|
-
setEnvironmentData: (state, action) => ({ ...state, ...action.payload })
|
|
168
|
+
setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),
|
|
169
|
+
setAppInitDone: (state) => {
|
|
170
|
+
state.appInitDone = true;
|
|
171
|
+
}
|
|
167
172
|
}
|
|
168
173
|
});
|
|
169
174
|
var actions = appSlice.actions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/appSlice/mocks.ts","../../src/appSlice/index.ts","../../src/constants.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { initialState } from './index';\n\nexport const mockState = {\n ...initialState,\n searchState: {\n ...initialState.searchState,\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n sort: {}\n },\n snackbar: {},\n uploadsById: {},\n versionInformation: {}\n};\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasMonitor: false,\n hasReporting: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Client': '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload })\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBA,qBAA4B;;;ACF5B,uBA8CO;;;ADvCA,IAAM,YAAY;AAEzB,IAAM,eAAe,MAAM;AACzB,QAAM,QAAQ,oBAAI,KAAK;AACvB,QAAM,QAAQ,MAAM,QAAQ,IAAI,CAAC;AACjC,SAAO,MAAM,YAAY;AAC3B;AA4FO,IAAM,eAA6B;AAAA,EACxC,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,SAAS;AAAA,IACT,MAAM;AAAA,IACN,oBAAoB;AAAA,EACtB;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,cAAc;AAAA,IACd,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,UAAU;AAAA,IACV,cAAc;AAAA,EAChB;AAAA,EACA,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,IACX,WAAW,CAAC;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,MACJ,WAAW,iCA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ACF;AAAA,IACA,qBAAqB,CAAC,OAAO,WAAkC;AAC7D,YAAM,mBAAmB,OAAO;AAAA,IAClC;AAAA,IACA,YAAY,CAAC,OAAO,WAA0D;AAC5E,YAAM,EAAE,IAAI,OAAO,IAAI,OAAO;AAC9B,YAAM,YAAY,EAAE,IAAI;AAAA,IAC1B;AAAA,IACA,gBAAgB,CAAC,OAAO,WAA4D;AAClF,YAAM,EAAE,IAAI,SAAS,IAAI,OAAO;AAChC,YAAM,YAAY,EAAE,IAAI;AAAA,QACtB,GAAG,MAAM,YAAY,EAAE;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAAA,IACA,eAAe,CAAC,OAAO,WAAkC;AAEvD,YAAM,EAAE,CAAC,OAAO,OAAO,GAAG,SAAS,GAAG,UAAU,IAAI,MAAM;AAC1D,YAAM,cAAc;AAAA,IACtB;AAAA,IACA,uBAAuB,CAAC,OAAO,WAA8C;AAC3E,YAAM,qBAAqB;AAAA,QACzB,GAAG,MAAM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB,CAAC,OAAO,YAAY,EAAE,GAAG,OAAO,GAAG,OAAO,QAAQ;AAAA,EACxE;AACF,CAAC;AAEM,IAAM,UAAU,SAAS;AAChC,IAAO,mBAAQ,SAAS;;;AD7OjB,IAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,aAAa;AAAA,IACX,GAAG,aAAa;AAAA,IAChB,WAAW,CAAC;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,MAAM,CAAC;AAAA,EACT;AAAA,EACA,UAAU,CAAC;AAAA,EACX,aAAa,CAAC;AAAA,EACd,oBAAoB,CAAC;AACvB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/appSlice/mocks.ts","../../src/appSlice/index.ts","../../src/constants.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { initialState } from './index';\n\nexport const mockState = {\n ...initialState,\n searchState: {\n ...initialState.searchState,\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n sort: {}\n },\n snackbar: {},\n uploadsById: {},\n versionInformation: {}\n};\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n hasReporting: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Client': '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBA,qBAA4B;;;ACF5B,uBA8CO;;;ADvCA,IAAM,YAAY;AAEzB,IAAM,eAAe,MAAM;AACzB,QAAM,QAAQ,oBAAI,KAAK;AACvB,QAAM,QAAQ,MAAM,QAAQ,IAAI,CAAC;AACjC,SAAO,MAAM,YAAY;AAC3B;AA6FO,IAAM,eAA6B;AAAA,EACxC,aAAa;AAAA,EACb,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,SAAS;AAAA,IACT,MAAM;AAAA,IACN,oBAAoB;AAAA,EACtB;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,cAAc;AAAA,IACd,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,cAAc;AAAA,IACd,UAAU;AAAA,IACV,cAAc;AAAA,EAChB;AAAA,EACA,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,IACX,WAAW,CAAC;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,MACJ,WAAW,iCAAgB;AAAA;AAAA;AAAA,IAG7B;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B,kBAAkB;AA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AC5E,YAAM,EAAE,IAAI,OAAO,IAAI,OAAO;AAC9B,YAAM,YAAY,EAAE,IAAI;AAAA,IAC1B;AAAA,IACA,gBAAgB,CAAC,OAAO,WAA4D;AAClF,YAAM,EAAE,IAAI,SAAS,IAAI,OAAO;AAChC,YAAM,YAAY,EAAE,IAAI;AAAA,QACtB,GAAG,MAAM,YAAY,EAAE;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAAA,IACA,eAAe,CAAC,OAAO,WAAkC;AAEvD,YAAM,EAAE,CAAC,OAAO,OAAO,GAAG,SAAS,GAAG,UAAU,IAAI,MAAM;AAC1D,YAAM,cAAc;AAAA,IACtB;AAAA,IACA,uBAAuB,CAAC,OAAO,WAA8C;AAC3E,YAAM,qBAAqB;AAAA,QACzB,GAAG,MAAM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB,CAAC,OAAO,YAAY,EAAE,GAAG,OAAO,GAAG,OAAO,QAAQ;AAAA,IACtE,gBAAgB,WAAS;AACvB,YAAM,cAAc;AAAA,IACtB;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,SAAS;AAChC,IAAO,mBAAQ,SAAS;;;ADnPjB,IAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,aAAa;AAAA,IACX,GAAG,aAAa;AAAA,IAChB,WAAW,CAAC;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,MAAM,CAAC;AAAA,EACT;AAAA,EACA,UAAU,CAAC;AAAA,EACX,aAAa,CAAC;AAAA,EACd,oBAAoB,CAAC;AACvB;","names":[]}
|
package/dist/appSlice/mocks.d.ts
CHANGED
package/dist/appSlice/mocks.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
initialState
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-O3DM73SJ.js";
|
|
4
4
|
import "../chunk-WWED74SG.js";
|
|
5
5
|
import "../chunk-2DYA3X77.js";
|
|
6
6
|
import "../chunk-FAJ3I2UQ.js";
|
|
7
7
|
import "../chunk-ZKAH3APE.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-EL672W25.js";
|
|
9
9
|
|
|
10
10
|
// src/appSlice/mocks.ts
|
|
11
11
|
var mockState = {
|
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/appSlice/selectors.ts
|
|
21
21
|
var selectors_exports = {};
|
|
22
22
|
__export(selectors_exports, {
|
|
23
|
+
getAppInitDone: () => getAppInitDone,
|
|
23
24
|
getCommit: () => getCommit,
|
|
24
25
|
getDocsVersion: () => getDocsVersion,
|
|
25
26
|
getFeatures: () => getFeatures,
|
|
@@ -58,6 +59,7 @@ var getSentryConfig = (state) => state.app.sentry;
|
|
|
58
59
|
var getCommit = (state) => state.app.commit;
|
|
59
60
|
var getIsFirstLogin = (state) => state.app.firstLoginAfterSignup;
|
|
60
61
|
var getFeedbackProbability = (state) => state.app.feedbackProbability;
|
|
62
|
+
var getAppInitDone = (state) => state.app.appInitDone;
|
|
61
63
|
var getIsUploading = (0, import_toolkit.createSelector)([getUploads], (uploadsById) => !!Object.keys(uploadsById).length);
|
|
62
64
|
var getSearchedDevices = (0, import_toolkit.createSelector)([getSearchState], ({ deviceIds }) => deviceIds);
|
|
63
65
|
var getVersionInformation = (0, import_toolkit.createSelector)(
|
|
@@ -67,6 +69,7 @@ var getVersionInformation = (0, import_toolkit.createSelector)(
|
|
|
67
69
|
var getIsPreview = (0, import_toolkit.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers.versionCompare)(Integration, "next") > -1);
|
|
68
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
69
71
|
0 && (module.exports = {
|
|
72
|
+
getAppInitDone,
|
|
70
73
|
getCommit,
|
|
71
74
|
getDocsVersion,
|
|
72
75
|
getFeatures,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/appSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { versionCompare } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { RootState } from '../store';\n\nexport const getDocsVersion = (state: RootState) => state.app.docsVersion;\nexport const getFeatures = (state: RootState) => state.app.features;\nexport const getFullVersionInformation = (state: RootState) => state.app.versionInformation;\nexport const getSearchState = (state: RootState) => state.app.searchState;\nexport const getUploads = (state: RootState) => state.app.uploadsById;\nexport const getSnackbar = (state: RootState) => state.app.snackbar;\nexport const getHostAddress = (state: RootState) => state.app.hostAddress;\nexport const getHostedAnnouncement = (state: RootState) => state.app.hostedAnnouncement;\nexport const getRecaptchaKey = (state: RootState) => state.app.recaptchaSiteKey;\nexport const getStripeKey = (state: RootState) => state.app.stripeAPIKey;\nexport const getTrackerCode = (state: RootState) => state.app.trackerCode;\nexport const getSentryConfig = (state: RootState) => state.app.sentry;\nexport const getCommit = (state: RootState) => state.app.commit;\nexport const getIsFirstLogin = (state: RootState) => state.app.firstLoginAfterSignup;\nexport const getFeedbackProbability = (state: RootState) => state.app.feedbackProbability;\n\nexport const getIsUploading = createSelector([getUploads], uploadsById => !!Object.keys(uploadsById).length);\nexport const getSearchedDevices = createSelector([getSearchState], ({ deviceIds }) => deviceIds);\nexport const getVersionInformation = createSelector([getFullVersionInformation, getFeatures], ({ Integration, ...remainder }, { isHosted }) =>\n isHosted && Integration !== 'next' ? remainder : { ...remainder, Integration }\n);\nexport const getIsPreview = createSelector([getFullVersionInformation], ({ Integration }) => versionCompare(Integration, 'next') > -1);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,qBAA+B;AAC/B,qBAA+B;AAIxB,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,cAAc,CAAC,UAAqB,MAAM,IAAI;AACpD,IAAM,4BAA4B,CAAC,UAAqB,MAAM,IAAI;AAClE,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,aAAa,CAAC,UAAqB,MAAM,IAAI;AACnD,IAAM,cAAc,CAAC,UAAqB,MAAM,IAAI;AACpD,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,wBAAwB,CAAC,UAAqB,MAAM,IAAI;AAC9D,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,eAAe,CAAC,UAAqB,MAAM,IAAI;AACrD,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,YAAY,CAAC,UAAqB,MAAM,IAAI;AAClD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,yBAAyB,CAAC,UAAqB,MAAM,IAAI;
|
|
1
|
+
{"version":3,"sources":["../../src/appSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { versionCompare } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { RootState } from '../store';\n\nexport const getDocsVersion = (state: RootState) => state.app.docsVersion;\nexport const getFeatures = (state: RootState) => state.app.features;\nexport const getFullVersionInformation = (state: RootState) => state.app.versionInformation;\nexport const getSearchState = (state: RootState) => state.app.searchState;\nexport const getUploads = (state: RootState) => state.app.uploadsById;\nexport const getSnackbar = (state: RootState) => state.app.snackbar;\nexport const getHostAddress = (state: RootState) => state.app.hostAddress;\nexport const getHostedAnnouncement = (state: RootState) => state.app.hostedAnnouncement;\nexport const getRecaptchaKey = (state: RootState) => state.app.recaptchaSiteKey;\nexport const getStripeKey = (state: RootState) => state.app.stripeAPIKey;\nexport const getTrackerCode = (state: RootState) => state.app.trackerCode;\nexport const getSentryConfig = (state: RootState) => state.app.sentry;\nexport const getCommit = (state: RootState) => state.app.commit;\nexport const getIsFirstLogin = (state: RootState) => state.app.firstLoginAfterSignup;\nexport const getFeedbackProbability = (state: RootState) => state.app.feedbackProbability;\nexport const getAppInitDone = (state: RootState) => state.app.appInitDone;\n\nexport const getIsUploading = createSelector([getUploads], uploadsById => !!Object.keys(uploadsById).length);\nexport const getSearchedDevices = createSelector([getSearchState], ({ deviceIds }) => deviceIds);\nexport const getVersionInformation = createSelector([getFullVersionInformation, getFeatures], ({ Integration, ...remainder }, { isHosted }) =>\n isHosted && Integration !== 'next' ? remainder : { ...remainder, Integration }\n);\nexport const getIsPreview = createSelector([getFullVersionInformation], ({ Integration }) => versionCompare(Integration, 'next') > -1);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,qBAA+B;AAC/B,qBAA+B;AAIxB,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,cAAc,CAAC,UAAqB,MAAM,IAAI;AACpD,IAAM,4BAA4B,CAAC,UAAqB,MAAM,IAAI;AAClE,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,aAAa,CAAC,UAAqB,MAAM,IAAI;AACnD,IAAM,cAAc,CAAC,UAAqB,MAAM,IAAI;AACpD,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,wBAAwB,CAAC,UAAqB,MAAM,IAAI;AAC9D,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,eAAe,CAAC,UAAqB,MAAM,IAAI;AACrD,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,YAAY,CAAC,UAAqB,MAAM,IAAI;AAClD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,yBAAyB,CAAC,UAAqB,MAAM,IAAI;AAC/D,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AAEvD,IAAM,qBAAiB,+BAAe,CAAC,UAAU,GAAG,iBAAe,CAAC,CAAC,OAAO,KAAK,WAAW,EAAE,MAAM;AACpG,IAAM,yBAAqB,+BAAe,CAAC,cAAc,GAAG,CAAC,EAAE,UAAU,MAAM,SAAS;AACxF,IAAM,4BAAwB;AAAA,EAAe,CAAC,2BAA2B,WAAW;AAAA,EAAG,CAAC,EAAE,aAAa,GAAG,UAAU,GAAG,EAAE,SAAS,MACvI,YAAY,gBAAgB,SAAS,YAAY,EAAE,GAAG,WAAW,YAAY;AAC/E;AACO,IAAM,mBAAe,+BAAe,CAAC,yBAAyB,GAAG,CAAC,EAAE,YAAY,UAAM,+BAAe,aAAa,MAAM,IAAI,EAAE;","names":[]}
|
|
@@ -51,6 +51,7 @@ declare const getSentryConfig: (state: RootState) => SentryConfig;
|
|
|
51
51
|
declare const getCommit: (state: RootState) => string;
|
|
52
52
|
declare const getIsFirstLogin: (state: RootState) => boolean;
|
|
53
53
|
declare const getFeedbackProbability: (state: RootState) => number;
|
|
54
|
+
declare const getAppInitDone: (state: RootState) => boolean;
|
|
54
55
|
declare const getIsUploading: ((state: {
|
|
55
56
|
app: AppSliceType;
|
|
56
57
|
devices: DeviceSliceType;
|
|
@@ -282,4 +283,4 @@ declare const getIsPreview: ((state: {
|
|
|
282
283
|
argsMemoize: typeof reselect.weakMapMemoize;
|
|
283
284
|
};
|
|
284
285
|
|
|
285
|
-
export { getCommit, getDocsVersion, getFeatures, getFeedbackProbability, getFullVersionInformation, getHostAddress, getHostedAnnouncement, getIsFirstLogin, getIsPreview, getIsUploading, getRecaptchaKey, getSearchState, getSearchedDevices, getSentryConfig, getSnackbar, getStripeKey, getTrackerCode, getUploads, getVersionInformation };
|
|
286
|
+
export { getAppInitDone, getCommit, getDocsVersion, getFeatures, getFeedbackProbability, getFullVersionInformation, getHostAddress, getHostedAnnouncement, getIsFirstLogin, getIsPreview, getIsUploading, getRecaptchaKey, getSearchState, getSearchedDevices, getSentryConfig, getSnackbar, getStripeKey, getTrackerCode, getUploads, getVersionInformation };
|
|
@@ -51,6 +51,7 @@ declare const getSentryConfig: (state: RootState) => SentryConfig;
|
|
|
51
51
|
declare const getCommit: (state: RootState) => string;
|
|
52
52
|
declare const getIsFirstLogin: (state: RootState) => boolean;
|
|
53
53
|
declare const getFeedbackProbability: (state: RootState) => number;
|
|
54
|
+
declare const getAppInitDone: (state: RootState) => boolean;
|
|
54
55
|
declare const getIsUploading: ((state: {
|
|
55
56
|
app: AppSliceType;
|
|
56
57
|
devices: DeviceSliceType;
|
|
@@ -282,4 +283,4 @@ declare const getIsPreview: ((state: {
|
|
|
282
283
|
argsMemoize: typeof reselect.weakMapMemoize;
|
|
283
284
|
};
|
|
284
285
|
|
|
285
|
-
export { getCommit, getDocsVersion, getFeatures, getFeedbackProbability, getFullVersionInformation, getHostAddress, getHostedAnnouncement, getIsFirstLogin, getIsPreview, getIsUploading, getRecaptchaKey, getSearchState, getSearchedDevices, getSentryConfig, getSnackbar, getStripeKey, getTrackerCode, getUploads, getVersionInformation };
|
|
286
|
+
export { getAppInitDone, getCommit, getDocsVersion, getFeatures, getFeedbackProbability, getFullVersionInformation, getHostAddress, getHostedAnnouncement, getIsFirstLogin, getIsPreview, getIsUploading, getRecaptchaKey, getSearchState, getSearchedDevices, getSentryConfig, getSnackbar, getStripeKey, getTrackerCode, getUploads, getVersionInformation };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getAppInitDone,
|
|
2
3
|
getCommit,
|
|
3
4
|
getDocsVersion,
|
|
4
5
|
getFeatures,
|
|
@@ -18,8 +19,9 @@ import {
|
|
|
18
19
|
getTrackerCode,
|
|
19
20
|
getUploads,
|
|
20
21
|
getVersionInformation
|
|
21
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-4BHM6WVX.js";
|
|
22
23
|
export {
|
|
24
|
+
getAppInitDone,
|
|
23
25
|
getCommit,
|
|
24
26
|
getDocsVersion,
|
|
25
27
|
getFeatures,
|
package/dist/appSlice/thunks.cjs
CHANGED
|
@@ -63,7 +63,7 @@ var PLANS = {
|
|
|
63
63
|
os: {
|
|
64
64
|
id: "os",
|
|
65
65
|
name: "Basic",
|
|
66
|
-
minimalDeviceCount: 50,
|
|
66
|
+
minimalDeviceCount: { standard: 50, micro: 100 },
|
|
67
67
|
offer: true,
|
|
68
68
|
price: "$34 / month",
|
|
69
69
|
deviceCount: startingDeviceCount.os,
|
|
@@ -73,7 +73,7 @@ var PLANS = {
|
|
|
73
73
|
professional: {
|
|
74
74
|
id: "professional",
|
|
75
75
|
name: "Professional",
|
|
76
|
-
minimalDeviceCount: 250,
|
|
76
|
+
minimalDeviceCount: { standard: 250, micro: 500 },
|
|
77
77
|
offer: true,
|
|
78
78
|
price: "$291 / month",
|
|
79
79
|
deviceCount: startingDeviceCount.professional,
|
|
@@ -83,7 +83,7 @@ var PLANS = {
|
|
|
83
83
|
enterprise: {
|
|
84
84
|
id: "enterprise",
|
|
85
85
|
name: "Enterprise",
|
|
86
|
-
minimalDeviceCount: 1e3,
|
|
86
|
+
minimalDeviceCount: { standard: 1e3, micro: 2e3 },
|
|
87
87
|
price: "Custom pricing",
|
|
88
88
|
deviceCount: "Unlimited devices",
|
|
89
89
|
description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote.",
|
|
@@ -763,6 +763,7 @@ var getYesterday = () => {
|
|
|
763
763
|
return today.toISOString();
|
|
764
764
|
};
|
|
765
765
|
var initialState = {
|
|
766
|
+
appInitDone: false,
|
|
766
767
|
cancelSource: void 0,
|
|
767
768
|
commit: "",
|
|
768
769
|
demoArtifactLink: "https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender",
|
|
@@ -784,6 +785,7 @@ var initialState = {
|
|
|
784
785
|
hasDeviceConnect: false,
|
|
785
786
|
hasFeedbackEnabled: false,
|
|
786
787
|
hasMonitor: false,
|
|
788
|
+
hasMCUEnabled: false,
|
|
787
789
|
hasReporting: false,
|
|
788
790
|
isHosted: true,
|
|
789
791
|
isEnterprise: false
|
|
@@ -888,7 +890,10 @@ var appSlice = (0, import_toolkit.createSlice)({
|
|
|
888
890
|
...action.payload
|
|
889
891
|
};
|
|
890
892
|
},
|
|
891
|
-
setEnvironmentData: (state, action) => ({ ...state, ...action.payload })
|
|
893
|
+
setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),
|
|
894
|
+
setAppInitDone: (state) => {
|
|
895
|
+
state.appInitDone = true;
|
|
896
|
+
}
|
|
892
897
|
}
|
|
893
898
|
});
|
|
894
899
|
var actions = appSlice.actions;
|