@northern.tech/store 0.1.1 → 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 +22 -5
- package/.eslintrc.cjs +0 -9
- package/.prettierignore +0 -1
- package/CHANGELOG.md +0 -19
- 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 -773
- 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
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 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
|
-
import { apiUrl } from '@northern.tech/store/constants';
|
|
14
|
-
|
|
15
|
-
// limitations under the License.
|
|
16
|
-
export const alertChannels = { email: 'email' };
|
|
17
|
-
export const monitorApiUrlv1 = `${apiUrl.v1}/devicemonitor`;
|
package/monitorSlice/index.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 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
|
-
import { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS } from '@northern.tech/store/commonConstants';
|
|
15
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
16
|
-
|
|
17
|
-
import { alertChannels } from './constants';
|
|
18
|
-
|
|
19
|
-
export const sliceName = 'monitor';
|
|
20
|
-
|
|
21
|
-
export const initialState = {
|
|
22
|
-
alerts: {
|
|
23
|
-
alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },
|
|
24
|
-
byDeviceId: {}
|
|
25
|
-
},
|
|
26
|
-
issueCounts: {
|
|
27
|
-
byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {})
|
|
28
|
-
},
|
|
29
|
-
settings: {
|
|
30
|
-
global: {
|
|
31
|
-
channels: {
|
|
32
|
-
...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {})
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const monitorSlice = createSlice({
|
|
39
|
-
name: sliceName,
|
|
40
|
-
initialState,
|
|
41
|
-
reducers: {
|
|
42
|
-
changeAlertChannel: (state, action) => {
|
|
43
|
-
const { channel, enabled } = action.payload;
|
|
44
|
-
state.settings.global.channels[channel] = { enabled };
|
|
45
|
-
},
|
|
46
|
-
receiveDeviceAlerts: (state, action) => {
|
|
47
|
-
const { deviceId, alerts } = action.payload;
|
|
48
|
-
state.alerts.byDeviceId[deviceId] = { alerts };
|
|
49
|
-
},
|
|
50
|
-
receiveLatestDeviceAlerts: (state, action) => {
|
|
51
|
-
const { deviceId, alerts } = action.payload;
|
|
52
|
-
state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };
|
|
53
|
-
},
|
|
54
|
-
receiveDeviceIssueCounts: (state, action) => {
|
|
55
|
-
const { issueType, counts } = action.payload;
|
|
56
|
-
state.issueCounts.byType[issueType] = counts;
|
|
57
|
-
},
|
|
58
|
-
setAlertListState: (state, action) => {
|
|
59
|
-
state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
export const actions = monitorSlice.actions;
|
|
65
|
-
export default monitorSlice.reducer;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 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 reducer, { actions, initialState } from '.';
|
|
16
|
-
import { defaultState } from '../../../../tests/mockData';
|
|
17
|
-
import { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS } from '../constants';
|
|
18
|
-
import { alertChannels } from './constants';
|
|
19
|
-
|
|
20
|
-
describe('monitor reducer', () => {
|
|
21
|
-
it('should return the initial state', async () => {
|
|
22
|
-
expect(reducer(undefined, {})).toEqual(initialState);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should handle CHANGE_ALERT_CHANNEL', async () => {
|
|
26
|
-
expect(
|
|
27
|
-
reducer(undefined, { type: actions.changeAlertChannel, payload: { channel: alertChannels.email, enabled: false } }).settings.global.channels[
|
|
28
|
-
alertChannels.email
|
|
29
|
-
].enabled
|
|
30
|
-
).toEqual(false);
|
|
31
|
-
expect(
|
|
32
|
-
reducer(initialState, { type: actions.changeAlertChannel, payload: { channel: alertChannels.email, enabled: true } }).settings.global.channels[
|
|
33
|
-
alertChannels.email
|
|
34
|
-
].enabled
|
|
35
|
-
).toEqual(true);
|
|
36
|
-
});
|
|
37
|
-
it('should handle RECEIVE_DEVICE_ALERTS', async () => {
|
|
38
|
-
expect(
|
|
39
|
-
reducer(undefined, { type: actions.receiveDeviceAlerts, payload: { deviceId: defaultState.devices.byId.a1.id, alerts: [] } }).alerts.byDeviceId[
|
|
40
|
-
defaultState.devices.byId.a1.id
|
|
41
|
-
].alerts
|
|
42
|
-
).toEqual([]);
|
|
43
|
-
expect(
|
|
44
|
-
reducer(initialState, { type: actions.receiveDeviceAlerts, payload: { deviceId: defaultState.devices.byId.a1.id, alerts: [123, 456] } }).alerts
|
|
45
|
-
.byDeviceId[defaultState.devices.byId.a1.id].alerts
|
|
46
|
-
).toEqual([123, 456]);
|
|
47
|
-
});
|
|
48
|
-
it('should handle RECEIVE_LATEST_DEVICE_ALERTS', async () => {
|
|
49
|
-
expect(
|
|
50
|
-
reducer(undefined, { type: actions.receiveLatestDeviceAlerts, payload: { deviceId: defaultState.devices.byId.a1.id, alerts: [] } }).alerts.byDeviceId[
|
|
51
|
-
defaultState.devices.byId.a1.id
|
|
52
|
-
].latest
|
|
53
|
-
).toEqual([]);
|
|
54
|
-
expect(
|
|
55
|
-
reducer(initialState, { type: actions.receiveLatestDeviceAlerts, payload: { deviceId: defaultState.devices.byId.a1.id, alerts: [123, 456] } }).alerts
|
|
56
|
-
.byDeviceId[defaultState.devices.byId.a1.id].latest
|
|
57
|
-
).toEqual([123, 456]);
|
|
58
|
-
});
|
|
59
|
-
it('should handle RECEIVE_DEVICE_ISSUE_COUNTS', async () => {
|
|
60
|
-
expect(
|
|
61
|
-
reducer(undefined, {
|
|
62
|
-
type: actions.receiveDeviceIssueCounts,
|
|
63
|
-
payload: { issueType: DEVICE_ISSUE_OPTIONS.monitoring.key, counts: { filtered: 1, total: 3 } }
|
|
64
|
-
}).issueCounts.byType[DEVICE_ISSUE_OPTIONS.monitoring.key]
|
|
65
|
-
).toEqual({ filtered: 1, total: 3 });
|
|
66
|
-
expect(
|
|
67
|
-
reducer(initialState, { type: actions.receiveDeviceIssueCounts, payload: { issueType: DEVICE_ISSUE_OPTIONS.monitoring.key, counts: { total: 3 } } })
|
|
68
|
-
.issueCounts.byType[DEVICE_ISSUE_OPTIONS.monitoring.key]
|
|
69
|
-
).toEqual({ total: 3 });
|
|
70
|
-
});
|
|
71
|
-
it('should handle SET_ALERT_LIST_STATE', async () => {
|
|
72
|
-
expect(reducer(undefined, { type: actions.setAlertListState, payload: { total: 3 } }).alerts.alertList).toEqual({ ...DEVICE_LIST_DEFAULTS, total: 3 });
|
|
73
|
-
expect(reducer(initialState, { type: actions.setAlertListState, payload: { something: 'something' } }).alerts.alertList).toEqual({
|
|
74
|
-
...DEVICE_LIST_DEFAULTS,
|
|
75
|
-
total: 0,
|
|
76
|
-
something: 'something'
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 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
|
-
|
|
15
|
-
export const getIssueCountsByType = state => state.monitor.issueCounts.byType;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 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 { DEVICE_ISSUE_OPTIONS } from '@northern.tech/store/commonConstants';
|
|
16
|
-
import configureMockStore from 'redux-mock-store';
|
|
17
|
-
import { thunk } from 'redux-thunk';
|
|
18
|
-
|
|
19
|
-
import { actions } from '.';
|
|
20
|
-
import { defaultState } from '../../../../tests/mockData';
|
|
21
|
-
import { actions as appActions } from '../appSlice';
|
|
22
|
-
import { actions as deviceActions } from '../devicesSlice';
|
|
23
|
-
import { changeNotificationSetting, getDeviceAlerts, getDeviceMonitorConfig, getIssueCountsByType, getLatestDeviceAlerts } from './thunks';
|
|
24
|
-
|
|
25
|
-
const middlewares = [thunk];
|
|
26
|
-
const mockStore = configureMockStore(middlewares);
|
|
27
|
-
|
|
28
|
-
/* eslint-disable sonarjs/no-identical-functions */
|
|
29
|
-
describe('monitor actions', () => {
|
|
30
|
-
it('should handle device based alert retrieval', async () => {
|
|
31
|
-
const store = mockStore({ ...defaultState });
|
|
32
|
-
expect(store.getActions()).toHaveLength(0);
|
|
33
|
-
const expectedActions = [
|
|
34
|
-
{ type: getDeviceAlerts.pending.type },
|
|
35
|
-
{ type: actions.receiveDeviceAlerts.type, payload: { deviceId: defaultState.devices.byId.a1.id, alerts: [] } },
|
|
36
|
-
{ type: actions.setAlertListState.type, payload: { total: 1 } },
|
|
37
|
-
{ type: getDeviceAlerts.fulfilled.type }
|
|
38
|
-
];
|
|
39
|
-
const request = store.dispatch(getDeviceAlerts({ id: defaultState.devices.byId.a1.id }));
|
|
40
|
-
expect(request).resolves.toBeTruthy();
|
|
41
|
-
await request.then(() => {
|
|
42
|
-
const storeActions = store.getActions();
|
|
43
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
44
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
it('should handle device based latest alert retrieval', async () => {
|
|
48
|
-
const store = mockStore({ ...defaultState });
|
|
49
|
-
expect(store.getActions()).toHaveLength(0);
|
|
50
|
-
const expectedActions = [
|
|
51
|
-
{ type: getLatestDeviceAlerts.pending.type },
|
|
52
|
-
{ type: actions.receiveLatestDeviceAlerts.type, payload: { deviceId: defaultState.devices.byId.a1.id, alerts: [] } },
|
|
53
|
-
{ type: getLatestDeviceAlerts.fulfilled.type }
|
|
54
|
-
];
|
|
55
|
-
const request = store.dispatch(getLatestDeviceAlerts({ id: defaultState.devices.byId.a1.id }));
|
|
56
|
-
expect(request).resolves.toBeTruthy();
|
|
57
|
-
await request.then(() => {
|
|
58
|
-
const storeActions = store.getActions();
|
|
59
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
60
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
it('should handle device issue count retrieval', async () => {
|
|
64
|
-
const store = mockStore({ ...defaultState });
|
|
65
|
-
expect(store.getActions()).toHaveLength(0);
|
|
66
|
-
const expectedActions = [
|
|
67
|
-
{ type: getIssueCountsByType.pending.type },
|
|
68
|
-
{ type: actions.receiveDeviceIssueCounts.type, payload: { issueType: DEVICE_ISSUE_OPTIONS.monitoring.key, counts: { filtered: 4, total: 4 } } },
|
|
69
|
-
{ type: getIssueCountsByType.fulfilled.type }
|
|
70
|
-
];
|
|
71
|
-
const request = store.dispatch(getIssueCountsByType({ type: DEVICE_ISSUE_OPTIONS.monitoring.key }));
|
|
72
|
-
expect(request).resolves.toBeTruthy();
|
|
73
|
-
await request.then(() => {
|
|
74
|
-
const storeActions = store.getActions();
|
|
75
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
76
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
it('should handle device monitor config retrieval', async () => {
|
|
80
|
-
const store = mockStore({ ...defaultState });
|
|
81
|
-
expect(store.getActions()).toHaveLength(0);
|
|
82
|
-
const expectedActions = [
|
|
83
|
-
{ type: getDeviceMonitorConfig.pending.type },
|
|
84
|
-
{ type: deviceActions.receivedDevice.type, payload: { id: defaultState.devices.byId.a1.id, monitors: [{ something: 'here' }] } },
|
|
85
|
-
{ type: getDeviceMonitorConfig.fulfilled.type }
|
|
86
|
-
];
|
|
87
|
-
const request = store.dispatch(getDeviceMonitorConfig(defaultState.devices.byId.a1.id));
|
|
88
|
-
expect(request).resolves.toBeTruthy();
|
|
89
|
-
await request.then(() => {
|
|
90
|
-
const storeActions = store.getActions();
|
|
91
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
92
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
it('should handle changes to alert notification settings', async () => {
|
|
96
|
-
const store = mockStore({ ...defaultState });
|
|
97
|
-
expect(store.getActions()).toHaveLength(0);
|
|
98
|
-
const expectedActions = [
|
|
99
|
-
{ type: changeNotificationSetting.pending.type },
|
|
100
|
-
{ type: actions.changeAlertChannel.type, payload: { channel: 'email', enabled: false } },
|
|
101
|
-
{ type: appActions.setSnackbar.type, payload: 'Successfully disabled email alerts' },
|
|
102
|
-
{ type: changeNotificationSetting.fulfilled.type }
|
|
103
|
-
];
|
|
104
|
-
const request = store.dispatch(changeNotificationSetting({ enabled: false }));
|
|
105
|
-
expect(request).resolves.toBeTruthy();
|
|
106
|
-
await request.then(() => {
|
|
107
|
-
const storeActions = store.getActions();
|
|
108
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
109
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
});
|
package/monitorSlice/thunks.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 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 storeActions from '@northern.tech/store/actions';
|
|
16
|
-
import Api from '@northern.tech/store/api/general-api';
|
|
17
|
-
import { DEVICE_LIST_DEFAULTS, TIMEOUTS, alertChannels, headerNames } from '@northern.tech/store/constants';
|
|
18
|
-
import { getDeviceFilters, getSearchEndpoint } from '@northern.tech/store/selectors';
|
|
19
|
-
import { commonErrorFallback, commonErrorHandler } from '@northern.tech/store/store';
|
|
20
|
-
import { convertDeviceListStateToFilters } from '@northern.tech/store/utils';
|
|
21
|
-
import { createAsyncThunk } from '@reduxjs/toolkit';
|
|
22
|
-
|
|
23
|
-
import { actions, sliceName } from '.';
|
|
24
|
-
import { monitorApiUrlv1 } from './constants';
|
|
25
|
-
|
|
26
|
-
const { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;
|
|
27
|
-
|
|
28
|
-
const cutoffLength = 75;
|
|
29
|
-
const ellipsis = '...';
|
|
30
|
-
const longTextTrimmer = text => (text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text);
|
|
31
|
-
|
|
32
|
-
const sanitizeDeviceAlerts = alerts => alerts.map(alert => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name) }));
|
|
33
|
-
|
|
34
|
-
export const getDeviceAlerts = createAsyncThunk(`${sliceName}/getDeviceAlerts`, ({ id, config = {} }, { dispatch }) => {
|
|
35
|
-
const { page = defaultPage, perPage = defaultPerPage, issuedBefore, issuedAfter, sortAscending = false } = config;
|
|
36
|
-
const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : '';
|
|
37
|
-
const issued_before = issuedBefore ? `&issued_before=${issuedBefore}` : '';
|
|
38
|
-
return Api.get(`${monitorApiUrlv1}/devices/${id}/alerts?page=${page}&per_page=${perPage}${issued_after}${issued_before}&sort_ascending=${sortAscending}`)
|
|
39
|
-
.catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))
|
|
40
|
-
.then(res =>
|
|
41
|
-
Promise.all([
|
|
42
|
-
dispatch(actions.receiveDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) })),
|
|
43
|
-
dispatch(actions.setAlertListState({ total: Number(res.headers[headerNames.total]) }))
|
|
44
|
-
])
|
|
45
|
-
);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export const getLatestDeviceAlerts = createAsyncThunk(`${sliceName}/getLatestDeviceAlerts`, ({ id, config = {} }, { dispatch }) => {
|
|
49
|
-
const { page = defaultPage, perPage = 10 } = config;
|
|
50
|
-
return Api.get(`${monitorApiUrlv1}/devices/${id}/alerts/latest?page=${page}&per_page=${perPage}`)
|
|
51
|
-
.catch(err => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch))
|
|
52
|
-
.then(res => Promise.resolve(dispatch(actions.receiveLatestDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) }))));
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export const getIssueCountsByType = createAsyncThunk(`${sliceName}/getIssueCountsByType`, ({ type, options = {} }, { dispatch, getState }) => {
|
|
56
|
-
const state = getState();
|
|
57
|
-
const { filters = getDeviceFilters(state), group, status, ...remainder } = options;
|
|
58
|
-
const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({
|
|
59
|
-
...remainder,
|
|
60
|
-
filters,
|
|
61
|
-
group,
|
|
62
|
-
offlineThreshold: state.app.offlineThreshold,
|
|
63
|
-
selectedIssues: [type],
|
|
64
|
-
status
|
|
65
|
-
});
|
|
66
|
-
return Api.post(getSearchEndpoint(getState()), {
|
|
67
|
-
page: 1,
|
|
68
|
-
per_page: 1,
|
|
69
|
-
filters: filterTerms,
|
|
70
|
-
attributes: [{ scope: 'identity', attribute: 'status' }]
|
|
71
|
-
})
|
|
72
|
-
.catch(err => commonErrorHandler(err, `Retrieving issue counts failed:`, dispatch, commonErrorFallback))
|
|
73
|
-
.then(res => {
|
|
74
|
-
const total = nonMonitorFilters.length ? state.monitor.issueCounts.byType[type].total : Number(res.headers[headerNames.total]);
|
|
75
|
-
const filtered = nonMonitorFilters.length ? Number(res.headers[headerNames.total]) : total;
|
|
76
|
-
if (total === state.monitor.issueCounts.byType[type].total && filtered === state.monitor.issueCounts.byType[type].filtered) {
|
|
77
|
-
return Promise.resolve();
|
|
78
|
-
}
|
|
79
|
-
return Promise.resolve(dispatch(actions.receiveDeviceIssueCounts({ counts: { filtered, total }, issueType: type })));
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
export const getDeviceMonitorConfig = createAsyncThunk(`${sliceName}/getDeviceMonitorConfig`, (id, { dispatch }) =>
|
|
84
|
-
Api.get(`${monitorApiUrlv1}/devices/${id}/config`)
|
|
85
|
-
.catch(err => commonErrorHandler(err, `Retrieving device monitor config for device ${id} failed:`, dispatch))
|
|
86
|
-
.then(({ data }) => Promise.all([dispatch(storeActions.receivedDevice({ id, monitors: data }), Promise.resolve(data))]))
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
export const changeNotificationSetting = createAsyncThunk(
|
|
90
|
-
`${sliceName}/changeNotificationSetting`,
|
|
91
|
-
({ enabled, channel = alertChannels.email }, { dispatch }) => {
|
|
92
|
-
return Api.put(`${monitorApiUrlv1}/settings/global/channel/alerts/${channel}/status`, { enabled })
|
|
93
|
-
.catch(err => commonErrorHandler(err, `${enabled ? 'En' : 'Dis'}abling ${channel} alerts failed:`, dispatch))
|
|
94
|
-
.then(() =>
|
|
95
|
-
Promise.all([
|
|
96
|
-
dispatch(actions.changeAlertChannel({ channel, enabled })),
|
|
97
|
-
dispatch(storeActions.setSnackbar(`Successfully ${enabled ? 'en' : 'dis'}abled ${channel} alerts`, TIMEOUTS.fiveSeconds))
|
|
98
|
-
])
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
);
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 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 const onboardingSteps = {
|
|
15
|
-
ONBOARDING_START: 'onboarding-start',
|
|
16
|
-
DEVICES_PENDING_ONBOARDING_START: 'devices-pending-onboarding-start',
|
|
17
|
-
DASHBOARD_ONBOARDING_START: 'dashboard-onboarding-start',
|
|
18
|
-
DASHBOARD_ONBOARDING_PENDINGS: 'dashboard-onboarding-pendings',
|
|
19
|
-
DEVICES_DELAYED_ONBOARDING: 'devices-delayed-onboarding',
|
|
20
|
-
DEVICES_PENDING_ONBOARDING: 'devices-pending-onboarding',
|
|
21
|
-
DEVICES_ACCEPTED_ONBOARDING: 'devices-accepted-onboarding',
|
|
22
|
-
DEVICES_PENDING_ACCEPTING_ONBOARDING: 'devices-pending-accepting-onboarding',
|
|
23
|
-
DEVICES_DEPLOY_RELEASE_ONBOARDING: 'devices-deploy-release-onboarding',
|
|
24
|
-
SCHEDULING_ARTIFACT_SELECTION: 'scheduling-artifact-selection',
|
|
25
|
-
SCHEDULING_ALL_DEVICES_SELECTION: 'scheduling-all-devices-selection',
|
|
26
|
-
SCHEDULING_GROUP_SELECTION: 'scheduling-group-selection',
|
|
27
|
-
SCHEDULING_RELEASE_TO_DEVICES: 'scheduling-release-to-devices',
|
|
28
|
-
DEPLOYMENTS_INPROGRESS: 'deployments-inprogress',
|
|
29
|
-
DEPLOYMENTS_PAST: 'deployments-past',
|
|
30
|
-
DEPLOYMENTS_PAST_COMPLETED: 'deployments-past-completed',
|
|
31
|
-
DEPLOYMENTS_PAST_COMPLETED_FAILURE: 'deployments-past-completed-failure',
|
|
32
|
-
ONBOARDING_CANCELED: 'onboarding-canceled'
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const orderedOnboardingSteps = [
|
|
36
|
-
onboardingSteps.DASHBOARD_ONBOARDING_START,
|
|
37
|
-
onboardingSteps.DEVICES_PENDING_ONBOARDING_START,
|
|
38
|
-
onboardingSteps.DEVICES_DELAYED_ONBOARDING,
|
|
39
|
-
onboardingSteps.DEVICES_PENDING_ONBOARDING,
|
|
40
|
-
onboardingSteps.DEVICES_PENDING_ACCEPTING_ONBOARDING,
|
|
41
|
-
onboardingSteps.DASHBOARD_ONBOARDING_PENDINGS,
|
|
42
|
-
onboardingSteps.DEVICES_ACCEPTED_ONBOARDING,
|
|
43
|
-
onboardingSteps.DEVICES_DEPLOY_RELEASE_ONBOARDING,
|
|
44
|
-
onboardingSteps.SCHEDULING_ALL_DEVICES_SELECTION,
|
|
45
|
-
onboardingSteps.SCHEDULING_GROUP_SELECTION,
|
|
46
|
-
onboardingSteps.SCHEDULING_ARTIFACT_SELECTION,
|
|
47
|
-
onboardingSteps.SCHEDULING_RELEASE_TO_DEVICES,
|
|
48
|
-
onboardingSteps.DEPLOYMENTS_INPROGRESS,
|
|
49
|
-
onboardingSteps.DEPLOYMENTS_PAST,
|
|
50
|
-
onboardingSteps.DEPLOYMENTS_PAST_COMPLETED,
|
|
51
|
-
onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE,
|
|
52
|
-
onboardingSteps.ONBOARDING_CANCELED
|
|
53
|
-
];
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 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 reducer, { actions, initialState } from '.';
|
|
16
|
-
|
|
17
|
-
describe('organization reducer', () => {
|
|
18
|
-
it('should return the initial state', async () => {
|
|
19
|
-
expect(reducer(undefined, {})).toEqual(initialState);
|
|
20
|
-
});
|
|
21
|
-
it('should handle SET_SHOW_ONBOARDING_HELP', async () => {
|
|
22
|
-
expect(reducer(undefined, { type: actions.setShowOnboardingHelp, payload: true }).showTips).toEqual(true);
|
|
23
|
-
expect(reducer(initialState, { type: actions.setShowOnboardingHelp, payload: false }).showTips).toEqual(false);
|
|
24
|
-
});
|
|
25
|
-
it('should handle SET_SHOW_ONBOARDING_HELP_DIALOG', async () => {
|
|
26
|
-
expect(reducer(undefined, { type: actions.setShowDismissOnboardingTipsDialog, payload: true }).showTipsDialog).toEqual(true);
|
|
27
|
-
expect(reducer(initialState, { type: actions.setShowDismissOnboardingTipsDialog, payload: false }).showTipsDialog).toEqual(false);
|
|
28
|
-
});
|
|
29
|
-
it('should handle SET_ONBOARDING_COMPLETE', async () => {
|
|
30
|
-
expect(reducer(undefined, { type: actions.setOnboardingComplete, payload: true }).complete).toEqual(true);
|
|
31
|
-
expect(reducer(initialState, { type: actions.setOnboardingComplete, payload: false }).complete).toEqual(false);
|
|
32
|
-
});
|
|
33
|
-
it('should handle SET_ONBOARDING_PROGRESS', async () => {
|
|
34
|
-
expect(reducer(undefined, { type: actions.setOnboardingProgress, payload: 'test' }).progress).toEqual('test');
|
|
35
|
-
expect(reducer(initialState, { type: actions.setOnboardingProgress, payload: 'test' }).progress).toEqual('test');
|
|
36
|
-
});
|
|
37
|
-
it('should handle SET_ONBOARDING_DEVICE_TYPE', async () => {
|
|
38
|
-
expect(reducer(undefined, { type: actions.setOnboardingDeviceType, payload: 'bbb' }).deviceType).toEqual('bbb');
|
|
39
|
-
expect(reducer(initialState, { type: actions.setOnboardingDeviceType, payload: 'rpi4' }).deviceType).toEqual('rpi4');
|
|
40
|
-
});
|
|
41
|
-
it('should handle SET_ONBOARDING_APPROACH', async () => {
|
|
42
|
-
expect(reducer(undefined, { type: actions.setOnboardingApproach, payload: 'physical' }).approach).toEqual('physical');
|
|
43
|
-
expect(reducer(initialState, { type: actions.setOnboardingApproach, payload: 'virtual' }).approach).toEqual('virtual');
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 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
|
-
|
|
15
|
-
export const getOnboarding = state => state.onboarding;
|