@northern.tech/store 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.d.mts +95 -0
- package/dist/actions.d.ts +95 -0
- package/dist/actions.js +1808 -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 +1066 -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 +1090 -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 +1131 -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 +5733 -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 +1049 -0
- package/dist/auth.js.map +1 -0
- package/dist/auth.mjs +23 -0
- package/dist/auth.mjs.map +1 -0
- package/dist/chunk-2HCZYULZ.mjs +56 -0
- package/dist/chunk-2HCZYULZ.mjs.map +1 -0
- package/dist/chunk-2P4VECEE.mjs +57 -0
- package/dist/chunk-2P4VECEE.mjs.map +1 -0
- package/dist/chunk-4C6IY46N.mjs +75 -0
- package/dist/chunk-4C6IY46N.mjs.map +1 -0
- package/dist/chunk-4U4X4KAC.mjs +70 -0
- package/dist/chunk-4U4X4KAC.mjs.map +1 -0
- package/dist/chunk-BOSBROA3.mjs +168 -0
- package/dist/chunk-BOSBROA3.mjs.map +1 -0
- package/dist/chunk-BWFTQHNM.mjs +55 -0
- package/dist/chunk-BWFTQHNM.mjs.map +1 -0
- package/dist/chunk-C2YZYTJ6.mjs +37 -0
- package/dist/chunk-C2YZYTJ6.mjs.map +1 -0
- package/{usersSlice/index.ts → dist/chunk-EFHEROXZ.mjs} +39 -58
- package/dist/chunk-EFHEROXZ.mjs.map +1 -0
- package/dist/chunk-EM2HUGUY.mjs +135 -0
- package/dist/chunk-EM2HUGUY.mjs.map +1 -0
- package/dist/chunk-ENLZPHTQ.mjs +35 -0
- package/dist/chunk-ENLZPHTQ.mjs.map +1 -0
- package/dist/chunk-G4FGNSV3.mjs +13 -0
- package/dist/chunk-G4FGNSV3.mjs.map +1 -0
- package/dist/chunk-H2PQQMRY.mjs +7 -0
- package/dist/chunk-H2PQQMRY.mjs.map +1 -0
- package/dist/chunk-IU4OXOPA.mjs +46 -0
- package/dist/chunk-IU4OXOPA.mjs.map +1 -0
- package/dist/chunk-L4HIW3KB.mjs +36 -0
- package/dist/chunk-L4HIW3KB.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-MJW4632R.mjs +110 -0
- package/dist/chunk-MJW4632R.mjs.map +1 -0
- package/dist/chunk-MQIKQKSW.mjs +717 -0
- package/dist/chunk-MQIKQKSW.mjs.map +1 -0
- package/{releasesSlice/index.ts → dist/chunk-NCI6JV5R.mjs} +33 -32
- package/dist/chunk-NCI6JV5R.mjs.map +1 -0
- package/dist/chunk-OGAMVFPS.mjs +244 -0
- package/dist/chunk-OGAMVFPS.mjs.map +1 -0
- package/{appSlice/index.ts → dist/chunk-OWHFMKTA.mjs} +58 -68
- package/dist/chunk-OWHFMKTA.mjs.map +1 -0
- package/dist/chunk-QBKCUIWO.mjs +7 -0
- package/dist/chunk-QBKCUIWO.mjs.map +1 -0
- package/dist/chunk-QG4PT5WK.mjs +145 -0
- package/dist/chunk-QG4PT5WK.mjs.map +1 -0
- package/dist/chunk-RWYS5MKN.mjs +106 -0
- package/dist/chunk-RWYS5MKN.mjs.map +1 -0
- package/dist/chunk-U6YTBIDT.mjs +239 -0
- package/dist/chunk-U6YTBIDT.mjs.map +1 -0
- package/dist/chunk-UPMSYTWW.mjs +2977 -0
- package/dist/chunk-UPMSYTWW.mjs.map +1 -0
- package/dist/chunk-V32GTKOS.mjs +1 -0
- package/dist/chunk-V32GTKOS.mjs.map +1 -0
- package/dist/chunk-WS3YYLTJ.mjs +106 -0
- package/dist/chunk-WS3YYLTJ.mjs.map +1 -0
- package/{devicesSlice/index.ts → dist/chunk-X65NMDPS.mjs} +57 -77
- package/dist/chunk-X65NMDPS.mjs.map +1 -0
- package/dist/chunk-XJNI62IP.mjs +39 -0
- package/dist/chunk-XJNI62IP.mjs.map +1 -0
- package/dist/chunk-XWBD7VOK.mjs +93 -0
- package/dist/chunk-XWBD7VOK.mjs.map +1 -0
- package/dist/chunk-Y47SYXII.mjs +304 -0
- package/dist/chunk-Y47SYXII.mjs.map +1 -0
- package/dist/chunk-ZLRZO4EY.mjs +414 -0
- package/dist/chunk-ZLRZO4EY.mjs.map +1 -0
- package/dist/chunk-ZZ6VIQ3U.mjs +65 -0
- package/dist/chunk-ZZ6VIQ3U.mjs.map +1 -0
- package/dist/commonConstants.d.mts +247 -0
- package/dist/commonConstants.d.ts +247 -0
- package/dist/commonConstants.js +304 -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 +937 -0
- package/dist/commonSelectors.d.ts +937 -0
- package/dist/commonSelectors.js +1564 -0
- package/dist/commonSelectors.js.map +1 -0
- package/dist/commonSelectors.mjs +56 -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 +1308 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +223 -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 +1033 -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 +1117 -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 +1033 -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 +5749 -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 +1033 -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 +1173 -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 +1148 -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 +5821 -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 +983 -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 +1035 -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 +2609 -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 +5739 -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 +139 -0
- package/dist/organizationSlice/constants.d.ts +139 -0
- package/dist/organizationSlice/constants.js +1038 -0
- package/dist/organizationSlice/constants.js.map +1 -0
- package/dist/organizationSlice/constants.mjs +36 -0
- package/dist/organizationSlice/constants.mjs.map +1 -0
- package/dist/organizationSlice/index.d.mts +1075 -0
- package/dist/organizationSlice/index.d.ts +1075 -0
- package/dist/organizationSlice/index.js +1077 -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 +1041 -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 +5787 -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 +1098 -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 +1031 -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 +2921 -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 +1718 -0
- package/dist/selectors.js.map +1 -0
- package/dist/selectors.mjs +209 -0
- package/dist/selectors.mjs.map +1 -0
- package/dist/store.d.mts +2406 -0
- package/dist/store.d.ts +2406 -0
- package/dist/store.js +1939 -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 +6 -0
- package/dist/storehooks.d.ts +6 -0
- package/dist/storehooks.js +5940 -0
- package/dist/storehooks.js.map +1 -0
- package/dist/storehooks.mjs +285 -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 +6051 -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 +810 -0
- package/dist/usersSlice/constants.d.ts +810 -0
- package/dist/usersSlice/constants.js +1033 -0
- package/dist/usersSlice/constants.js.map +1 -0
- package/dist/usersSlice/constants.mjs +45 -0
- package/dist/usersSlice/constants.mjs.map +1 -0
- package/dist/usersSlice/index.d.mts +7917 -0
- package/dist/usersSlice/index.d.ts +7917 -0
- package/dist/usersSlice/index.js +1118 -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 +1061 -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 +5795 -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 +61 -0
- package/dist/utils.d.ts +61 -0
- package/dist/utils.js +1224 -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
|
@@ -1,235 +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 { getUserSettings, saveUserSettings } from '@northern.tech/store/thunks';
|
|
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 userActions } from '../usersSlice';
|
|
22
|
-
import { onboardingSteps } from './constants';
|
|
23
|
-
import { advanceOnboarding, getOnboardingState, setOnboardingApproach, setOnboardingCanceled, setOnboardingComplete, setOnboardingDeviceType } from './thunks';
|
|
24
|
-
|
|
25
|
-
const middlewares = [thunk];
|
|
26
|
-
const mockStore = configureMockStore(middlewares);
|
|
27
|
-
|
|
28
|
-
export const defaultOnboardingState = {
|
|
29
|
-
approach: null,
|
|
30
|
-
complete: false,
|
|
31
|
-
demoArtifactPort: 85,
|
|
32
|
-
deviceType: null,
|
|
33
|
-
progress: undefined,
|
|
34
|
-
showConnectDeviceDialog: false,
|
|
35
|
-
showTips: undefined,
|
|
36
|
-
showTipsDialog: false,
|
|
37
|
-
something: 'here'
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const expectedOnboardingActions = [
|
|
41
|
-
{ type: getOnboardingState.pending.type },
|
|
42
|
-
{ type: actions.setOnboardingComplete.type, payload: false },
|
|
43
|
-
{
|
|
44
|
-
type: actions.setOnboardingState.type,
|
|
45
|
-
payload: {
|
|
46
|
-
...defaultOnboardingState,
|
|
47
|
-
address: 'http://192.168.10.141:85',
|
|
48
|
-
approach: 'physical',
|
|
49
|
-
deviceType: ['raspberrypi4'],
|
|
50
|
-
progress: 'devices-accepted-onboarding',
|
|
51
|
-
showTips: true
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{ type: saveUserSettings.pending.type },
|
|
55
|
-
{ type: getUserSettings.pending.type },
|
|
56
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings } },
|
|
57
|
-
{ type: getUserSettings.fulfilled.type },
|
|
58
|
-
{
|
|
59
|
-
type: userActions.setUserSettings.type,
|
|
60
|
-
payload: {
|
|
61
|
-
...defaultState.users.userSettings,
|
|
62
|
-
onboarding: {
|
|
63
|
-
...defaultOnboardingState,
|
|
64
|
-
address: 'http://192.168.10.141:85',
|
|
65
|
-
approach: 'physical',
|
|
66
|
-
deviceType: ['raspberrypi4'],
|
|
67
|
-
progress: 'devices-accepted-onboarding',
|
|
68
|
-
showTips: true
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{ type: saveUserSettings.fulfilled.type },
|
|
73
|
-
{ type: getOnboardingState.fulfilled.type }
|
|
74
|
-
];
|
|
75
|
-
|
|
76
|
-
describe('onboarding actions', () => {
|
|
77
|
-
it('should pass on onboarding completion', async () => {
|
|
78
|
-
const store = mockStore({ ...defaultState });
|
|
79
|
-
await store.dispatch(setOnboardingComplete(true));
|
|
80
|
-
const expectedActions = [
|
|
81
|
-
{ type: setOnboardingComplete.pending.type },
|
|
82
|
-
{ type: actions.setOnboardingComplete.type, payload: true },
|
|
83
|
-
{ type: actions.setShowOnboardingHelp.type, payload: false },
|
|
84
|
-
{ type: advanceOnboarding.pending.type },
|
|
85
|
-
{ type: actions.setOnboardingProgress.type, payload: onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE },
|
|
86
|
-
{ type: saveUserSettings.pending.type },
|
|
87
|
-
{ type: getUserSettings.pending.type },
|
|
88
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings } },
|
|
89
|
-
{ type: getUserSettings.fulfilled.type },
|
|
90
|
-
{
|
|
91
|
-
type: userActions.setUserSettings.type,
|
|
92
|
-
payload: {
|
|
93
|
-
...defaultState.users.userSettings,
|
|
94
|
-
onboarding: {
|
|
95
|
-
...defaultOnboardingState,
|
|
96
|
-
complete: true,
|
|
97
|
-
progress: onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{ type: saveUserSettings.fulfilled.type },
|
|
102
|
-
{ type: advanceOnboarding.fulfilled.type },
|
|
103
|
-
{ type: setOnboardingComplete.fulfilled.type }
|
|
104
|
-
];
|
|
105
|
-
const storeActions = store.getActions();
|
|
106
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
107
|
-
expectedActions.map((action, index) => Object.keys(action).map(key => expect(storeActions[index][key]).toEqual(action[key])));
|
|
108
|
-
});
|
|
109
|
-
it('should pass on onboarding approach', async () => {
|
|
110
|
-
const store = mockStore({ ...defaultState });
|
|
111
|
-
await store.dispatch(setOnboardingApproach('test'));
|
|
112
|
-
const expectedActions = [
|
|
113
|
-
{ type: setOnboardingApproach.pending.type },
|
|
114
|
-
{ type: actions.setOnboardingApproach.type, payload: 'test' },
|
|
115
|
-
{ type: saveUserSettings.pending.type },
|
|
116
|
-
{ type: getUserSettings.pending.type },
|
|
117
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings } },
|
|
118
|
-
{ type: getUserSettings.fulfilled.type },
|
|
119
|
-
{
|
|
120
|
-
type: userActions.setUserSettings.type,
|
|
121
|
-
payload: {
|
|
122
|
-
...defaultState.users.userSettings,
|
|
123
|
-
onboarding: {
|
|
124
|
-
...defaultOnboardingState,
|
|
125
|
-
approach: 'test'
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
{ type: saveUserSettings.fulfilled.type },
|
|
130
|
-
{ type: setOnboardingApproach.fulfilled.type }
|
|
131
|
-
];
|
|
132
|
-
const storeActions = store.getActions();
|
|
133
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
134
|
-
expectedActions.map((action, index) => Object.keys(action).map(key => expect(storeActions[index][key]).toEqual(action[key])));
|
|
135
|
-
});
|
|
136
|
-
it('should pass on onboarding device type', async () => {
|
|
137
|
-
const store = mockStore({ ...defaultState });
|
|
138
|
-
await store.dispatch(setOnboardingDeviceType('testtype'));
|
|
139
|
-
const expectedActions = [
|
|
140
|
-
{ type: setOnboardingDeviceType.pending.type },
|
|
141
|
-
{ type: actions.setOnboardingDeviceType.type, payload: 'testtype' },
|
|
142
|
-
{ type: saveUserSettings.pending.type },
|
|
143
|
-
{ type: getUserSettings.pending.type },
|
|
144
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings } },
|
|
145
|
-
{ type: getUserSettings.fulfilled.type },
|
|
146
|
-
{
|
|
147
|
-
type: userActions.setUserSettings.type,
|
|
148
|
-
payload: {
|
|
149
|
-
...defaultState.users.userSettings,
|
|
150
|
-
columnSelection: [],
|
|
151
|
-
onboarding: {
|
|
152
|
-
...defaultOnboardingState,
|
|
153
|
-
deviceType: 'testtype'
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
{ type: saveUserSettings.fulfilled.type },
|
|
158
|
-
{ type: setOnboardingDeviceType.fulfilled.type }
|
|
159
|
-
];
|
|
160
|
-
const storeActions = store.getActions();
|
|
161
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
162
|
-
expectedActions.map((action, index) => Object.keys(action).map(key => expect(storeActions[index][key]).toEqual(action[key])));
|
|
163
|
-
});
|
|
164
|
-
it('should advance onboarding by one step', async () => {
|
|
165
|
-
const store = mockStore({ ...defaultState });
|
|
166
|
-
await store.dispatch(advanceOnboarding(onboardingSteps.DASHBOARD_ONBOARDING_START));
|
|
167
|
-
const expectedActions = [
|
|
168
|
-
{ type: advanceOnboarding.pending.type },
|
|
169
|
-
{ type: actions.setOnboardingProgress.type, payload: onboardingSteps.DEVICES_PENDING_ONBOARDING_START },
|
|
170
|
-
{ type: saveUserSettings.pending.type },
|
|
171
|
-
{ type: getUserSettings.pending.type },
|
|
172
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings } },
|
|
173
|
-
{ type: getUserSettings.fulfilled.type },
|
|
174
|
-
{
|
|
175
|
-
type: userActions.setUserSettings.type,
|
|
176
|
-
payload: {
|
|
177
|
-
...defaultState.users.userSettings,
|
|
178
|
-
columnSelection: [],
|
|
179
|
-
onboarding: {
|
|
180
|
-
...defaultOnboardingState,
|
|
181
|
-
progress: onboardingSteps.DEVICES_PENDING_ONBOARDING_START
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
{ type: saveUserSettings.fulfilled.type },
|
|
186
|
-
{ type: advanceOnboarding.fulfilled.type }
|
|
187
|
-
];
|
|
188
|
-
const storeActions = store.getActions();
|
|
189
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
190
|
-
expectedActions.map((action, index) => Object.keys(action).map(key => expect(storeActions[index][key]).toEqual(action[key])));
|
|
191
|
-
});
|
|
192
|
-
it('should disable helptips and store a canceled state', async () => {
|
|
193
|
-
const store = mockStore({ ...defaultState });
|
|
194
|
-
await store.dispatch(setOnboardingCanceled());
|
|
195
|
-
const expectedActions = [
|
|
196
|
-
{ type: setOnboardingCanceled.pending.type },
|
|
197
|
-
{ type: actions.setShowOnboardingHelp.type, payload: false },
|
|
198
|
-
{ type: actions.setShowDismissOnboardingTipsDialog.type, payload: false },
|
|
199
|
-
{ type: actions.setOnboardingComplete.type, payload: true },
|
|
200
|
-
{ type: advanceOnboarding.pending.type },
|
|
201
|
-
{ type: actions.setOnboardingProgress.type, payload: 'onboarding-canceled' },
|
|
202
|
-
{ type: saveUserSettings.pending.type },
|
|
203
|
-
{ type: getUserSettings.pending.type },
|
|
204
|
-
{ type: userActions.setUserSettings.type, payload: { ...defaultState.users.userSettings } },
|
|
205
|
-
{ type: getUserSettings.fulfilled.type },
|
|
206
|
-
{
|
|
207
|
-
type: userActions.setUserSettings.type,
|
|
208
|
-
payload: {
|
|
209
|
-
...defaultState.users.userSettings,
|
|
210
|
-
columnSelection: [],
|
|
211
|
-
onboarding: {
|
|
212
|
-
...defaultOnboardingState,
|
|
213
|
-
complete: true,
|
|
214
|
-
progress: 'onboarding-canceled'
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
{ type: saveUserSettings.fulfilled.type },
|
|
219
|
-
{ type: advanceOnboarding.fulfilled.type },
|
|
220
|
-
{ type: setOnboardingCanceled.fulfilled.type }
|
|
221
|
-
];
|
|
222
|
-
const storeActions = store.getActions();
|
|
223
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
224
|
-
expectedActions.map((action, index) => Object.keys(action).map(key => expect(storeActions[index][key]).toEqual(action[key])));
|
|
225
|
-
});
|
|
226
|
-
it('should try to derive the onboarding state based on the stored state of the environment', async () => {
|
|
227
|
-
const store = mockStore({ ...defaultState });
|
|
228
|
-
const stepNames = Object.keys(onboardingSteps);
|
|
229
|
-
await store.dispatch(getOnboardingState(stepNames[0]));
|
|
230
|
-
const expectedActions = expectedOnboardingActions;
|
|
231
|
-
const storeActions = store.getActions();
|
|
232
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
233
|
-
expectedActions.map((action, index) => Object.keys(action).map(key => expect(storeActions[index][key]).toEqual(action[key])));
|
|
234
|
-
});
|
|
235
|
-
});
|
|
@@ -1,142 +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 { DEVICE_STATES, onboardingSteps as onboardingStepNames, orderedOnboardingSteps as onboardingSteps } from '@northern.tech/store/constants';
|
|
16
|
-
import { getOnboardingState as getCurrentOnboardingState, getUserCapabilities } from '@northern.tech/store/selectors';
|
|
17
|
-
import { saveUserSettings } from '@northern.tech/store/thunks';
|
|
18
|
-
import { getDemoDeviceAddress } from '@northern.tech/utils/helpers';
|
|
19
|
-
import { createAsyncThunk } from '@reduxjs/toolkit';
|
|
20
|
-
import Cookies from 'universal-cookie';
|
|
21
|
-
|
|
22
|
-
import { actions, sliceName } from '.';
|
|
23
|
-
|
|
24
|
-
const cookies = new Cookies();
|
|
25
|
-
|
|
26
|
-
export const applyOnboardingFallbacks = progress => {
|
|
27
|
-
const step = onboardingSteps[progress];
|
|
28
|
-
if (step && step.fallbackStep) {
|
|
29
|
-
return step.fallbackStep;
|
|
30
|
-
}
|
|
31
|
-
return progress;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const determineProgress = (acceptedDevices, pendingDevices, releases, pastDeployments) => {
|
|
35
|
-
const steps = onboardingSteps;
|
|
36
|
-
let progress = -1;
|
|
37
|
-
progress = pendingDevices.length > 1 ? steps.findIndex(step => step === onboardingStepNames.DEVICES_PENDING_ACCEPTING_ONBOARDING) : progress;
|
|
38
|
-
progress = acceptedDevices.length >= 1 ? steps.findIndex(step => step === onboardingStepNames.DEVICES_ACCEPTED_ONBOARDING) : progress;
|
|
39
|
-
progress =
|
|
40
|
-
acceptedDevices.length > 1 && releases.length > 1 && pastDeployments.length > 1
|
|
41
|
-
? steps.findIndex(step => step === onboardingStepNames.DEPLOYMENTS_PAST_COMPLETED)
|
|
42
|
-
: progress;
|
|
43
|
-
return steps[progress];
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const deductOnboardingState = ({ devicesById, devicesByStatus, onboardingState, pastDeployments, releases, userCapabilities, userId }) => {
|
|
47
|
-
const { canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases } = userCapabilities;
|
|
48
|
-
const userCookie = cookies.get(`${userId}-onboarded`);
|
|
49
|
-
const acceptedDevices = devicesByStatus[DEVICE_STATES.accepted].deviceIds;
|
|
50
|
-
const pendingDevices = devicesByStatus[DEVICE_STATES.pending].deviceIds;
|
|
51
|
-
let deviceType = onboardingState.deviceType ?? [];
|
|
52
|
-
deviceType =
|
|
53
|
-
!deviceType.length && acceptedDevices.length && devicesById[acceptedDevices[0]].hasOwnProperty('attributes')
|
|
54
|
-
? devicesById[acceptedDevices[0]].attributes.device_type
|
|
55
|
-
: deviceType;
|
|
56
|
-
const progress = applyOnboardingFallbacks(onboardingState.progress || determineProgress(acceptedDevices, pendingDevices, releases, pastDeployments));
|
|
57
|
-
return {
|
|
58
|
-
...onboardingState,
|
|
59
|
-
complete: !!(
|
|
60
|
-
Boolean(userCookie) ||
|
|
61
|
-
onboardingState.complete ||
|
|
62
|
-
(acceptedDevices.length > 1 && pendingDevices.length > 0 && releases.length > 1 && pastDeployments.length > 1) ||
|
|
63
|
-
(acceptedDevices.length >= 1 && releases.length >= 2 && pastDeployments.length > 2) ||
|
|
64
|
-
(acceptedDevices.length >= 1 && pendingDevices.length > 0 && releases.length >= 2 && pastDeployments.length >= 2) ||
|
|
65
|
-
onboardingSteps.findIndex(step => step === progress) >= onboardingSteps.length - 1 ||
|
|
66
|
-
onboardingState.disable ||
|
|
67
|
-
![canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases].every(i => i)
|
|
68
|
-
),
|
|
69
|
-
showTips: onboardingState.showTips != null ? onboardingState.showTips : true,
|
|
70
|
-
deviceType,
|
|
71
|
-
approach: onboardingState.approach || (deviceType.some(type => type.startsWith('qemu')) ? 'virtual' : 'physical'),
|
|
72
|
-
progress
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const getOnboardingState = createAsyncThunk(`${sliceName}/getOnboardingState`, (_, { dispatch, getState }) => {
|
|
77
|
-
const state = getState();
|
|
78
|
-
let onboardingState = getCurrentOnboardingState(state);
|
|
79
|
-
if (!onboardingState.complete) {
|
|
80
|
-
const userId = state.users.currentUser;
|
|
81
|
-
onboardingState = deductOnboardingState({
|
|
82
|
-
devicesById: state.devices.byId,
|
|
83
|
-
devicesByStatus: state.devices.byStatus,
|
|
84
|
-
onboardingState,
|
|
85
|
-
pastDeployments: state.deployments.byStatus.finished.deploymentIds,
|
|
86
|
-
releases: Object.values(state.releases.byId),
|
|
87
|
-
userCapabilities: getUserCapabilities(state),
|
|
88
|
-
userId
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
onboardingState.progress = onboardingState.progress || onboardingStepNames.DASHBOARD_ONBOARDING_START;
|
|
92
|
-
const demoDeviceAddress = `http://${getDemoDeviceAddress(Object.values(state.devices.byId), onboardingState.approach)}`;
|
|
93
|
-
onboardingState.address = state.onboarding.demoArtifactPort ? `${demoDeviceAddress}:${state.onboarding.demoArtifactPort}` : demoDeviceAddress;
|
|
94
|
-
return Promise.all([
|
|
95
|
-
dispatch(actions.setOnboardingComplete(onboardingState.complete)),
|
|
96
|
-
dispatch(actions.setOnboardingState(onboardingState)),
|
|
97
|
-
dispatch(saveUserSettings({ onboarding: onboardingState }))
|
|
98
|
-
]);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
export const setOnboardingDeviceType = createAsyncThunk(`${sliceName}/setOnboardingDeviceType`, (value, { dispatch }) =>
|
|
102
|
-
Promise.all([dispatch(actions.setOnboardingDeviceType(value)), dispatch(saveUserSettings({ onboarding: { deviceType: value } }))])
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
export const setOnboardingApproach = createAsyncThunk(`${sliceName}/setOnboardingApproach`, (value, { dispatch }) =>
|
|
106
|
-
Promise.all([dispatch(actions.setOnboardingApproach(value)), dispatch(saveUserSettings({ onboarding: { approach: value } }))])
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
export const setOnboardingComplete = createAsyncThunk(`${sliceName}/setOnboardingComplete`, (value, { dispatch }) => {
|
|
110
|
-
let tasks = [Promise.resolve(dispatch(actions.setOnboardingComplete(value)))];
|
|
111
|
-
if (value) {
|
|
112
|
-
tasks.push(Promise.resolve(dispatch(actions.setShowOnboardingHelp(false))));
|
|
113
|
-
tasks.push(Promise.resolve(dispatch(advanceOnboarding(onboardingStepNames.DEPLOYMENTS_PAST_COMPLETED))));
|
|
114
|
-
}
|
|
115
|
-
return Promise.all(tasks);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
export const setOnboardingCanceled = createAsyncThunk(`${sliceName}/setOnboardingCanceled`, (_, { dispatch }) =>
|
|
119
|
-
Promise.all([
|
|
120
|
-
Promise.resolve(dispatch(actions.setShowOnboardingHelp(false))),
|
|
121
|
-
Promise.resolve(dispatch(actions.setShowDismissOnboardingTipsDialog(false))),
|
|
122
|
-
Promise.resolve(dispatch(actions.setOnboardingComplete(true)))
|
|
123
|
-
])
|
|
124
|
-
// using DEPLOYMENTS_PAST_COMPLETED to ensure we get the intended onboarding state set after
|
|
125
|
-
// _advancing_ the onboarding progress
|
|
126
|
-
.then(() => dispatch(advanceOnboarding(onboardingStepNames.DEPLOYMENTS_PAST_COMPLETED_FAILURE)))
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
export const advanceOnboarding = createAsyncThunk(`${sliceName}/advanceOnboarding`, (stepId, { dispatch, getState }) => {
|
|
130
|
-
const steps = onboardingSteps;
|
|
131
|
-
const progress = steps.findIndex(step => step === getState().onboarding.progress);
|
|
132
|
-
const stepIndex = steps.findIndex(step => step === stepId);
|
|
133
|
-
// if there is no progress set yet, the onboarding state deduction hasn't happened
|
|
134
|
-
// and the subsequent settings persistence would overwrite what we stored
|
|
135
|
-
if (progress > stepIndex || getState().onboarding.progress === null) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const madeProgress = steps[stepIndex + 1];
|
|
139
|
-
const state = { ...getCurrentOnboardingState(getState()), progress: madeProgress };
|
|
140
|
-
state.complete = stepIndex + 1 >= steps.findIndex(step => step === onboardingStepNames.DEPLOYMENTS_PAST_COMPLETED_FAILURE) ? true : state.complete;
|
|
141
|
-
return Promise.all([dispatch(actions.setOnboardingProgress(madeProgress)), dispatch(saveUserSettings({ onboarding: state }))]);
|
|
142
|
-
});
|
|
@@ -1,82 +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 { Integration } from '@northern.tech/store/api/types/MenderTypes';
|
|
16
|
-
import { EXTERNAL_PROVIDER, apiUrl, useradmApiUrl } from '@northern.tech/store/constants';
|
|
17
|
-
|
|
18
|
-
export const auditLogsApiUrl = `${apiUrl.v1}/auditlogs`;
|
|
19
|
-
export const tenantadmApiUrlv1 = `${apiUrl.v1}/tenantadm`;
|
|
20
|
-
export const tenantadmApiUrlv2 = `${apiUrl.v2}/tenantadm`;
|
|
21
|
-
export const ssoIdpApiUrlv1 = `${apiUrl.v1}/useradm/sso/idp/metadata`;
|
|
22
|
-
|
|
23
|
-
export const XML_METADATA_FORMAT = 'xml';
|
|
24
|
-
export const JSON_METADATA_FORMAT = 'json';
|
|
25
|
-
|
|
26
|
-
export const getSamlStartUrl = id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/login`;
|
|
27
|
-
export const getOidcStartUrl = id => `${window.location.origin}${useradmApiUrl}/oidc/${id}/start`;
|
|
28
|
-
|
|
29
|
-
export const SSO_TYPES = {
|
|
30
|
-
saml: {
|
|
31
|
-
id: 'saml',
|
|
32
|
-
type: 'saml',
|
|
33
|
-
title: 'SAML',
|
|
34
|
-
metadataFormat: XML_METADATA_FORMAT,
|
|
35
|
-
editorLanguage: XML_METADATA_FORMAT,
|
|
36
|
-
contentType: 'application/samlmetadata+xml',
|
|
37
|
-
getStartUrl: getSamlStartUrl,
|
|
38
|
-
configDetails: [
|
|
39
|
-
{ key: 'entityID', label: 'Entity ID', getValue: id => `${window.location.origin}${useradmApiUrl}/sso/sp/metadata/${id}` },
|
|
40
|
-
{ key: 'acs', label: 'ACS URL', getValue: id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/acs` },
|
|
41
|
-
{ key: 'startURL', label: 'Start URL', getValue: getSamlStartUrl }
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
oidc: {
|
|
45
|
-
id: 'oidc',
|
|
46
|
-
type: 'oidc',
|
|
47
|
-
title: 'OpenID Connect',
|
|
48
|
-
metadataFormat: JSON_METADATA_FORMAT,
|
|
49
|
-
editorLanguage: JSON_METADATA_FORMAT,
|
|
50
|
-
contentType: 'application/json',
|
|
51
|
-
getStartUrl: getOidcStartUrl,
|
|
52
|
-
configDetails: [{ key: 'startURL', label: 'Start Url', getValue: getOidcStartUrl }]
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const AUDIT_LOGS_TYPES = [
|
|
57
|
-
{ title: 'Artifact', queryParameter: 'object_type', value: 'artifact' },
|
|
58
|
-
{ title: 'Deployment', queryParameter: 'object_deployment_name', value: 'deployment' },
|
|
59
|
-
{ title: 'Device', queryParameter: 'object_id', value: 'device' },
|
|
60
|
-
{ title: 'User', queryParameter: 'object_id', value: 'user' }
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
export interface Webhook extends Integration {
|
|
64
|
-
provider: Integration.provider.WEBHOOK;
|
|
65
|
-
scopes?: string[];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export const emptyWebhook: Webhook = {
|
|
69
|
-
description: '',
|
|
70
|
-
enabled: true,
|
|
71
|
-
credentials: {
|
|
72
|
-
type: EXTERNAL_PROVIDER.webhook.credentialsType,
|
|
73
|
-
[EXTERNAL_PROVIDER.webhook.credentialsType]: {
|
|
74
|
-
secret: '',
|
|
75
|
-
url: ''
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
export const TENANT_LIST_DEFAULT = {
|
|
80
|
-
page: 1,
|
|
81
|
-
perPage: 20
|
|
82
|
-
};
|
|
@@ -1,111 +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_LIST_DEFAULTS, SORTING_OPTIONS, TENANT_LIST_DEFAULT } from '@northern.tech/store/constants';
|
|
15
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
16
|
-
|
|
17
|
-
export const sliceName = 'organization';
|
|
18
|
-
|
|
19
|
-
export const initialState = {
|
|
20
|
-
card: {
|
|
21
|
-
last4: '',
|
|
22
|
-
expiration: { month: 1, year: 2020 },
|
|
23
|
-
brand: ''
|
|
24
|
-
},
|
|
25
|
-
intentId: null,
|
|
26
|
-
organization: {
|
|
27
|
-
tenantList: {
|
|
28
|
-
...TENANT_LIST_DEFAULT,
|
|
29
|
-
total: 0,
|
|
30
|
-
tenants: [],
|
|
31
|
-
selectedTenant: null,
|
|
32
|
-
sort: {
|
|
33
|
-
direction: SORTING_OPTIONS.desc,
|
|
34
|
-
key: 'name'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// id, name, status, tenant_token, plan
|
|
38
|
-
},
|
|
39
|
-
auditlog: {
|
|
40
|
-
events: [],
|
|
41
|
-
selectionState: {
|
|
42
|
-
...DEVICE_LIST_DEFAULTS,
|
|
43
|
-
detail: undefined,
|
|
44
|
-
endDate: undefined,
|
|
45
|
-
selectedIssue: undefined,
|
|
46
|
-
sort: { direction: SORTING_OPTIONS.desc },
|
|
47
|
-
startDate: undefined,
|
|
48
|
-
total: 0,
|
|
49
|
-
type: undefined,
|
|
50
|
-
user: undefined
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
externalDeviceIntegrations: [
|
|
54
|
-
// { <connection_string|x509|...>, id, provider }
|
|
55
|
-
],
|
|
56
|
-
ssoConfigs: [],
|
|
57
|
-
webhooks: {
|
|
58
|
-
// [id]: { events: [] }
|
|
59
|
-
// for now:
|
|
60
|
-
events: [],
|
|
61
|
-
eventsTotal: 0
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const organizationSlice = createSlice({
|
|
66
|
-
name: sliceName,
|
|
67
|
-
initialState,
|
|
68
|
-
reducers: {
|
|
69
|
-
receiveAuditLogs: (state, action) => {
|
|
70
|
-
const { events, total } = action.payload;
|
|
71
|
-
state.auditlog.events = events;
|
|
72
|
-
state.auditlog.selectionState.total = total;
|
|
73
|
-
},
|
|
74
|
-
setAuditLogState: (state, action) => {
|
|
75
|
-
state.auditlog.selectionState = {
|
|
76
|
-
...state.auditlog.selectionState,
|
|
77
|
-
...action.payload
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
receiveCurrentCard: (state, action) => {
|
|
81
|
-
state.card = action.payload;
|
|
82
|
-
},
|
|
83
|
-
receiveSetupIntent: (state, action) => {
|
|
84
|
-
state.intentId = action.payload;
|
|
85
|
-
},
|
|
86
|
-
setOrganization: (state, action) => {
|
|
87
|
-
state.organization = {
|
|
88
|
-
...state.organization,
|
|
89
|
-
...action.payload,
|
|
90
|
-
tenantList: { ...state.organization.tenantList, ...action.payload.tenantList }
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
setTenantListState: (state, action) => {
|
|
94
|
-
state.organization.tenantList = action.payload;
|
|
95
|
-
},
|
|
96
|
-
receiveExternalDeviceIntegrations: (state, action) => {
|
|
97
|
-
state.externalDeviceIntegrations = action.payload;
|
|
98
|
-
},
|
|
99
|
-
receiveSsoConfigs: (state, action) => {
|
|
100
|
-
state.ssoConfigs = action.payload;
|
|
101
|
-
},
|
|
102
|
-
receiveWebhookEvents: (state, action) => {
|
|
103
|
-
const { value, total } = action.payload;
|
|
104
|
-
state.webhooks.events = value;
|
|
105
|
-
state.webhooks.eventsTotal = total;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
export const actions = organizationSlice.actions;
|
|
111
|
-
export default organizationSlice.reducer;
|
|
@@ -1,78 +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 { SORTING_OPTIONS } from '@northern.tech/store/commonConstants';
|
|
16
|
-
|
|
17
|
-
import reducer, { actions, initialState } from '.';
|
|
18
|
-
import { defaultState } from '../../../../tests/mockData';
|
|
19
|
-
|
|
20
|
-
describe('organization reducer', () => {
|
|
21
|
-
it('should return the initial state', async () => {
|
|
22
|
-
expect(reducer(undefined, {})).toEqual(initialState);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should handle RECEIVE_AUDIT_LOGS', async () => {
|
|
26
|
-
expect(
|
|
27
|
-
reducer(undefined, { type: actions.receiveAuditLogs, payload: { events: defaultState.organization.auditlog.events, total: 2 } }).auditlog.selectionState
|
|
28
|
-
.total
|
|
29
|
-
).toEqual(2);
|
|
30
|
-
expect(
|
|
31
|
-
reducer(initialState, { type: actions.receiveAuditLogs, payload: { events: defaultState.organization.auditlog.events, total: 4 } }).auditlog
|
|
32
|
-
.selectionState.total
|
|
33
|
-
).toEqual(4);
|
|
34
|
-
});
|
|
35
|
-
it('should handle SET_AUDITLOG_STATE', async () => {
|
|
36
|
-
const newState = { something: 'new' };
|
|
37
|
-
expect(reducer(undefined, { type: actions.setAuditLogState, payload: newState }).auditlog.selectionState.something).toEqual(newState.something);
|
|
38
|
-
expect(reducer(initialState, { type: actions.setAuditLogState, payload: newState }).auditlog.selectionState).toEqual({
|
|
39
|
-
...defaultState.organization.auditlog.selectionState,
|
|
40
|
-
...newState,
|
|
41
|
-
sort: { direction: SORTING_OPTIONS.desc },
|
|
42
|
-
total: 0
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
it('should handle RECEIVE_CURRENT_CARD', async () => {
|
|
46
|
-
expect(reducer(undefined, { type: actions.receiveCurrentCard, payload: defaultState.organization.card }).card).toEqual(defaultState.organization.card);
|
|
47
|
-
expect(reducer(initialState, { type: actions.receiveCurrentCard, payload: defaultState.organization.card }).card).toEqual(defaultState.organization.card);
|
|
48
|
-
});
|
|
49
|
-
it('should handle RECEIVE_SETUP_INTENT', async () => {
|
|
50
|
-
expect(reducer(undefined, { type: actions.receiveSetupIntent, payload: defaultState.organization.intentId }).intentId).toEqual(
|
|
51
|
-
defaultState.organization.intentId
|
|
52
|
-
);
|
|
53
|
-
expect(reducer(initialState, { type: actions.receiveSetupIntent, payload: 4 }).intentId).toEqual(4);
|
|
54
|
-
});
|
|
55
|
-
it('should handle SET_ORGANIZATION', async () => {
|
|
56
|
-
expect(reducer(undefined, { type: actions.setOrganization, payload: defaultState.organization.organization }).organization.plan).toEqual(
|
|
57
|
-
defaultState.organization.organization.plan
|
|
58
|
-
);
|
|
59
|
-
expect(reducer(initialState, { type: actions.setOrganization, payload: defaultState.organization.organization }).organization.name).toEqual(
|
|
60
|
-
defaultState.organization.organization.name
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
it('should handle RECEIVE_EXTERNAL_DEVICE_INTEGRATIONS', async () => {
|
|
64
|
-
expect(reducer(undefined, { type: actions.receiveExternalDeviceIntegrations, payload: [] }).externalDeviceIntegrations).toEqual([]);
|
|
65
|
-
expect(reducer(initialState, { type: actions.receiveExternalDeviceIntegrations, payload: [12, 23] }).externalDeviceIntegrations).toEqual([12, 23]);
|
|
66
|
-
});
|
|
67
|
-
it('should handle RECEIVE_WEBHOOK_EVENTS', async () => {
|
|
68
|
-
expect(reducer(undefined, { type: actions.receiveWebhookEvents, payload: { value: [] } }).webhooks.events).toEqual([]);
|
|
69
|
-
expect(reducer(initialState, { type: actions.receiveWebhookEvents, payload: { value: [12, 23], total: 5 } }).webhooks).toEqual({
|
|
70
|
-
events: [12, 23],
|
|
71
|
-
eventsTotal: 5
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
it('should handle RECEIVE_SSO_CONFIGS', async () => {
|
|
75
|
-
expect(reducer(undefined, { type: actions.receiveSsoConfigs, payload: [] }).ssoConfigs).toEqual([]);
|
|
76
|
-
expect(reducer(initialState, { type: actions.receiveSsoConfigs, payload: [12, 23] }).ssoConfigs).toEqual([12, 23]);
|
|
77
|
-
});
|
|
78
|
-
});
|