@northern.tech/store 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.d.mts +95 -0
- package/dist/actions.d.ts +95 -0
- package/dist/actions.js +1746 -0
- package/dist/actions.js.map +1 -0
- package/dist/actions.mjs +21 -0
- package/dist/actions.mjs.map +1 -0
- package/dist/api/general-api.d.mts +21 -0
- package/dist/api/general-api.d.ts +21 -0
- package/dist/api/general-api.js +1002 -0
- package/dist/api/general-api.js.map +1 -0
- package/dist/api/general-api.mjs +18 -0
- package/dist/api/general-api.mjs.map +1 -0
- package/dist/api/types/Address.ts +6 -0
- package/dist/api/types/AddressUpdate.ts +12 -0
- package/dist/api/types/AuthSet.ts +37 -0
- package/{api/types/AuthSet.ts → dist/api/types/AuthSetIot_manager.ts} +2 -2
- package/dist/api/types/BillingProfile.ts +37 -0
- package/dist/api/types/BillingProfileUpdate.ts +37 -0
- package/{api → dist/api}/types/BinaryDeltaLimits.ts +6 -0
- package/{api → dist/api}/types/BoundingBox.ts +1 -3
- package/dist/api/types/Deployment.ts +45 -0
- package/{api → dist/api}/types/DeploymentAggregation.ts +1 -3
- package/{api → dist/api}/types/DeploymentAggregationItem.ts +1 -3
- package/{api → dist/api}/types/DeploymentAggregationTerm.ts +1 -2
- package/{api → dist/api}/types/DeploymentAggregationTerms.ts +1 -3
- package/{api → dist/api}/types/DeploymentAttributeProjection.ts +1 -2
- package/{api → dist/api}/types/DeploymentDeployments.ts +4 -5
- package/{api → dist/api}/types/DeploymentFilterTerm.ts +1 -3
- package/dist/api/types/DeploymentPhaseDeployments.ts +23 -0
- package/{api → dist/api}/types/DeploymentSearchTerms.ts +1 -3
- package/{api → dist/api}/types/DeploymentSortTerm.ts +1 -3
- package/dist/api/types/DeploymentStatisticsDeployments.ts +15 -0
- package/dist/api/types/DeploymentStatusStatisticsDeployments.ts +54 -0
- package/dist/api/types/Device.ts +20 -0
- package/{api → dist/api}/types/DeviceAggregation.ts +1 -3
- package/{api → dist/api}/types/DeviceAggregationItem.ts +1 -3
- package/{api → dist/api}/types/DeviceAggregationTerm.ts +1 -2
- package/{api → dist/api}/types/DeviceAggregationTerms.ts +1 -3
- package/{api → dist/api}/types/DeviceAttribute.ts +1 -2
- package/{api → dist/api}/types/DeviceAttributeProjection.ts +1 -2
- package/{api/types/Device.ts → dist/api/types/DeviceDeployments.ts} +1 -1
- package/{api → dist/api}/types/DeviceFilterAttribute.ts +1 -2
- package/{api → dist/api}/types/DeviceFilterTerm.ts +1 -3
- package/{api → dist/api}/types/DeviceSearchTerms.ts +1 -3
- package/{api → dist/api}/types/DeviceSortTerm.ts +1 -3
- package/{api → dist/api}/types/Error.ts +1 -1
- package/{api/types/FilterInventory.ts → dist/api/types/Filter.ts} +3 -4
- package/{api/types/Filter.ts → dist/api/types/FilterInventory.ts} +1 -1
- package/dist/api/types/FilterPredicate.ts +48 -0
- package/{api/types/FilterPredicate.ts → dist/api/types/FilterPredicateInventory.ts} +3 -3
- package/{api → dist/api}/types/GeoBoundingBox.ts +1 -3
- package/{api → dist/api}/types/GeoBoundingBoxFilter.ts +1 -2
- package/{api → dist/api}/types/GeoDistance.ts +1 -3
- package/{api → dist/api}/types/GeoDistanceFilter.ts +1 -3
- package/{api → dist/api}/types/GeoPoint.ts +1 -2
- package/{api → dist/api}/types/Integration.ts +6 -0
- package/{api → dist/api}/types/MenderTypes.ts +41 -11
- package/{api → dist/api}/types/NewDeploymentV2.ts +3 -0
- package/{api → dist/api}/types/NewTenant.ts +16 -8
- package/{api → dist/api}/types/Object.ts +3 -0
- package/{api → dist/api}/types/PreAuthSet.ts +1 -1
- package/{api → dist/api}/types/Settings.ts +3 -3
- package/{api → dist/api}/types/Status.ts +5 -4
- package/{api → dist/api}/types/StatusTenantadm.ts +1 -3
- package/dist/api/types/Tenant.ts +21 -0
- package/{api → dist/api}/types/TenantTenantadm.ts +16 -0
- package/dist/api/types/UpdateChildTenant.ts +17 -0
- package/{api → dist/api}/types/UpdateDeployments.ts +1 -1
- package/{api → dist/api}/types/UpgradeCompleteRequest.ts +2 -0
- package/{api → dist/api}/types/UserWithTenantInfo.ts +7 -3
- package/dist/api/users-api.d.mts +16 -0
- package/dist/api/users-api.d.ts +16 -0
- package/dist/api/users-api.js +1026 -0
- package/dist/api/users-api.js.map +1 -0
- package/dist/api/users-api.mjs +15 -0
- package/dist/api/users-api.mjs.map +1 -0
- package/dist/appSlice/constants.d.mts +210 -0
- package/dist/appSlice/constants.d.ts +210 -0
- package/dist/appSlice/constants.js +221 -0
- package/dist/appSlice/constants.js.map +1 -0
- package/dist/appSlice/constants.mjs +42 -0
- package/dist/appSlice/constants.mjs.map +1 -0
- package/dist/appSlice/index.d.mts +1557 -0
- package/dist/appSlice/index.d.ts +1557 -0
- package/dist/appSlice/index.js +1067 -0
- package/dist/appSlice/index.js.map +1 -0
- package/dist/appSlice/index.mjs +21 -0
- package/dist/appSlice/index.mjs.map +1 -0
- package/dist/appSlice/selectors.d.mts +91 -0
- package/dist/appSlice/selectors.d.ts +91 -0
- package/dist/appSlice/selectors.js +90 -0
- package/dist/appSlice/selectors.js.map +1 -0
- package/dist/appSlice/selectors.mjs +20 -0
- package/dist/appSlice/selectors.mjs.map +1 -0
- package/dist/appSlice/thunks.d.mts +46 -0
- package/dist/appSlice/thunks.d.ts +46 -0
- package/dist/appSlice/thunks.js +5655 -0
- package/dist/appSlice/thunks.js.map +1 -0
- package/dist/appSlice/thunks.mjs +45 -0
- package/dist/appSlice/thunks.mjs.map +1 -0
- package/dist/auth.d.mts +17 -0
- package/dist/auth.d.ts +17 -0
- package/dist/auth.js +985 -0
- package/dist/auth.js.map +1 -0
- package/dist/auth.mjs +23 -0
- package/dist/auth.mjs.map +1 -0
- package/dist/chunk-6667TCAJ.mjs +135 -0
- package/dist/chunk-6667TCAJ.mjs.map +1 -0
- package/{releasesSlice/index.ts → dist/chunk-7E7KJHY3.mjs} +33 -32
- package/dist/chunk-7E7KJHY3.mjs.map +1 -0
- package/{usersSlice/index.ts → dist/chunk-BJSH2G7W.mjs} +39 -58
- package/dist/chunk-BJSH2G7W.mjs.map +1 -0
- package/dist/chunk-BOSBROA3.mjs +168 -0
- package/dist/chunk-BOSBROA3.mjs.map +1 -0
- package/dist/chunk-BRHSKNFC.mjs +70 -0
- package/dist/chunk-BRHSKNFC.mjs.map +1 -0
- package/dist/chunk-C2YZYTJ6.mjs +37 -0
- package/dist/chunk-C2YZYTJ6.mjs.map +1 -0
- package/dist/chunk-DZBVTSIX.mjs +55 -0
- package/dist/chunk-DZBVTSIX.mjs.map +1 -0
- package/{appSlice/index.ts → dist/chunk-F37LUTBX.mjs} +58 -68
- package/dist/chunk-F37LUTBX.mjs.map +1 -0
- package/dist/chunk-G32LAKW4.mjs +239 -0
- package/dist/chunk-G32LAKW4.mjs.map +1 -0
- package/dist/chunk-G3I53JGW.mjs +243 -0
- package/dist/chunk-G3I53JGW.mjs.map +1 -0
- package/dist/chunk-G4FGNSV3.mjs +13 -0
- package/dist/chunk-G4FGNSV3.mjs.map +1 -0
- package/dist/chunk-G7LATUT6.mjs +110 -0
- package/dist/chunk-G7LATUT6.mjs.map +1 -0
- package/dist/chunk-H2PQQMRY.mjs +7 -0
- package/dist/chunk-H2PQQMRY.mjs.map +1 -0
- package/{devicesSlice/index.ts → dist/chunk-HRWZJQMH.mjs} +57 -77
- package/dist/chunk-HRWZJQMH.mjs.map +1 -0
- package/dist/chunk-HVHZG2H4.mjs +56 -0
- package/dist/chunk-HVHZG2H4.mjs.map +1 -0
- package/dist/chunk-HXPYJ6QN.mjs +75 -0
- package/dist/chunk-HXPYJ6QN.mjs.map +1 -0
- package/dist/chunk-IPPIKGIB.mjs +35 -0
- package/dist/chunk-IPPIKGIB.mjs.map +1 -0
- package/dist/chunk-IU4OXOPA.mjs +46 -0
- package/dist/chunk-IU4OXOPA.mjs.map +1 -0
- package/dist/chunk-IVSYYXTC.mjs +36 -0
- package/dist/chunk-IVSYYXTC.mjs.map +1 -0
- package/{onboardingSlice/index.ts → dist/chunk-M4U5R7A4.mjs} +19 -22
- package/dist/chunk-M4U5R7A4.mjs.map +1 -0
- package/dist/chunk-N7G6QK2E.mjs +414 -0
- package/dist/chunk-N7G6QK2E.mjs.map +1 -0
- package/dist/chunk-O6O3D52B.mjs +39 -0
- package/dist/chunk-O6O3D52B.mjs.map +1 -0
- package/dist/chunk-QBKCUIWO.mjs +7 -0
- package/dist/chunk-QBKCUIWO.mjs.map +1 -0
- package/dist/chunk-R2GBNXLV.mjs +57 -0
- package/dist/chunk-R2GBNXLV.mjs.map +1 -0
- package/dist/chunk-RH6ONMG7.mjs +65 -0
- package/dist/chunk-RH6ONMG7.mjs.map +1 -0
- package/dist/chunk-RQOE5OOT.mjs +284 -0
- package/dist/chunk-RQOE5OOT.mjs.map +1 -0
- package/dist/chunk-TD45YTYK.mjs +108 -0
- package/dist/chunk-TD45YTYK.mjs.map +1 -0
- package/dist/chunk-V32GTKOS.mjs +1 -0
- package/dist/chunk-V32GTKOS.mjs.map +1 -0
- package/dist/chunk-XWBD7VOK.mjs +93 -0
- package/dist/chunk-XWBD7VOK.mjs.map +1 -0
- package/dist/chunk-XYVPYFSM.mjs +106 -0
- package/dist/chunk-XYVPYFSM.mjs.map +1 -0
- package/dist/chunk-YNVSU3AA.mjs +2977 -0
- package/dist/chunk-YNVSU3AA.mjs.map +1 -0
- package/dist/chunk-ZIYGEXSJ.mjs +145 -0
- package/dist/chunk-ZIYGEXSJ.mjs.map +1 -0
- package/dist/chunk-ZNST5R6O.mjs +658 -0
- package/dist/chunk-ZNST5R6O.mjs.map +1 -0
- package/dist/commonConstants.d.mts +248 -0
- package/dist/commonConstants.d.ts +248 -0
- package/dist/commonConstants.js +303 -0
- package/dist/commonConstants.js.map +1 -0
- package/dist/commonConstants.mjs +40 -0
- package/dist/commonConstants.mjs.map +1 -0
- package/dist/commonSelectors.d.mts +896 -0
- package/dist/commonSelectors.d.ts +896 -0
- package/dist/commonSelectors.js +1482 -0
- package/dist/commonSelectors.js.map +1 -0
- package/dist/commonSelectors.mjs +54 -0
- package/dist/commonSelectors.mjs.map +1 -0
- package/dist/constants.d.mts +12 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +1246 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +219 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/deploymentsSlice/constants.d.mts +142 -0
- package/dist/deploymentsSlice/constants.d.ts +142 -0
- package/dist/deploymentsSlice/constants.js +969 -0
- package/dist/deploymentsSlice/constants.js.map +1 -0
- package/dist/deploymentsSlice/constants.mjs +42 -0
- package/dist/deploymentsSlice/constants.mjs.map +1 -0
- package/dist/deploymentsSlice/index.d.mts +2373 -0
- package/dist/deploymentsSlice/index.d.ts +2373 -0
- package/dist/deploymentsSlice/index.js +1053 -0
- package/dist/deploymentsSlice/index.js.map +1 -0
- package/dist/deploymentsSlice/index.mjs +21 -0
- package/dist/deploymentsSlice/index.mjs.map +1 -0
- package/dist/deploymentsSlice/selectors.d.mts +59 -0
- package/dist/deploymentsSlice/selectors.d.ts +59 -0
- package/dist/deploymentsSlice/selectors.js +969 -0
- package/dist/deploymentsSlice/selectors.js.map +1 -0
- package/dist/deploymentsSlice/selectors.mjs +25 -0
- package/dist/deploymentsSlice/selectors.mjs.map +1 -0
- package/dist/deploymentsSlice/thunks.d.mts +202 -0
- package/dist/deploymentsSlice/thunks.d.ts +202 -0
- package/dist/deploymentsSlice/thunks.js +5671 -0
- package/dist/deploymentsSlice/thunks.js.map +1 -0
- package/dist/deploymentsSlice/thunks.mjs +63 -0
- package/dist/deploymentsSlice/thunks.mjs.map +1 -0
- package/dist/devicesSlice/constants.d.mts +44 -0
- package/dist/devicesSlice/constants.d.ts +44 -0
- package/dist/devicesSlice/constants.js +969 -0
- package/dist/devicesSlice/constants.js.map +1 -0
- package/dist/devicesSlice/constants.mjs +40 -0
- package/dist/devicesSlice/constants.mjs.map +1 -0
- package/dist/devicesSlice/index.d.mts +2223 -0
- package/dist/devicesSlice/index.d.ts +2223 -0
- package/dist/devicesSlice/index.js +1109 -0
- package/dist/devicesSlice/index.js.map +1 -0
- package/dist/devicesSlice/index.mjs +21 -0
- package/dist/devicesSlice/index.mjs.map +1 -0
- package/dist/devicesSlice/selectors.d.mts +261 -0
- package/dist/devicesSlice/selectors.d.ts +261 -0
- package/dist/devicesSlice/selectors.js +1084 -0
- package/dist/devicesSlice/selectors.js.map +1 -0
- package/dist/devicesSlice/selectors.mjs +53 -0
- package/dist/devicesSlice/selectors.mjs.map +1 -0
- package/dist/devicesSlice/thunks.d.mts +742 -0
- package/dist/devicesSlice/thunks.d.ts +742 -0
- package/dist/devicesSlice/thunks.js +5743 -0
- package/dist/devicesSlice/thunks.js.map +1 -0
- package/dist/devicesSlice/thunks.mjs +135 -0
- package/dist/devicesSlice/thunks.mjs.map +1 -0
- package/dist/monitorSlice/constants.d.mts +6 -0
- package/dist/monitorSlice/constants.d.ts +6 -0
- package/dist/monitorSlice/constants.js +919 -0
- package/dist/monitorSlice/constants.js.map +1 -0
- package/dist/monitorSlice/constants.mjs +14 -0
- package/dist/monitorSlice/constants.mjs.map +1 -0
- package/dist/monitorSlice/index.d.mts +291 -0
- package/dist/monitorSlice/index.d.ts +291 -0
- package/dist/monitorSlice/index.js +971 -0
- package/dist/monitorSlice/index.js.map +1 -0
- package/dist/monitorSlice/index.mjs +21 -0
- package/dist/monitorSlice/index.mjs.map +1 -0
- package/dist/monitorSlice/selectors.d.mts +3 -0
- package/dist/monitorSlice/selectors.d.ts +3 -0
- package/dist/monitorSlice/selectors.js +31 -0
- package/dist/monitorSlice/selectors.js.map +1 -0
- package/dist/monitorSlice/selectors.mjs +8 -0
- package/dist/monitorSlice/selectors.mjs.map +1 -0
- package/dist/monitorSlice/thunks.d.mts +71 -0
- package/dist/monitorSlice/thunks.d.ts +71 -0
- package/dist/monitorSlice/thunks.js +2531 -0
- package/dist/monitorSlice/thunks.js.map +1 -0
- package/dist/monitorSlice/thunks.mjs +44 -0
- package/dist/monitorSlice/thunks.mjs.map +1 -0
- package/dist/onboardingSlice/constants.d.mts +23 -0
- package/dist/onboardingSlice/constants.d.ts +23 -0
- package/dist/onboardingSlice/constants.js +71 -0
- package/dist/onboardingSlice/constants.js.map +1 -0
- package/dist/onboardingSlice/constants.mjs +10 -0
- package/dist/onboardingSlice/constants.mjs.map +1 -0
- package/dist/onboardingSlice/index.d.mts +237 -0
- package/dist/onboardingSlice/index.d.ts +237 -0
- package/dist/onboardingSlice/index.js +94 -0
- package/dist/onboardingSlice/index.js.map +1 -0
- package/dist/onboardingSlice/index.mjs +16 -0
- package/dist/onboardingSlice/index.mjs.map +1 -0
- package/dist/onboardingSlice/selectors.d.mts +3 -0
- package/dist/onboardingSlice/selectors.d.ts +3 -0
- package/dist/onboardingSlice/selectors.js +31 -0
- package/dist/onboardingSlice/selectors.js.map +1 -0
- package/dist/onboardingSlice/selectors.mjs +8 -0
- package/dist/onboardingSlice/selectors.mjs.map +1 -0
- package/dist/onboardingSlice/thunks.d.mts +172 -0
- package/dist/onboardingSlice/thunks.d.ts +172 -0
- package/dist/onboardingSlice/thunks.js +5661 -0
- package/dist/onboardingSlice/thunks.js.map +1 -0
- package/dist/onboardingSlice/thunks.mjs +51 -0
- package/dist/onboardingSlice/thunks.mjs.map +1 -0
- package/dist/organizationSlice/constants.d.mts +134 -0
- package/dist/organizationSlice/constants.d.ts +134 -0
- package/dist/organizationSlice/constants.js +978 -0
- package/dist/organizationSlice/constants.js.map +1 -0
- package/dist/organizationSlice/constants.mjs +34 -0
- package/dist/organizationSlice/constants.mjs.map +1 -0
- package/dist/organizationSlice/index.d.mts +1097 -0
- package/dist/organizationSlice/index.d.ts +1097 -0
- package/dist/organizationSlice/index.js +1015 -0
- package/dist/organizationSlice/index.js.map +1 -0
- package/dist/organizationSlice/index.mjs +21 -0
- package/dist/organizationSlice/index.mjs.map +1 -0
- package/dist/organizationSlice/selectors.d.mts +134 -0
- package/dist/organizationSlice/selectors.d.ts +134 -0
- package/dist/organizationSlice/selectors.js +977 -0
- package/dist/organizationSlice/selectors.js.map +1 -0
- package/dist/organizationSlice/selectors.mjs +39 -0
- package/dist/organizationSlice/selectors.mjs.map +1 -0
- package/dist/organizationSlice/thunks.d.mts +502 -0
- package/dist/organizationSlice/thunks.d.ts +502 -0
- package/dist/organizationSlice/thunks.js +5709 -0
- package/dist/organizationSlice/thunks.js.map +1 -0
- package/dist/organizationSlice/thunks.mjs +101 -0
- package/dist/organizationSlice/thunks.mjs.map +1 -0
- package/dist/releasesSlice/constants.d.mts +14 -0
- package/dist/releasesSlice/constants.d.ts +14 -0
- package/dist/releasesSlice/constants.js +40 -0
- package/dist/releasesSlice/constants.js.map +1 -0
- package/dist/releasesSlice/constants.mjs +14 -0
- package/dist/releasesSlice/constants.mjs.map +1 -0
- package/dist/releasesSlice/index.d.mts +483 -0
- package/dist/releasesSlice/index.d.ts +483 -0
- package/dist/releasesSlice/index.js +1034 -0
- package/dist/releasesSlice/index.js.map +1 -0
- package/dist/releasesSlice/index.mjs +21 -0
- package/dist/releasesSlice/index.mjs.map +1 -0
- package/dist/releasesSlice/selectors.d.mts +92 -0
- package/dist/releasesSlice/selectors.d.ts +92 -0
- package/dist/releasesSlice/selectors.js +967 -0
- package/dist/releasesSlice/selectors.js.map +1 -0
- package/dist/releasesSlice/selectors.mjs +28 -0
- package/dist/releasesSlice/selectors.mjs.map +1 -0
- package/dist/releasesSlice/thunks.d.mts +276 -0
- package/dist/releasesSlice/thunks.d.ts +276 -0
- package/dist/releasesSlice/thunks.js +2843 -0
- package/dist/releasesSlice/thunks.js.map +1 -0
- package/dist/releasesSlice/thunks.mjs +66 -0
- package/dist/releasesSlice/thunks.mjs.map +1 -0
- package/dist/selectors.d.mts +10 -0
- package/dist/selectors.d.ts +10 -0
- package/dist/selectors.js +1636 -0
- package/dist/selectors.js.map +1 -0
- package/dist/selectors.mjs +207 -0
- package/dist/selectors.mjs.map +1 -0
- package/dist/store.d.mts +2306 -0
- package/dist/store.d.ts +2306 -0
- package/dist/store.js +1877 -0
- package/dist/store.js.map +1 -0
- package/dist/store.mjs +32 -0
- package/dist/store.mjs.map +1 -0
- package/dist/storehooks.d.mts +4 -0
- package/dist/storehooks.d.ts +4 -0
- package/dist/storehooks.js +5844 -0
- package/dist/storehooks.js.map +1 -0
- package/dist/storehooks.mjs +265 -0
- package/dist/storehooks.mjs.map +1 -0
- package/dist/thunks.d.mts +12 -0
- package/dist/thunks.d.ts +12 -0
- package/dist/thunks.js +5973 -0
- package/dist/thunks.js.map +1 -0
- package/dist/thunks.mjs +363 -0
- package/dist/thunks.mjs.map +1 -0
- package/dist/usersSlice/constants.d.mts +635 -0
- package/dist/usersSlice/constants.d.ts +635 -0
- package/dist/usersSlice/constants.js +967 -0
- package/dist/usersSlice/constants.js.map +1 -0
- package/dist/usersSlice/constants.mjs +43 -0
- package/dist/usersSlice/constants.mjs.map +1 -0
- package/dist/usersSlice/index.d.mts +6993 -0
- package/dist/usersSlice/index.d.ts +6993 -0
- package/dist/usersSlice/index.js +1054 -0
- package/dist/usersSlice/index.js.map +1 -0
- package/dist/usersSlice/index.mjs +21 -0
- package/dist/usersSlice/index.mjs.map +1 -0
- package/dist/usersSlice/selectors.d.mts +209 -0
- package/dist/usersSlice/selectors.d.ts +209 -0
- package/dist/usersSlice/selectors.js +997 -0
- package/dist/usersSlice/selectors.js.map +1 -0
- package/dist/usersSlice/selectors.mjs +38 -0
- package/dist/usersSlice/selectors.mjs.map +1 -0
- package/dist/usersSlice/thunks.d.mts +881 -0
- package/dist/usersSlice/thunks.d.ts +881 -0
- package/dist/usersSlice/thunks.js +5717 -0
- package/dist/usersSlice/thunks.js.map +1 -0
- package/dist/usersSlice/thunks.mjs +109 -0
- package/dist/usersSlice/thunks.mjs.map +1 -0
- package/dist/utils.d.mts +60 -0
- package/dist/utils.d.ts +60 -0
- package/dist/utils.js +1160 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +49 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +14 -2
- package/.eslintrc.cjs +0 -9
- package/.prettierignore +0 -1
- package/CHANGELOG.md +0 -2
- package/actions.ts +0 -32
- package/api/general-api.test.ts +0 -51
- package/api/general-api.ts +0 -60
- package/api/types/Deployment.ts +0 -95
- package/api/types/DeviceDeployments.ts +0 -31
- package/api/types/FilterPredicateInventory.ts +0 -76
- package/api/types/Tenant.ts +0 -38
- package/api/users-api.ts +0 -34
- package/appSlice/constants.ts +0 -166
- package/appSlice/reducer.test.ts +0 -97
- package/appSlice/selectors.ts +0 -33
- package/appSlice/thunks.test.ts +0 -118
- package/appSlice/thunks.ts +0 -148
- package/auth.test.ts +0 -36
- package/auth.ts +0 -82
- package/commonConstants.tsx +0 -252
- package/commonSelectors.ts +0 -255
- package/constants.ts +0 -22
- package/deploymentsSlice/constants.ts +0 -175
- package/deploymentsSlice/index.ts +0 -145
- package/deploymentsSlice/reducer.test.ts +0 -108
- package/deploymentsSlice/selectors.ts +0 -58
- package/deploymentsSlice/thunks.test.ts +0 -425
- package/deploymentsSlice/thunks.ts +0 -382
- package/devicesSlice/constants.ts +0 -56
- package/devicesSlice/reducer.test.ts +0 -194
- package/devicesSlice/selectors.ts +0 -127
- package/devicesSlice/thunks.test.tsx +0 -1245
- package/devicesSlice/thunks.tsx +0 -1098
- package/monitorSlice/constants.ts +0 -17
- package/monitorSlice/index.ts +0 -65
- package/monitorSlice/reducer.test.ts +0 -79
- package/monitorSlice/selectors.ts +0 -15
- package/monitorSlice/thunks.test.ts +0 -112
- package/monitorSlice/thunks.ts +0 -101
- package/onboardingSlice/constants.ts +0 -53
- package/onboardingSlice/reducer.test.ts +0 -45
- package/onboardingSlice/selectors.ts +0 -15
- package/onboardingSlice/thunks.test.ts +0 -235
- package/onboardingSlice/thunks.ts +0 -142
- package/organizationSlice/constants.ts +0 -82
- package/organizationSlice/index.ts +0 -111
- package/organizationSlice/reducer.test.ts +0 -78
- package/organizationSlice/selectors.ts +0 -45
- package/organizationSlice/thunks.test.ts +0 -619
- package/organizationSlice/thunks.ts +0 -383
- package/releasesSlice/constants.ts +0 -18
- package/releasesSlice/reducer.test.ts +0 -78
- package/releasesSlice/selectors.ts +0 -33
- package/releasesSlice/thunks.test.ts +0 -389
- package/releasesSlice/thunks.ts +0 -379
- package/selectors.ts +0 -22
- package/store.ts +0 -89
- package/storehooks.test.tsx +0 -386
- package/storehooks.ts +0 -250
- package/thunks.ts +0 -21
- package/tsconfig.json +0 -11
- package/tsup.config.ts +0 -11
- package/usersSlice/constants.ts +0 -374
- package/usersSlice/reducer.test.ts +0 -141
- package/usersSlice/selectors.ts +0 -60
- package/usersSlice/thunks.test.ts +0 -660
- package/usersSlice/thunks.ts +0 -782
- package/utils.test.ts +0 -187
- package/utils.ts +0 -249
- /package/{api → dist/api}/types/AWSCredentials.ts +0 -0
- /package/{api → dist/api}/types/Actor.ts +0 -0
- /package/{api → dist/api}/types/Addon.ts +0 -0
- /package/{api → dist/api}/types/AddonTenantadm.ts +0 -0
- /package/{api → dist/api}/types/Alert.ts +0 -0
- /package/{api → dist/api}/types/AlertDetails.ts +0 -0
- /package/{api → dist/api}/types/AlertSubject.ts +0 -0
- /package/{api → dist/api}/types/ApiBurst.ts +0 -0
- /package/{api → dist/api}/types/ApiBurstTenantadm.ts +0 -0
- /package/{api → dist/api}/types/ApiLimits.ts +0 -0
- /package/{api → dist/api}/types/ApiLimitsTenantadm.ts +0 -0
- /package/{api → dist/api}/types/ApiQuota.ts +0 -0
- /package/{api → dist/api}/types/ApiQuotaTenantadm.ts +0 -0
- /package/{api → dist/api}/types/Artifact.ts +0 -0
- /package/{api → dist/api}/types/ArtifactDeployments.ts +0 -0
- /package/{api → dist/api}/types/ArtifactInfo.ts +0 -0
- /package/{api → dist/api}/types/ArtifactInfoDeployments.ts +0 -0
- /package/{api → dist/api}/types/ArtifactLink.ts +0 -0
- /package/{api → dist/api}/types/ArtifactTypeInfo.ts +0 -0
- /package/{api → dist/api}/types/ArtifactTypeInfoDeployments.ts +0 -0
- /package/{api → dist/api}/types/ArtifactUpdate.ts +0 -0
- /package/{api → dist/api}/types/ArtifactUploadLink.ts +0 -0
- /package/{api → dist/api}/types/Attribute.ts +0 -0
- /package/{api → dist/api}/types/AttributeInventory.ts +0 -0
- /package/{api → dist/api}/types/AuditLog.ts +0 -0
- /package/{api → dist/api}/types/AuthSetDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/AutoAuthRequest.ts +0 -0
- /package/{api → dist/api}/types/AzureSharedAccessSecret.ts +0 -0
- /package/{api → dist/api}/types/BillingInfo.ts +0 -0
- /package/{api → dist/api}/types/BinaryDeltaConfiguration.ts +0 -0
- /package/{api → dist/api}/types/BinaryDeltaConfigurationDeployments.ts +0 -0
- /package/{api → dist/api}/types/BinaryDeltaLimitsDeployments.ts +0 -0
- /package/{api → dist/api}/types/CancelRequest.ts +0 -0
- /package/{api → dist/api}/types/CardData.ts +0 -0
- /package/{api → dist/api}/types/CardSetupData.ts +0 -0
- /package/{api → dist/api}/types/CheckoutData.ts +0 -0
- /package/{api → dist/api}/types/Configuration.ts +0 -0
- /package/{api → dist/api}/types/Count.ts +0 -0
- /package/{api → dist/api}/types/Credentials.ts +0 -0
- /package/{api → dist/api}/types/DBusSubsystem.ts +0 -0
- /package/{api → dist/api}/types/DeltaConfiguration.ts +0 -0
- /package/{api → dist/api}/types/DeltaConfigurationDeployments.ts +0 -0
- /package/{api → dist/api}/types/DeploymentAuditlogs.ts +0 -0
- /package/{api → dist/api}/types/DeploymentIdentifier.ts +0 -0
- /package/{api → dist/api}/types/DeploymentPhase.ts +0 -0
- /package/{api → dist/api}/types/DeploymentReporting.ts +0 -0
- /package/{api → dist/api}/types/DeploymentStatistics.ts +0 -0
- /package/{api → dist/api}/types/DeploymentStatusStatistics.ts +0 -0
- /package/{api → dist/api}/types/DeviceAuditlogs.ts +0 -0
- /package/{api → dist/api}/types/DeviceAuthEvent.ts +0 -0
- /package/{api → dist/api}/types/DeviceConfiguration.ts +0 -0
- /package/{api → dist/api}/types/DeviceDeployment.ts +0 -0
- /package/{api → dist/api}/types/DeviceDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/DeviceInventory.ts +0 -0
- /package/{api → dist/api}/types/DeviceInventoryInventory.ts +0 -0
- /package/{api → dist/api}/types/DeviceReporting.ts +0 -0
- /package/{api → dist/api}/types/DeviceState.ts +0 -0
- /package/{api → dist/api}/types/DeviceStateDeviceconnect.ts +0 -0
- /package/{api → dist/api}/types/DeviceStateIot_manager.ts +0 -0
- /package/{api → dist/api}/types/DeviceStatus.ts +0 -0
- /package/{api → dist/api}/types/DeviceWithImage.ts +0 -0
- /package/{api → dist/api}/types/DirectUploadMetadata.ts +0 -0
- /package/{api → dist/api}/types/EmailVerificationCompletion.ts +0 -0
- /package/{api → dist/api}/types/EmailVerificationRequest.ts +0 -0
- /package/{api → dist/api}/types/ErrorAuditlogs.ts +0 -0
- /package/{api → dist/api}/types/ErrorDeployments.ts +0 -0
- /package/{api → dist/api}/types/ErrorDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/ErrorDeviceconfig.ts +0 -0
- /package/{api → dist/api}/types/ErrorDeviceconnect.ts +0 -0
- /package/{api → dist/api}/types/ErrorDevicemonitor.ts +0 -0
- /package/{api → dist/api}/types/ErrorExt.ts +0 -0
- /package/{api → dist/api}/types/ErrorInventory.ts +0 -0
- /package/{api → dist/api}/types/ErrorIot_manager.ts +0 -0
- /package/{api → dist/api}/types/ErrorNotFound.ts +0 -0
- /package/{api → dist/api}/types/ErrorReporting.ts +0 -0
- /package/{api → dist/api}/types/ErrorTenantadm.ts +0 -0
- /package/{api → dist/api}/types/ErrorUseradm.ts +0 -0
- /package/{api → dist/api}/types/Event.ts +0 -0
- /package/{api → dist/api}/types/ExternalIdentity.ts +0 -0
- /package/{api → dist/api}/types/Features.ts +0 -0
- /package/{api → dist/api}/types/FileUpload.ts +0 -0
- /package/{api → dist/api}/types/FilterAttribute.ts +0 -0
- /package/{api → dist/api}/types/FilterDefinition.ts +0 -0
- /package/{api → dist/api}/types/FilterDeployments.ts +0 -0
- /package/{api → dist/api}/types/FilterPredicateDeployments.ts +0 -0
- /package/{api → dist/api}/types/Group.ts +0 -0
- /package/{api → dist/api}/types/HTTP.ts +0 -0
- /package/{api → dist/api}/types/IdentityData.ts +0 -0
- /package/{api → dist/api}/types/InputParameter.ts +0 -0
- /package/{api → dist/api}/types/JobStatus.ts +0 -0
- /package/{api → dist/api}/types/Limit.ts +0 -0
- /package/{api → dist/api}/types/LimitDeployments.ts +0 -0
- /package/{api → dist/api}/types/LimitDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/LimitUseradm.ts +0 -0
- /package/{api → dist/api}/types/Limits.ts +0 -0
- /package/{api → dist/api}/types/LineDescriptor.ts +0 -0
- /package/{api → dist/api}/types/LogSubsystem.ts +0 -0
- /package/{api → dist/api}/types/LoginOptions.ts +0 -0
- /package/{api → dist/api}/types/ManagementAPIConfiguration.ts +0 -0
- /package/{api → dist/api}/types/MonitorConfiguration.ts +0 -0
- /package/{api → dist/api}/types/NewConfigurationDeployment.ts +0 -0
- /package/{api → dist/api}/types/NewConfigurationDeploymentResponse.ts +0 -0
- /package/{api → dist/api}/types/NewDeployment.ts +0 -0
- /package/{api → dist/api}/types/NewDeploymentForGroup.ts +0 -0
- /package/{api → dist/api}/types/NewDeploymentPhase.ts +0 -0
- /package/{api → dist/api}/types/NewDeploymentPhaseDeployments.ts +0 -0
- /package/{api → dist/api}/types/OwnUserUpdate.ts +0 -0
- /package/{api → dist/api}/types/PasswordResetCompletion.ts +0 -0
- /package/{api → dist/api}/types/PasswordResetRequest.ts +0 -0
- /package/{api → dist/api}/types/Permission.ts +0 -0
- /package/{api → dist/api}/types/PermissionObject.ts +0 -0
- /package/{api → dist/api}/types/PermissionSet.ts +0 -0
- /package/{api → dist/api}/types/PermissionSetWithScope.ts +0 -0
- /package/{api → dist/api}/types/PersonalAccessToken.ts +0 -0
- /package/{api → dist/api}/types/PersonalAccessTokenRequest.ts +0 -0
- /package/{api → dist/api}/types/Plan.ts +0 -0
- /package/{api → dist/api}/types/PlanBindingDetails.ts +0 -0
- /package/{api → dist/api}/types/PlanChangeRequest.ts +0 -0
- /package/{api → dist/api}/types/PlanLimits.ts +0 -0
- /package/{api → dist/api}/types/Release.ts +0 -0
- /package/{api → dist/api}/types/ReleaseDeployments.ts +0 -0
- /package/{api → dist/api}/types/ReleaseUpdate.ts +0 -0
- /package/{api → dist/api}/types/Releases.ts +0 -0
- /package/{api → dist/api}/types/ReleasesDeleteError.ts +0 -0
- /package/{api → dist/api}/types/ReleasesDeployments.ts +0 -0
- /package/{api → dist/api}/types/Role.ts +0 -0
- /package/{api → dist/api}/types/RolePermission.ts +0 -0
- /package/{api → dist/api}/types/RolePermissionObject.ts +0 -0
- /package/{api → dist/api}/types/RoleUseradm.ts +0 -0
- /package/{api → dist/api}/types/SAMLMetadata.ts +0 -0
- /package/{api → dist/api}/types/Scope.ts +0 -0
- /package/{api → dist/api}/types/SelectAttribute.ts +0 -0
- /package/{api → dist/api}/types/ServiceSubsystem.ts +0 -0
- /package/{api → dist/api}/types/SortCriteria.ts +0 -0
- /package/{api → dist/api}/types/SsoObject.ts +0 -0
- /package/{api → dist/api}/types/StatusDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/StorageLimit.ts +0 -0
- /package/{api → dist/api}/types/SubscriptionData.ts +0 -0
- /package/{api → dist/api}/types/SupportRequest.ts +0 -0
- /package/{api → dist/api}/types/Tag.ts +0 -0
- /package/{api → dist/api}/types/Tags.ts +0 -0
- /package/{api → dist/api}/types/TaskResult.ts +0 -0
- /package/{api → dist/api}/types/TaskResultCLI.ts +0 -0
- /package/{api → dist/api}/types/TaskResultHTTPRequest.ts +0 -0
- /package/{api → dist/api}/types/TaskResultHTTPResponse.ts +0 -0
- /package/{api → dist/api}/types/TenantApiLimits.ts +0 -0
- /package/{api → dist/api}/types/TenantApiLimitsTenantadm.ts +0 -0
- /package/{api → dist/api}/types/TenantIdName.ts +0 -0
- /package/{api → dist/api}/types/TenantIdsData.ts +0 -0
- /package/{api → dist/api}/types/TenantInfo.ts +0 -0
- /package/{api → dist/api}/types/TenantShortInfo.ts +0 -0
- /package/{api → dist/api}/types/TenantsIdName.ts +0 -0
- /package/{api → dist/api}/types/Update.ts +0 -0
- /package/{api → dist/api}/types/UpdateFile.ts +0 -0
- /package/{api → dist/api}/types/UpdateFileDeployments.ts +0 -0
- /package/{api → dist/api}/types/UpdateTypes.ts +0 -0
- /package/{api → dist/api}/types/User.ts +0 -0
- /package/{api → dist/api}/types/UserAuditlogs.ts +0 -0
- /package/{api → dist/api}/types/UserNew.ts +0 -0
- /package/{api → dist/api}/types/UserUpdate.ts +0 -0
- /package/{api → dist/api}/types/UserUseradm.ts +0 -0
- /package/{api → dist/api}/types/XDeltaArgs.ts +0 -0
- /package/{api → dist/api}/types/XDeltaArgsDeployments.ts +0 -0
- /package/{api → dist/api}/types/XDeltaArgsLimits.ts +0 -0
- /package/{api → dist/api}/types/XDeltaArgsLimitsDeployments.ts +0 -0
package/storehooks.test.tsx
DELETED
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 Northern.tech AS
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
// @ts-nocheck
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import { Provider } from 'react-redux';
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
getDeploymentsByStatus,
|
|
20
|
-
getDeviceAttributes,
|
|
21
|
-
getDeviceLimit,
|
|
22
|
-
getDevicesByStatus,
|
|
23
|
-
getDevicesWithAuth,
|
|
24
|
-
getDynamicGroups,
|
|
25
|
-
getGroups,
|
|
26
|
-
getIntegrations,
|
|
27
|
-
getReleases,
|
|
28
|
-
getUserOrganization,
|
|
29
|
-
tenantDataDivergedMessage
|
|
30
|
-
} from '@northern.tech/store/thunks';
|
|
31
|
-
import { act, renderHook } from '@testing-library/react';
|
|
32
|
-
import configureMockStore from 'redux-mock-store';
|
|
33
|
-
import { thunk } from 'redux-thunk';
|
|
34
|
-
|
|
35
|
-
import { inventoryDevice } from '../../../tests/__mocks__/deviceHandlers';
|
|
36
|
-
import { defaultState, receivedPermissionSets, receivedRoles, userId } from '../../../tests/mockData';
|
|
37
|
-
import { actions as appActions } from './appSlice';
|
|
38
|
-
import { getLatestReleaseInfo, setOfflineThreshold } from './appSlice/thunks';
|
|
39
|
-
import { latestSaasReleaseTag } from './appSlice/thunks.test';
|
|
40
|
-
import { getSessionInfo } from './auth';
|
|
41
|
-
import { EXTERNAL_PROVIDER, TIMEOUTS, UNGROUPED_GROUP, timeUnits } from './commonConstants';
|
|
42
|
-
import { DEVICE_STATES } from './constants';
|
|
43
|
-
import { actions as deploymentsActions } from './deploymentsSlice';
|
|
44
|
-
import { actions as deviceActions } from './devicesSlice';
|
|
45
|
-
import { actions as onboardingActions } from './onboardingSlice';
|
|
46
|
-
import { defaultOnboardingState, expectedOnboardingActions } from './onboardingSlice/thunks.test';
|
|
47
|
-
import { actions as organizationActions } from './organizationSlice';
|
|
48
|
-
import { actions as releasesActions } from './releasesSlice';
|
|
49
|
-
import { useAppInit } from './storehooks';
|
|
50
|
-
import { actions as userActions } from './usersSlice';
|
|
51
|
-
import { getGlobalSettings, getPermissionSets, getRoles, getUserSettings, saveUserSettings } from './usersSlice/thunks';
|
|
52
|
-
|
|
53
|
-
const middlewares = [thunk];
|
|
54
|
-
const mockStore = configureMockStore(middlewares);
|
|
55
|
-
|
|
56
|
-
const attributeReducer = (accu, item) => {
|
|
57
|
-
if (item.scope === 'inventory') {
|
|
58
|
-
accu[item.name] = item.value;
|
|
59
|
-
if (item.name === 'device_type') {
|
|
60
|
-
accu[item.name] = [].concat(item.value);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return accu;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
|
-
const { attributes, ...expectedDevice } = defaultState.devices.byId.a1;
|
|
68
|
-
export const receivedInventoryDevice = {
|
|
69
|
-
...defaultState.devices.byId.a1,
|
|
70
|
-
attributes: inventoryDevice.attributes.reduce(attributeReducer, {}),
|
|
71
|
-
identity_data: { ...defaultState.devices.byId.a1.identity_data, status: DEVICE_STATES.accepted },
|
|
72
|
-
isNew: false,
|
|
73
|
-
isOffline: true,
|
|
74
|
-
monitor: {},
|
|
75
|
-
tags: {},
|
|
76
|
-
updated_ts: inventoryDevice.updated_ts
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const appInitActions = [
|
|
80
|
-
{ type: userActions.successfullyLoggedIn.type }, //, payload: { token }
|
|
81
|
-
{ type: onboardingActions.setOnboardingComplete.type, payload: false },
|
|
82
|
-
{ type: onboardingActions.setDemoArtifactPort.type, payload: 85 },
|
|
83
|
-
{ type: appActions.setFeatures.type, payload: { ...defaultState.app.features, hasMultitenancy: true } },
|
|
84
|
-
{
|
|
85
|
-
type: appActions.setVersionInformation.type,
|
|
86
|
-
payload: {
|
|
87
|
-
docsVersion: '',
|
|
88
|
-
value: {
|
|
89
|
-
Deployments: '1.2.3',
|
|
90
|
-
Deviceauth: null,
|
|
91
|
-
GUI: undefined,
|
|
92
|
-
Integration: 'master',
|
|
93
|
-
Inventory: null,
|
|
94
|
-
'Mender-Artifact': undefined,
|
|
95
|
-
'Mender-Client': 'next',
|
|
96
|
-
'Meta-Mender': 'saas-123.34'
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
type: appActions.setEnvironmentData.type,
|
|
102
|
-
payload: { feedbackProbability: 0.3, hostAddress: null, hostedAnnouncement: '', recaptchaSiteKey: '', stripeAPIKey: '', trackerCode: '' }
|
|
103
|
-
},
|
|
104
|
-
{ type: getLatestReleaseInfo.pending.type },
|
|
105
|
-
{ type: getUserSettings.pending.type },
|
|
106
|
-
{ type: getGlobalSettings.pending.type },
|
|
107
|
-
{ type: getDeviceAttributes.pending.type },
|
|
108
|
-
{ type: getDeploymentsByStatus.pending.type },
|
|
109
|
-
{ type: getDeploymentsByStatus.pending.type },
|
|
110
|
-
{ type: getDevicesByStatus.pending.type },
|
|
111
|
-
{ type: getDevicesByStatus.pending.type },
|
|
112
|
-
{ type: getDevicesByStatus.pending.type },
|
|
113
|
-
{ type: getDevicesByStatus.pending.type },
|
|
114
|
-
{ type: getDynamicGroups.pending.type },
|
|
115
|
-
{ type: getGroups.pending.type },
|
|
116
|
-
{ type: getIntegrations.pending.type },
|
|
117
|
-
{ type: getReleases.pending.type },
|
|
118
|
-
{ type: getDeviceLimit.pending.type },
|
|
119
|
-
{ type: getRoles.pending.type },
|
|
120
|
-
{ type: getPermissionSets.pending.type },
|
|
121
|
-
{ type: appActions.setFirstLoginAfterSignup.type, payload: false },
|
|
122
|
-
{ type: getUserOrganization.pending.type },
|
|
123
|
-
{ type: deploymentsActions.receivedDeployments.type, payload: defaultState.deployments.byId },
|
|
124
|
-
{
|
|
125
|
-
type: deploymentsActions.receivedDeploymentsForStatus.type,
|
|
126
|
-
payload: { deploymentIds: Object.keys(defaultState.deployments.byId), status: 'finished', total: Object.keys(defaultState.deployments.byId).length }
|
|
127
|
-
},
|
|
128
|
-
{ type: deploymentsActions.receivedDeployments.type, payload: defaultState.deployments.byId },
|
|
129
|
-
{
|
|
130
|
-
type: deploymentsActions.receivedDeploymentsForStatus.type,
|
|
131
|
-
payload: { deploymentIds: Object.keys(defaultState.deployments.byId), status: 'inprogress', total: Object.keys(defaultState.deployments.byId).length }
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
type: deploymentsActions.selectDeploymentsForStatus.type,
|
|
135
|
-
payload: { deploymentIds: Object.keys(defaultState.deployments.byId), status: 'inprogress', total: Object.keys(defaultState.deployments.byId).length }
|
|
136
|
-
},
|
|
137
|
-
{ type: getDeploymentsByStatus.fulfilled.type },
|
|
138
|
-
{ type: getDeploymentsByStatus.fulfilled.type },
|
|
139
|
-
{ type: deviceActions.setDeviceLimit.type, payload: 500 },
|
|
140
|
-
{ type: getDeviceLimit.fulfilled.type },
|
|
141
|
-
{
|
|
142
|
-
type: deviceActions.receivedGroups.type,
|
|
143
|
-
payload: {
|
|
144
|
-
testGroup: defaultState.devices.groups.byId.testGroup,
|
|
145
|
-
testGroupDynamic: { filters: [{ key: 'group', operator: '$eq', scope: 'system', value: 'things' }], id: 'filter1' }
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{ type: getDevicesByStatus.pending.type },
|
|
149
|
-
{ type: deviceActions.setFilterAttributes.type },
|
|
150
|
-
{ type: getDeviceAttributes.fulfilled.type },
|
|
151
|
-
{
|
|
152
|
-
type: deviceActions.receivedGroups.type,
|
|
153
|
-
payload: {
|
|
154
|
-
testGroup: defaultState.devices.groups.byId.testGroup,
|
|
155
|
-
testGroupDynamic: {
|
|
156
|
-
deviceIds: [],
|
|
157
|
-
filters: [
|
|
158
|
-
{ key: 'id', operator: '$in', scope: 'identity', value: [defaultState.devices.byId.a1.id] },
|
|
159
|
-
{ key: 'mac', operator: '$nexists', scope: 'identity', value: false },
|
|
160
|
-
{ key: 'kernel', operator: '$exists', scope: 'identity', value: true }
|
|
161
|
-
],
|
|
162
|
-
id: 'filter1',
|
|
163
|
-
total: 0
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
{ type: getDynamicGroups.fulfilled.type },
|
|
168
|
-
{
|
|
169
|
-
type: deviceActions.receivedDevices.type,
|
|
170
|
-
payload: {
|
|
171
|
-
[defaultState.devices.byId.a1.id]: { ...receivedInventoryDevice, group: 'test' },
|
|
172
|
-
[defaultState.devices.byId.b1.id]: {
|
|
173
|
-
...receivedInventoryDevice,
|
|
174
|
-
id: defaultState.devices.byId.b1.id,
|
|
175
|
-
group: 'test',
|
|
176
|
-
identity_data: { ...defaultState.devices.byId.b1.identity_data, status: DEVICE_STATES.accepted }
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
type: deviceActions.setDevicesByStatus.type,
|
|
182
|
-
payload: {
|
|
183
|
-
deviceIds: [defaultState.devices.byId.a1.id, defaultState.devices.byId.b1.id],
|
|
184
|
-
status: DEVICE_STATES.accepted,
|
|
185
|
-
total: defaultState.devices.byStatus.accepted.deviceIds.length
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
{ type: getDevicesWithAuth.pending.type },
|
|
189
|
-
{ type: deviceActions.receivedDevices.type, payload: { [expectedDevice.id]: { ...receivedInventoryDevice, group: 'test', status: 'pending' } } },
|
|
190
|
-
{
|
|
191
|
-
type: deviceActions.setDevicesByStatus.type,
|
|
192
|
-
payload: {
|
|
193
|
-
deviceIds: Array.from({ length: defaultState.devices.byStatus.pending.total }, () => defaultState.devices.byId.a1.id),
|
|
194
|
-
status: DEVICE_STATES.pending,
|
|
195
|
-
total: defaultState.devices.byStatus.pending.deviceIds.length
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
{ type: getDevicesWithAuth.pending.type },
|
|
199
|
-
{ type: deviceActions.receivedDevices.type, payload: {} },
|
|
200
|
-
{ type: deviceActions.setDevicesByStatus.type, payload: { deviceIds: [], status: 'preauthorized', total: 0 } },
|
|
201
|
-
{ type: deviceActions.receivedDevices.type, payload: {} },
|
|
202
|
-
{ type: deviceActions.setDevicesByStatus.type, payload: { deviceIds: [], status: 'rejected', total: 0 } },
|
|
203
|
-
{
|
|
204
|
-
type: appActions.setVersionInformation.type,
|
|
205
|
-
payload: {
|
|
206
|
-
GUI: latestSaasReleaseTag,
|
|
207
|
-
Integration: '1.2.3',
|
|
208
|
-
'Mender-Artifact': '1.3.7',
|
|
209
|
-
'Mender-Client': '3.2.1',
|
|
210
|
-
backend: latestSaasReleaseTag,
|
|
211
|
-
latestRelease: {
|
|
212
|
-
releaseDate: '2022-02-02',
|
|
213
|
-
repos: {
|
|
214
|
-
integration: '1.2.3',
|
|
215
|
-
mender: '3.2.1',
|
|
216
|
-
'mender-artifact': '1.3.7',
|
|
217
|
-
'other-service': '1.1.0',
|
|
218
|
-
service: '3.0.0'
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
{ type: organizationActions.setOrganization.type, payload: defaultState.organization.organization },
|
|
224
|
-
{ type: appActions.setAnnouncement.type, payload: tenantDataDivergedMessage },
|
|
225
|
-
{ type: getDevicesByStatus.fulfilled.type },
|
|
226
|
-
{ type: getDevicesByStatus.fulfilled.type },
|
|
227
|
-
{ type: getLatestReleaseInfo.fulfilled.type },
|
|
228
|
-
{ type: getUserOrganization.fulfilled.type },
|
|
229
|
-
{
|
|
230
|
-
type: organizationActions.receiveExternalDeviceIntegrations.type,
|
|
231
|
-
payload: [
|
|
232
|
-
{ connection_string: 'something_else', id: 1, provider: EXTERNAL_PROVIDER['iot-hub'].provider },
|
|
233
|
-
{ id: 2, provider: EXTERNAL_PROVIDER['iot-core'].provider, something: 'new' }
|
|
234
|
-
]
|
|
235
|
-
},
|
|
236
|
-
{ type: getIntegrations.fulfilled.type },
|
|
237
|
-
{ type: releasesActions.receiveReleases.type, payload: defaultState.releases.byId },
|
|
238
|
-
{
|
|
239
|
-
type: releasesActions.setReleaseListState.type,
|
|
240
|
-
payload: { ...defaultState.releases.releasesList, releaseIds: [defaultState.releases.byId.r1.name], page: 42 }
|
|
241
|
-
},
|
|
242
|
-
{ type: getReleases.fulfilled.type },
|
|
243
|
-
{
|
|
244
|
-
type: deviceActions.receivedDevices.type,
|
|
245
|
-
payload: {
|
|
246
|
-
[expectedDevice.id]: { ...defaultState.devices.byId.a1, group: undefined, isNew: false, isOffline: true, monitor: {}, tags: {} },
|
|
247
|
-
[defaultState.devices.byId.b1.id]: { ...defaultState.devices.byId.b1, group: undefined, isNew: false, isOffline: true, monitor: {}, tags: {} }
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
type: deviceActions.receivedDevices.type,
|
|
252
|
-
payload: {
|
|
253
|
-
[expectedDevice.id]: { ...defaultState.devices.byId.a1, group: undefined, isNew: false, isOffline: true, monitor: {}, tags: {} }
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
{ type: getDevicesWithAuth.fulfilled.type },
|
|
257
|
-
{ type: getDevicesWithAuth.fulfilled.type },
|
|
258
|
-
{
|
|
259
|
-
type: deviceActions.receivedDevices.type,
|
|
260
|
-
payload: {
|
|
261
|
-
[expectedDevice.id]: { ...receivedInventoryDevice, group: 'test' },
|
|
262
|
-
[defaultState.devices.byId.b1.id]: { ...receivedInventoryDevice, id: defaultState.devices.byId.b1.id, group: 'test' }
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
{ type: getDevicesWithAuth.pending.type },
|
|
266
|
-
{ type: getDevicesByStatus.fulfilled.type },
|
|
267
|
-
{ type: getDevicesByStatus.fulfilled.type },
|
|
268
|
-
{ type: userActions.setGlobalSettings.type, payload: { ...defaultState.users.globalSettings } },
|
|
269
|
-
{ type: setOfflineThreshold.pending.type },
|
|
270
|
-
{ type: appActions.setOfflineThreshold.type, payload: '2019-01-12T13:00:06.900Z' },
|
|
271
|
-
{ type: setOfflineThreshold.fulfilled.type },
|
|
272
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings } },
|
|
273
|
-
{ type: getGlobalSettings.fulfilled.type },
|
|
274
|
-
{ type: getUserSettings.fulfilled.type },
|
|
275
|
-
{ type: userActions.receivedPermissionSets.type, payload: receivedPermissionSets },
|
|
276
|
-
{ type: getPermissionSets.fulfilled.type },
|
|
277
|
-
{ type: userActions.receivedRoles.type, payload: receivedRoles },
|
|
278
|
-
{ type: getRoles.fulfilled.type },
|
|
279
|
-
{
|
|
280
|
-
type: deviceActions.receivedDevices.type,
|
|
281
|
-
payload: {
|
|
282
|
-
[defaultState.devices.byId.a1.id]: { ...defaultState.devices.byId.a1, group: undefined, isNew: false, isOffline: true, monitor: {}, tags: {} },
|
|
283
|
-
[defaultState.devices.byId.b1.id]: { ...defaultState.devices.byId.b1, group: undefined, isNew: false, isOffline: true, monitor: {}, tags: {} }
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
{ type: getDevicesWithAuth.fulfilled.type },
|
|
287
|
-
{ type: getDevicesByStatus.fulfilled.type },
|
|
288
|
-
{
|
|
289
|
-
type: deviceActions.addGroup.type,
|
|
290
|
-
payload: {
|
|
291
|
-
groupName: UNGROUPED_GROUP.id,
|
|
292
|
-
group: {
|
|
293
|
-
filters: [{ key: 'group', operator: '$nin', scope: 'system', value: [Object.keys(defaultState.devices.groups.byId)[0]] }]
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
{ type: getGroups.fulfilled.type },
|
|
298
|
-
{ type: deviceActions.setDeviceListState.type, payload: { selectedAttributes: [] } },
|
|
299
|
-
{ type: userActions.setTooltipsState.type, payload: {} },
|
|
300
|
-
{ type: saveUserSettings.pending.type },
|
|
301
|
-
{ type: getUserSettings.pending.type },
|
|
302
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings } },
|
|
303
|
-
{ type: getUserSettings.fulfilled.type },
|
|
304
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings, onboarding: defaultOnboardingState } },
|
|
305
|
-
{ type: saveUserSettings.fulfilled.type },
|
|
306
|
-
...expectedOnboardingActions
|
|
307
|
-
];
|
|
308
|
-
|
|
309
|
-
it('should try to get all required app information', async () => {
|
|
310
|
-
const store = mockStore({
|
|
311
|
-
...defaultState,
|
|
312
|
-
app: { ...defaultState.app, features: { ...defaultState.app.features, isHosted: true } },
|
|
313
|
-
users: {
|
|
314
|
-
...defaultState.users,
|
|
315
|
-
currentSession: getSessionInfo(),
|
|
316
|
-
globalSettings: { ...defaultState.users.globalSettings, id_attribute: { attribute: 'mac', scope: 'identity' } }
|
|
317
|
-
},
|
|
318
|
-
releases: { ...defaultState.releases, releasesList: { ...defaultState.releases.releasesList, page: 42 } }
|
|
319
|
-
});
|
|
320
|
-
const wrapper = ({ children }) => <Provider store={store}>{children}</Provider>;
|
|
321
|
-
renderHook(() => useAppInit(userId), { wrapper });
|
|
322
|
-
await act(async () => {
|
|
323
|
-
jest.runAllTimers();
|
|
324
|
-
jest.runAllTicks();
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
const storeActions = store.getActions();
|
|
328
|
-
expect(storeActions.length).toEqual(appInitActions.length);
|
|
329
|
-
appInitActions.map((action, index) => Object.keys(action).map(key => expect(storeActions[index][key]).toEqual(action[key])));
|
|
330
|
-
});
|
|
331
|
-
it('should execute the offline threshold migration for multi day thresholds', async () => {
|
|
332
|
-
const store = mockStore({
|
|
333
|
-
...defaultState,
|
|
334
|
-
app: { ...defaultState.app, features: { ...defaultState.app.features, isHosted: true } },
|
|
335
|
-
users: {
|
|
336
|
-
...defaultState.users,
|
|
337
|
-
currentSession: getSessionInfo(),
|
|
338
|
-
globalSettings: {
|
|
339
|
-
...defaultState.users.globalSettings,
|
|
340
|
-
id_attribute: { attribute: 'mac', scope: 'identity' },
|
|
341
|
-
offlineThreshold: { interval: 48, intervalUnit: timeUnits.hours }
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
releases: { ...defaultState.releases, releasesList: { ...defaultState.releases.releasesList, page: 42 } }
|
|
345
|
-
});
|
|
346
|
-
const wrapper = ({ children }) => <Provider store={store}>{children}</Provider>;
|
|
347
|
-
renderHook(() => useAppInit(userId), { wrapper });
|
|
348
|
-
await act(async () => {
|
|
349
|
-
jest.runAllTimers();
|
|
350
|
-
jest.runAllTicks();
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
const storeActions = store.getActions();
|
|
354
|
-
expect(storeActions.length).toEqual(appInitActions.length + 9); // 3 = get settings + set settings + set offline threshold
|
|
355
|
-
const settingStorageAction = storeActions.find(action => action.type === userActions.setGlobalSettings.type && action.payload.offlineThreshold);
|
|
356
|
-
expect(settingStorageAction.payload.offlineThreshold.interval).toEqual(2);
|
|
357
|
-
expect(settingStorageAction.payload.offlineThreshold.intervalUnit).toEqual(timeUnits.days);
|
|
358
|
-
});
|
|
359
|
-
it('should trigger the offline threshold migration dialog', async () => {
|
|
360
|
-
const store = mockStore({
|
|
361
|
-
...defaultState,
|
|
362
|
-
app: { ...defaultState.app, features: { ...defaultState.app.features, isHosted: true } },
|
|
363
|
-
users: {
|
|
364
|
-
...defaultState.users,
|
|
365
|
-
currentSession: getSessionInfo(),
|
|
366
|
-
globalSettings: {
|
|
367
|
-
...defaultState.users.globalSettings,
|
|
368
|
-
id_attribute: { attribute: 'mac', scope: 'identity' },
|
|
369
|
-
offlineThreshold: { interval: 15, intervalUnit: 'minutes' }
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
|
-
releases: { ...defaultState.releases, releasesList: { ...defaultState.releases.releasesList, page: 42 } }
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
const wrapper = ({ children }) => <Provider store={store}>{children}</Provider>;
|
|
376
|
-
renderHook(() => useAppInit(userId), { wrapper });
|
|
377
|
-
await jest.advanceTimersByTimeAsync(TIMEOUTS.fiveSeconds + TIMEOUTS.oneSecond);
|
|
378
|
-
await jest.runAllTimersAsync();
|
|
379
|
-
await act(async () => {
|
|
380
|
-
jest.runAllTicks();
|
|
381
|
-
});
|
|
382
|
-
const storeActions = store.getActions();
|
|
383
|
-
expect(storeActions.length).toEqual(appInitActions.length + 1); // only setShowStartupNotification should be addded
|
|
384
|
-
const notificationAction = storeActions.find(action => action.type === userActions.setShowStartupNotification.type);
|
|
385
|
-
expect(notificationAction.payload).toBeTruthy();
|
|
386
|
-
});
|
package/storehooks.ts
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 Northern.tech AS
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
// @ts-nocheck
|
|
15
|
-
import { useCallback, useEffect, useRef } from 'react';
|
|
16
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
17
|
-
|
|
18
|
-
import dayjs from 'dayjs';
|
|
19
|
-
import durationDayJs from 'dayjs/plugin/duration';
|
|
20
|
-
import Cookies from 'universal-cookie';
|
|
21
|
-
|
|
22
|
-
import storeActions from './actions';
|
|
23
|
-
import { getSessionInfo } from './auth';
|
|
24
|
-
import { DEPLOYMENT_STATES, DEVICE_STATES, TIMEOUTS, timeUnits } from './constants';
|
|
25
|
-
import {
|
|
26
|
-
getDevicesByStatus as getDevicesByStatusSelector,
|
|
27
|
-
getFeatures,
|
|
28
|
-
getGlobalSettings as getGlobalSettingsSelector,
|
|
29
|
-
getIsEnterprise,
|
|
30
|
-
getOfflineThresholdSettings,
|
|
31
|
-
getOnboardingState as getOnboardingStateSelector,
|
|
32
|
-
getSortedFilteringAttributes,
|
|
33
|
-
getUserCapabilities,
|
|
34
|
-
getUserSettings as getUserSettingsSelector
|
|
35
|
-
} from './selectors';
|
|
36
|
-
import {
|
|
37
|
-
getDeploymentsByStatus,
|
|
38
|
-
getDeviceAttributes,
|
|
39
|
-
getDeviceById,
|
|
40
|
-
getDeviceLimit,
|
|
41
|
-
getDevicesByStatus,
|
|
42
|
-
getDynamicGroups,
|
|
43
|
-
getGlobalSettings,
|
|
44
|
-
getGroups,
|
|
45
|
-
getIntegrations,
|
|
46
|
-
getLatestReleaseInfo,
|
|
47
|
-
getOnboardingState,
|
|
48
|
-
getReleases,
|
|
49
|
-
getRoles,
|
|
50
|
-
getUserOrganization,
|
|
51
|
-
getUserSettings,
|
|
52
|
-
saveGlobalSettings,
|
|
53
|
-
saveUserSettings
|
|
54
|
-
} from './thunks';
|
|
55
|
-
import { extractErrorMessage, getComparisonCompatibleVersion, stringToBoolean } from './utils';
|
|
56
|
-
|
|
57
|
-
const cookies = new Cookies();
|
|
58
|
-
dayjs.extend(durationDayJs);
|
|
59
|
-
|
|
60
|
-
const { setDeviceListState, setFirstLoginAfterSignup, setTooltipsState, setShowStartupNotification } = storeActions;
|
|
61
|
-
|
|
62
|
-
const featureFlags = [
|
|
63
|
-
'hasAuditlogs',
|
|
64
|
-
'hasMultitenancy',
|
|
65
|
-
'hasDeltaProgress',
|
|
66
|
-
'hasDeviceConfig',
|
|
67
|
-
'hasDeviceConnect',
|
|
68
|
-
'hasFeedbackEnabled',
|
|
69
|
-
'hasReporting',
|
|
70
|
-
'hasMonitor',
|
|
71
|
-
'isEnterprise'
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
const environmentDatas = ['feedbackProbability', 'hostAddress', 'hostedAnnouncement', 'recaptchaSiteKey', 'stripeAPIKey', 'trackerCode'];
|
|
75
|
-
|
|
76
|
-
export const parseEnvironmentInfo = () => (dispatch, getState) => {
|
|
77
|
-
const state = getState();
|
|
78
|
-
let onboardingComplete = state.onboarding.complete || !!JSON.parse(window.localStorage.getItem('onboardingComplete') ?? 'false');
|
|
79
|
-
let demoArtifactPort = 85;
|
|
80
|
-
let environmentData = {};
|
|
81
|
-
let environmentFeatures = {};
|
|
82
|
-
let versionInfo = {};
|
|
83
|
-
if (mender_environment) {
|
|
84
|
-
const {
|
|
85
|
-
features = {},
|
|
86
|
-
demoArtifactPort: port,
|
|
87
|
-
disableOnboarding,
|
|
88
|
-
integrationVersion,
|
|
89
|
-
isDemoMode,
|
|
90
|
-
menderVersion,
|
|
91
|
-
menderArtifactVersion,
|
|
92
|
-
metaMenderVersion,
|
|
93
|
-
services = {}
|
|
94
|
-
} = mender_environment;
|
|
95
|
-
onboardingComplete = stringToBoolean(features.isEnterprise) || stringToBoolean(disableOnboarding) || onboardingComplete;
|
|
96
|
-
demoArtifactPort = port || demoArtifactPort;
|
|
97
|
-
environmentData = environmentDatas.reduce((accu, flag) => ({ ...accu, [flag]: mender_environment[flag] || state.app[flag] }), {});
|
|
98
|
-
environmentFeatures = {
|
|
99
|
-
...featureFlags.reduce((accu, flag) => ({ ...accu, [flag]: stringToBoolean(features[flag]) }), {}),
|
|
100
|
-
isHosted: features.isHosted || window.location.hostname.includes('hosted.mender.io'),
|
|
101
|
-
isDemoMode: stringToBoolean(isDemoMode || features.isDemoMode)
|
|
102
|
-
};
|
|
103
|
-
versionInfo = {
|
|
104
|
-
docs: isNaN(integrationVersion.charAt(0)) ? '' : integrationVersion.split('.').slice(0, 2).join('.'),
|
|
105
|
-
remainder: {
|
|
106
|
-
Integration: getComparisonCompatibleVersion(integrationVersion),
|
|
107
|
-
'Mender-Client': getComparisonCompatibleVersion(menderVersion),
|
|
108
|
-
'Mender-Artifact': menderArtifactVersion,
|
|
109
|
-
'Meta-Mender': metaMenderVersion,
|
|
110
|
-
Deployments: services.deploymentsVersion,
|
|
111
|
-
Deviceauth: services.deviceauthVersion,
|
|
112
|
-
Inventory: services.inventoryVersion,
|
|
113
|
-
GUI: services.guiVersion
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
return Promise.all([
|
|
118
|
-
dispatch(storeActions.successfullyLoggedIn(getSessionInfo())),
|
|
119
|
-
dispatch(storeActions.setOnboardingComplete(onboardingComplete)),
|
|
120
|
-
dispatch(storeActions.setDemoArtifactPort(demoArtifactPort)),
|
|
121
|
-
dispatch(storeActions.setFeatures(environmentFeatures)),
|
|
122
|
-
dispatch(storeActions.setVersionInformation({ docsVersion: versionInfo.docs, value: versionInfo.remainder })),
|
|
123
|
-
dispatch(storeActions.setEnvironmentData(environmentData)),
|
|
124
|
-
dispatch(getLatestReleaseInfo())
|
|
125
|
-
]);
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const maybeAddOnboardingTasks = ({ devicesByStatus, dispatch, onboardingState, tasks }) => {
|
|
129
|
-
if (!onboardingState.showTips || onboardingState.complete) {
|
|
130
|
-
return tasks;
|
|
131
|
-
}
|
|
132
|
-
// try to retrieve full device details for onboarding devices to ensure ips etc. are available
|
|
133
|
-
// we only load the first few/ 20 devices, as it is possible the onboarding is left dangling
|
|
134
|
-
// and a lot of devices are present and we don't want to flood the backend for this
|
|
135
|
-
return devicesByStatus[DEVICE_STATES.accepted].deviceIds.reduce((accu, id) => {
|
|
136
|
-
accu.push(dispatch(getDeviceById(id)));
|
|
137
|
-
return accu;
|
|
138
|
-
}, tasks);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const useAppInit = userId => {
|
|
142
|
-
const dispatch = useDispatch();
|
|
143
|
-
const isEnterprise = useSelector(getIsEnterprise);
|
|
144
|
-
const { hasMultitenancy, isHosted } = useSelector(getFeatures);
|
|
145
|
-
const devicesByStatus = useSelector(getDevicesByStatusSelector);
|
|
146
|
-
const onboardingState = useSelector(getOnboardingStateSelector);
|
|
147
|
-
let { columnSelection = [], trackingConsentGiven: hasTrackingEnabled, tooltips = {} } = useSelector(getUserSettingsSelector);
|
|
148
|
-
const { canManageUsers } = useSelector(getUserCapabilities);
|
|
149
|
-
const { interval, intervalUnit } = useSelector(getOfflineThresholdSettings);
|
|
150
|
-
const { id_attribute } = useSelector(getGlobalSettingsSelector);
|
|
151
|
-
const { identityAttributes } = useSelector(getSortedFilteringAttributes);
|
|
152
|
-
const initRunning = useRef(false);
|
|
153
|
-
|
|
154
|
-
const retrieveAppData = useCallback(() => {
|
|
155
|
-
let tasks = [
|
|
156
|
-
dispatch(parseEnvironmentInfo()),
|
|
157
|
-
dispatch(getUserSettings()),
|
|
158
|
-
dispatch(getGlobalSettings()),
|
|
159
|
-
dispatch(getDeviceAttributes()),
|
|
160
|
-
dispatch(getDeploymentsByStatus({ status: DEPLOYMENT_STATES.finished, shouldSelect: false })),
|
|
161
|
-
dispatch(getDeploymentsByStatus({ status: DEPLOYMENT_STATES.inprogress })),
|
|
162
|
-
dispatch(getDevicesByStatus({ status: DEVICE_STATES.accepted })),
|
|
163
|
-
dispatch(getDevicesByStatus({ status: DEVICE_STATES.pending })),
|
|
164
|
-
dispatch(getDevicesByStatus({ status: DEVICE_STATES.preauth })),
|
|
165
|
-
dispatch(getDevicesByStatus({ status: DEVICE_STATES.rejected })),
|
|
166
|
-
dispatch(getDynamicGroups()),
|
|
167
|
-
dispatch(getGroups()),
|
|
168
|
-
dispatch(getIntegrations()),
|
|
169
|
-
dispatch(getReleases()),
|
|
170
|
-
dispatch(getDeviceLimit()),
|
|
171
|
-
dispatch(getRoles()),
|
|
172
|
-
dispatch(setFirstLoginAfterSignup(stringToBoolean(cookies.get('firstLoginAfterSignup'))))
|
|
173
|
-
];
|
|
174
|
-
const multitenancy = hasMultitenancy || isHosted || isEnterprise;
|
|
175
|
-
if (multitenancy) {
|
|
176
|
-
tasks.push(dispatch(getUserOrganization()));
|
|
177
|
-
}
|
|
178
|
-
return Promise.all(tasks);
|
|
179
|
-
}, [dispatch, hasMultitenancy, isHosted, isEnterprise]);
|
|
180
|
-
|
|
181
|
-
const interpretAppData = useCallback(() => {
|
|
182
|
-
let settings = {};
|
|
183
|
-
if (cookies.get('_ga') && typeof hasTrackingEnabled === 'undefined') {
|
|
184
|
-
settings.trackingConsentGiven = true;
|
|
185
|
-
}
|
|
186
|
-
let tasks = [
|
|
187
|
-
dispatch(setDeviceListState({ selectedAttributes: columnSelection.map(column => ({ attribute: column.key, scope: column.scope })) })),
|
|
188
|
-
dispatch(setTooltipsState(tooltips)), // tooltips read state is primarily trusted from the redux store, except on app init - here user settings are the reference
|
|
189
|
-
dispatch(saveUserSettings(settings))
|
|
190
|
-
];
|
|
191
|
-
// checks if user id is set and if cookie for helptips exists for that user
|
|
192
|
-
tasks = maybeAddOnboardingTasks({ devicesByStatus, dispatch, tasks, onboardingState });
|
|
193
|
-
|
|
194
|
-
if (canManageUsers && intervalUnit && intervalUnit !== timeUnits.days) {
|
|
195
|
-
const duration = dayjs.duration(interval, intervalUnit);
|
|
196
|
-
const days = duration.asDays();
|
|
197
|
-
if (days < 1) {
|
|
198
|
-
tasks.push(Promise.resolve(setTimeout(() => dispatch(setShowStartupNotification(true)), TIMEOUTS.fiveSeconds)));
|
|
199
|
-
} else {
|
|
200
|
-
const roundedDays = Math.max(1, Math.round(days));
|
|
201
|
-
tasks.push(dispatch(saveGlobalSettings({ offlineThreshold: { interval: roundedDays, intervalUnit: timeUnits.days } })));
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// the following is used as a migration and initialization of the stored identity attribute
|
|
206
|
-
// changing the default device attribute to the first non-deviceId attribute, unless a stored
|
|
207
|
-
// id attribute setting exists
|
|
208
|
-
const identityOptions = identityAttributes.filter(attribute => !['id', 'Device ID', 'status'].includes(attribute));
|
|
209
|
-
if (!id_attribute && identityOptions.length) {
|
|
210
|
-
tasks.push(dispatch(saveGlobalSettings({ id_attribute: { attribute: identityOptions[0], scope: 'identity' } })));
|
|
211
|
-
} else if (typeof id_attribute === 'string') {
|
|
212
|
-
let attribute = id_attribute;
|
|
213
|
-
if (attribute === 'Device ID') {
|
|
214
|
-
attribute = 'id';
|
|
215
|
-
}
|
|
216
|
-
tasks.push(dispatch(saveGlobalSettings({ id_attribute: { attribute, scope: 'identity' } })));
|
|
217
|
-
}
|
|
218
|
-
return Promise.all(tasks);
|
|
219
|
-
}, [
|
|
220
|
-
columnSelection,
|
|
221
|
-
dispatch,
|
|
222
|
-
identityAttributes,
|
|
223
|
-
hasTrackingEnabled,
|
|
224
|
-
canManageUsers,
|
|
225
|
-
devicesByStatus,
|
|
226
|
-
id_attribute,
|
|
227
|
-
interval,
|
|
228
|
-
intervalUnit,
|
|
229
|
-
onboardingState,
|
|
230
|
-
tooltips
|
|
231
|
-
]);
|
|
232
|
-
|
|
233
|
-
const initializeAppData = useCallback(
|
|
234
|
-
() =>
|
|
235
|
-
retrieveAppData()
|
|
236
|
-
.then(interpretAppData)
|
|
237
|
-
// this is allowed to fail if no user information are available
|
|
238
|
-
.catch(err => console.log(extractErrorMessage(err)))
|
|
239
|
-
.then(() => dispatch(getOnboardingState())),
|
|
240
|
-
[dispatch, retrieveAppData, interpretAppData]
|
|
241
|
-
);
|
|
242
|
-
|
|
243
|
-
useEffect(() => {
|
|
244
|
-
if (!userId || initRunning.current) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
initRunning.current = true;
|
|
248
|
-
initializeAppData();
|
|
249
|
-
}, [userId, initializeAppData]);
|
|
250
|
-
};
|
package/thunks.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 Northern.tech AS
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
export * from './appSlice/thunks';
|
|
15
|
-
export * from './deploymentsSlice/thunks';
|
|
16
|
-
export * from './devicesSlice/thunks';
|
|
17
|
-
export * from './monitorSlice/thunks';
|
|
18
|
-
export * from './onboardingSlice/thunks';
|
|
19
|
-
export * from './organizationSlice/thunks';
|
|
20
|
-
export * from './releasesSlice/thunks';
|
|
21
|
-
export * from './usersSlice/thunks';
|
package/tsconfig.json
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup';
|
|
2
|
-
|
|
3
|
-
import { peerDependencies } from './package.json';
|
|
4
|
-
|
|
5
|
-
export default defineConfig(options => ({
|
|
6
|
-
format: ['cjs', 'esm'],
|
|
7
|
-
dts: true,
|
|
8
|
-
sourcemap: true,
|
|
9
|
-
external: [...Object.keys(peerDependencies)],
|
|
10
|
-
...options
|
|
11
|
-
}));
|