@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,108 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 Northern.tech AS
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
// @ts-nocheck
|
|
15
|
-
|
|
16
|
-
/*eslint import/namespace: ['error', { allowComputed: true }]*/
|
|
17
|
-
import reducer, { actions, initialState } from '.';
|
|
18
|
-
import { defaultState } from '../../../../tests/mockData';
|
|
19
|
-
import { DEPLOYMENT_STATES } from './constants';
|
|
20
|
-
|
|
21
|
-
describe('deployment reducer', () => {
|
|
22
|
-
it('should return the initial state', async () => {
|
|
23
|
-
expect(reducer(undefined, {})).toEqual(initialState);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('should handle RECEIVE_DEPLOYMENT', async () => {
|
|
27
|
-
expect(reducer(undefined, { type: actions.receivedDeployment, payload: defaultState.deployments.byId.d1 }).byId.d1).toEqual(
|
|
28
|
-
defaultState.deployments.byId.d1
|
|
29
|
-
);
|
|
30
|
-
expect(reducer(initialState, { type: actions.receivedDeployment, payload: defaultState.deployments.byId.d1 }).byId.d1).toEqual(
|
|
31
|
-
defaultState.deployments.byId.d1
|
|
32
|
-
);
|
|
33
|
-
});
|
|
34
|
-
it('should handle RECEIVE_DEPLOYMENTS', async () => {
|
|
35
|
-
const { statistics } = defaultState.deployments.byId.d1;
|
|
36
|
-
expect(reducer(undefined, { type: actions.receivedDeployments, payload: { plain: 'passing' } }).byId.plain).toBeTruthy();
|
|
37
|
-
expect(
|
|
38
|
-
reducer(initialState, { type: actions.receivedDeployments, payload: { [defaultState.deployments.byId.d1.id]: { statistics } } }).byId.d1.statistics
|
|
39
|
-
).toBeTruthy();
|
|
40
|
-
});
|
|
41
|
-
it('should handle RECEIVE_DEPLOYMENT_DEVICE_LOG', async () => {
|
|
42
|
-
expect(
|
|
43
|
-
reducer(undefined, {
|
|
44
|
-
type: actions.receivedDeploymentDeviceLog,
|
|
45
|
-
payload: { id: defaultState.deployments.byId.d1.id, deviceId: defaultState.deployments.byId.d1.devices.a1.id, log: 'foo' }
|
|
46
|
-
}).byId.d1.devices.a1.log
|
|
47
|
-
).toEqual('foo');
|
|
48
|
-
expect(
|
|
49
|
-
reducer(initialState, {
|
|
50
|
-
type: actions.receivedDeploymentDeviceLog,
|
|
51
|
-
payload: { id: defaultState.deployments.byId.d1.id, deviceId: defaultState.deployments.byId.d1.devices.a1.id, log: 'bar' }
|
|
52
|
-
}).byId.d1.devices.a1.log
|
|
53
|
-
).toEqual('bar');
|
|
54
|
-
});
|
|
55
|
-
it('should handle RECEIVE_DEPLOYMENT_DEVICES', async () => {
|
|
56
|
-
const { devices, id } = defaultState.deployments.byId.d1;
|
|
57
|
-
expect(
|
|
58
|
-
reducer(undefined, {
|
|
59
|
-
type: actions.receivedDeploymentDevices,
|
|
60
|
-
payload: { id, devices, selectedDeviceIds: [devices.a1.id], totalDeviceCount: 500 }
|
|
61
|
-
}).byId.d1.totalDeviceCount
|
|
62
|
-
).toEqual(500);
|
|
63
|
-
expect(
|
|
64
|
-
reducer(defaultState.deployments, {
|
|
65
|
-
type: actions.receivedDeploymentDevices,
|
|
66
|
-
payload: { id, devices, selectedDeviceIds: [devices.a1.id], totalDeviceCount: 500 }
|
|
67
|
-
}).byId.d1.statistics
|
|
68
|
-
).toEqual(defaultState.deployments.byId.d1.statistics);
|
|
69
|
-
});
|
|
70
|
-
it('should handle RECEIVE_<deploymentstatus>_DEPLOYMENTS', async () => {
|
|
71
|
-
Object.values(DEPLOYMENT_STATES).forEach(status => {
|
|
72
|
-
expect(reducer(undefined, { type: actions.receivedDeploymentsForStatus, payload: { deploymentIds: ['a1'], total: 1, status } }).byStatus[status]).toEqual(
|
|
73
|
-
{ deploymentIds: ['a1'], total: 1 }
|
|
74
|
-
);
|
|
75
|
-
expect(
|
|
76
|
-
reducer(initialState, { type: actions.receivedDeploymentsForStatus, payload: { deploymentIds: ['a1'], total: 1, status } }).byStatus[status]
|
|
77
|
-
).toEqual({ deploymentIds: ['a1'], total: 1 });
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
it('should handle SELECT_<deploymentstatus>_DEPLOYMENTS', async () => {
|
|
81
|
-
Object.values(DEPLOYMENT_STATES).forEach(status => {
|
|
82
|
-
expect(
|
|
83
|
-
reducer(undefined, { type: actions.selectDeploymentsForStatus, payload: { deploymentIds: ['a1'], status } }).selectionState[status].selection
|
|
84
|
-
).toEqual(['a1']);
|
|
85
|
-
expect(
|
|
86
|
-
reducer(initialState, { type: actions.selectDeploymentsForStatus, payload: { deploymentIds: ['a1'], status } }).selectionState[status].selection
|
|
87
|
-
).toEqual(['a1']);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
it('should handle SET_DEPLOYMENTS_STATE', async () => {
|
|
91
|
-
const newState = { something: 'new' };
|
|
92
|
-
expect(reducer(undefined, { type: actions.setDeploymentsState, payload: newState }).selectionState).toEqual(newState);
|
|
93
|
-
expect(reducer(initialState, { type: actions.setDeploymentsState, payload: newState }).selectionState).toEqual(newState);
|
|
94
|
-
});
|
|
95
|
-
it('should handle REMOVE_DEPLOYMENT', async () => {
|
|
96
|
-
let state = reducer(undefined, { type: actions.receivedDeployment, payload: defaultState.deployments.byId.d1 });
|
|
97
|
-
expect(reducer(state, { type: actions.removedDeployment, payload: defaultState.deployments.byId.d1.id }).byId).toEqual({});
|
|
98
|
-
expect(reducer(initialState, { type: actions.removedDeployment, payload: 'a1' }).byId).toEqual({});
|
|
99
|
-
});
|
|
100
|
-
it('should handle CREATE_DEPLOYMENT', async () => {
|
|
101
|
-
expect(reducer(undefined, { type: actions.createdDeployment, payload: { name: 'test', id: 'test' } }).byId.test.devices).toEqual({});
|
|
102
|
-
expect(reducer(initialState, { type: actions.createdDeployment, payload: { name: 'test', id: 'a1' } }).byStatus.pending.deploymentIds).toContain('a1');
|
|
103
|
-
});
|
|
104
|
-
it('should handle SET_DEPLOYMENTS_CONFIG', async () => {
|
|
105
|
-
expect(reducer(undefined, { type: actions.setDeploymentsConfig, payload: { name: 'test' } }).config).toEqual({ name: 'test' });
|
|
106
|
-
expect(reducer(initialState, { type: actions.setDeploymentsConfig, payload: { name: 'test' } }).config).toEqual({ name: 'test' });
|
|
107
|
-
});
|
|
108
|
-
});
|
|
@@ -1,58 +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
|
-
// @ts-nocheck
|
|
15
|
-
import { createSelector } from '@reduxjs/toolkit';
|
|
16
|
-
|
|
17
|
-
import { DEPLOYMENT_STATES } from './constants';
|
|
18
|
-
|
|
19
|
-
export const getDeploymentsById = state => state.deployments.byId;
|
|
20
|
-
export const getDeploymentsByStatus = state => state.deployments.byStatus;
|
|
21
|
-
export const getSelectedDeploymentDeviceIds = state => state.deployments.selectedDeviceIds;
|
|
22
|
-
export const getDeploymentsSelectionState = state => state.deployments.selectionState;
|
|
23
|
-
|
|
24
|
-
export const getMappedDeploymentSelection = createSelector(
|
|
25
|
-
[getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],
|
|
26
|
-
(selectionState, deploymentsState, deploymentsById) => {
|
|
27
|
-
const { selection = [] } = selectionState[deploymentsState] ?? {};
|
|
28
|
-
return selection.reduce((accu, id) => {
|
|
29
|
-
if (deploymentsById[id]) {
|
|
30
|
-
accu.push(deploymentsById[id]);
|
|
31
|
-
}
|
|
32
|
-
return accu;
|
|
33
|
-
}, []);
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
const relevantDeploymentStates = [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress, DEPLOYMENT_STATES.finished];
|
|
38
|
-
export const DEPLOYMENT_CUTOFF = 3;
|
|
39
|
-
export const getRecentDeployments = createSelector([getDeploymentsById, getDeploymentsByStatus], (deploymentsById, deploymentsByStatus) =>
|
|
40
|
-
Object.entries(deploymentsByStatus).reduce(
|
|
41
|
-
(accu, [state, byStatus]) => {
|
|
42
|
-
if (!relevantDeploymentStates.includes(state) || !byStatus.deploymentIds.length) {
|
|
43
|
-
return accu;
|
|
44
|
-
}
|
|
45
|
-
accu[state] = byStatus.deploymentIds
|
|
46
|
-
.reduce((accu, id) => {
|
|
47
|
-
if (deploymentsById[id]) {
|
|
48
|
-
accu.push(deploymentsById[id]);
|
|
49
|
-
}
|
|
50
|
-
return accu;
|
|
51
|
-
}, [])
|
|
52
|
-
.slice(0, DEPLOYMENT_CUTOFF);
|
|
53
|
-
accu.total += byStatus.total;
|
|
54
|
-
return accu;
|
|
55
|
-
},
|
|
56
|
-
{ total: 0 }
|
|
57
|
-
)
|
|
58
|
-
);
|
|
@@ -1,425 +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 { getGlobalSettings, saveGlobalSettings, setOfflineThreshold } 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 appActions } from '../appSlice';
|
|
22
|
-
import { actions as deviceActions } from '../devicesSlice';
|
|
23
|
-
import { actions as userActions } from '../usersSlice';
|
|
24
|
-
import * as DeploymentConstants from './constants';
|
|
25
|
-
import {
|
|
26
|
-
abortDeployment,
|
|
27
|
-
createDeployment,
|
|
28
|
-
getDeploymentDevices,
|
|
29
|
-
getDeploymentsByStatus,
|
|
30
|
-
getDeploymentsConfig,
|
|
31
|
-
getDeviceDeployments,
|
|
32
|
-
getDeviceLog,
|
|
33
|
-
getSingleDeployment,
|
|
34
|
-
resetDeviceDeployments,
|
|
35
|
-
saveDeltaDeploymentsConfig,
|
|
36
|
-
setDeploymentsState,
|
|
37
|
-
updateDeploymentControlMap
|
|
38
|
-
} from './thunks';
|
|
39
|
-
|
|
40
|
-
const middlewares = [thunk];
|
|
41
|
-
const mockStore = configureMockStore(middlewares);
|
|
42
|
-
|
|
43
|
-
const createdDeployment = {
|
|
44
|
-
...defaultState.deployments.byId.d1,
|
|
45
|
-
id: 'created-123'
|
|
46
|
-
};
|
|
47
|
-
const deploymentsConfig = {
|
|
48
|
-
binaryDelta: {
|
|
49
|
-
compressionLevel: 6,
|
|
50
|
-
disableChecksum: false,
|
|
51
|
-
disableDecompression: false,
|
|
52
|
-
duplicatesWindow: 0,
|
|
53
|
-
inputWindow: 0,
|
|
54
|
-
instructionBuffer: 0,
|
|
55
|
-
sourceWindow: 0,
|
|
56
|
-
timeout: 0
|
|
57
|
-
},
|
|
58
|
-
binaryDeltaLimits: {
|
|
59
|
-
duplicatesWindow: DeploymentConstants.limitDefault,
|
|
60
|
-
inputWindow: DeploymentConstants.limitDefault,
|
|
61
|
-
instructionBuffer: DeploymentConstants.limitDefault,
|
|
62
|
-
sourceWindow: DeploymentConstants.limitDefault,
|
|
63
|
-
timeout: { default: 60, max: 3600, min: 60 }
|
|
64
|
-
},
|
|
65
|
-
hasDelta: true
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const defaultResponseActions = {
|
|
69
|
-
creation: {
|
|
70
|
-
type: actions.createdDeployment.type,
|
|
71
|
-
isImportant: true,
|
|
72
|
-
payload: { id: createdDeployment.id, devices: [{ id: Object.keys(defaultState.devices.byId)[0], status: 'pending' }], statistics: { status: {} } }
|
|
73
|
-
},
|
|
74
|
-
devices: {
|
|
75
|
-
type: actions.receivedDeploymentDevices.type,
|
|
76
|
-
payload: {
|
|
77
|
-
id: defaultState.deployments.byId.d1.id,
|
|
78
|
-
devices: defaultState.deployments.byId.d1.devices,
|
|
79
|
-
selectedDeviceIds: [defaultState.deployments.byId.d1.devices.a1.id],
|
|
80
|
-
totalDeviceCount: 1
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
log: {
|
|
84
|
-
type: actions.receivedDeploymentDeviceLog.type,
|
|
85
|
-
payload: {
|
|
86
|
-
id: defaultState.deployments.byId.d1.id,
|
|
87
|
-
deviceId: defaultState.deployments.byId.d1.devices.a1.id,
|
|
88
|
-
log: 'test'
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
snackbar: { type: appActions.setSnackbar.type, payload: 'Deployment created successfully' },
|
|
92
|
-
receive: { type: actions.receivedDeployment.type, payload: createdDeployment },
|
|
93
|
-
receiveMultiple: { type: actions.receivedDeployments.type, payload: {} },
|
|
94
|
-
receiveInprogress: { type: actions.receivedDeploymentsForStatus.type, payload: { deploymentIds: [], status: 'inprogress', total: 0 } },
|
|
95
|
-
remove: { type: actions.removedDeployment.type, payload: defaultState.deployments.byId.d1.id },
|
|
96
|
-
selectMultiple: {
|
|
97
|
-
type: actions.selectDeploymentsForStatus.type,
|
|
98
|
-
payload: { deploymentIds: Object.keys(defaultState.deployments.byId), status: 'inprogress' }
|
|
99
|
-
},
|
|
100
|
-
setOfflineThreshold: { type: appActions.setOfflineThreshold.type, payload: '2019-01-12T13:00:00.900Z' }
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
104
|
-
const { id_attribute, ...retrievedSettings } = defaultState.users.globalSettings;
|
|
105
|
-
|
|
106
|
-
const assertionFunction =
|
|
107
|
-
storeActions =>
|
|
108
|
-
({ type, isImportant, payload }, index) => {
|
|
109
|
-
expect(storeActions[index].type).toEqual(type);
|
|
110
|
-
if (isImportant) {
|
|
111
|
-
expect(storeActions[index].payload).toEqual(payload);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
/* eslint-disable sonarjs/no-identical-functions */
|
|
116
|
-
describe('deployment actions', () => {
|
|
117
|
-
it('should allow aborting deployments', async () => {
|
|
118
|
-
const store = mockStore({ ...defaultState });
|
|
119
|
-
const expectedActions = [
|
|
120
|
-
{ type: abortDeployment.pending.type },
|
|
121
|
-
defaultResponseActions.receiveMultiple,
|
|
122
|
-
defaultResponseActions.receiveInprogress,
|
|
123
|
-
defaultResponseActions.remove,
|
|
124
|
-
{ ...defaultResponseActions.snackbar, payload: 'The deployment was successfully aborted' },
|
|
125
|
-
{ type: abortDeployment.fulfilled.type }
|
|
126
|
-
];
|
|
127
|
-
return store
|
|
128
|
-
.dispatch(abortDeployment(defaultState.deployments.byId.d1.id))
|
|
129
|
-
.unwrap()
|
|
130
|
-
.then(() => {
|
|
131
|
-
const storeActions = store.getActions();
|
|
132
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
133
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
it(`should reject aborting deployments that don't exist`, () => {
|
|
137
|
-
const store = mockStore({ ...defaultState });
|
|
138
|
-
const abortedDeployment = store.dispatch(abortDeployment(`${defaultState.deployments.byId.d1.id}-invalid`)).unwrap();
|
|
139
|
-
expect(typeof abortedDeployment === Promise);
|
|
140
|
-
expect(abortedDeployment).rejects.toBeTruthy();
|
|
141
|
-
});
|
|
142
|
-
it('should allow creating deployments without filter or group', async () => {
|
|
143
|
-
const store = mockStore({
|
|
144
|
-
...defaultState,
|
|
145
|
-
deployments: {
|
|
146
|
-
...defaultState.deployments,
|
|
147
|
-
byStatus: {
|
|
148
|
-
...defaultState.deployments.byStatus,
|
|
149
|
-
finished: { ...defaultState.deployments.byStatus.finished, total: 0 },
|
|
150
|
-
inprogress: { ...defaultState.deployments.byStatus.inprogress, total: 0 },
|
|
151
|
-
pending: { ...defaultState.deployments.byStatus.pending, total: 0 },
|
|
152
|
-
scheduled: { ...defaultState.deployments.byStatus.scheduled, total: 0 }
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
const expectedActions = [
|
|
157
|
-
{ type: createDeployment.pending.type },
|
|
158
|
-
defaultResponseActions.creation,
|
|
159
|
-
{ type: getSingleDeployment.pending.type },
|
|
160
|
-
defaultResponseActions.snackbar,
|
|
161
|
-
{ type: saveGlobalSettings.pending.type },
|
|
162
|
-
{ type: getGlobalSettings.pending.type },
|
|
163
|
-
defaultResponseActions.receive,
|
|
164
|
-
{ type: getSingleDeployment.fulfilled.type },
|
|
165
|
-
{ type: userActions.setGlobalSettings.type },
|
|
166
|
-
{ type: setOfflineThreshold.pending.type },
|
|
167
|
-
defaultResponseActions.setOfflineThreshold,
|
|
168
|
-
{ type: setOfflineThreshold.fulfilled.type },
|
|
169
|
-
{ type: getGlobalSettings.fulfilled.type },
|
|
170
|
-
{ type: userActions.setGlobalSettings.type },
|
|
171
|
-
{ type: saveGlobalSettings.fulfilled.type },
|
|
172
|
-
{ type: createDeployment.fulfilled.type }
|
|
173
|
-
];
|
|
174
|
-
return store.dispatch(createDeployment({ newDeployment: { devices: [Object.keys(defaultState.devices.byId)[0]] } })).then(() => {
|
|
175
|
-
const storeActions = store.getActions();
|
|
176
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
177
|
-
expectedActions.map(assertionFunction(storeActions));
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
it('should allow creating deployments with a filter', async () => {
|
|
181
|
-
const store = mockStore({ ...defaultState });
|
|
182
|
-
const filter_id = '1234';
|
|
183
|
-
const expectedActions = [
|
|
184
|
-
{ type: createDeployment.pending.type },
|
|
185
|
-
{ ...defaultResponseActions.creation, payload: { ...defaultResponseActions.creation.payload, devices: [], filter_id, statistics: { status: {} } } },
|
|
186
|
-
{ type: getSingleDeployment.pending.type },
|
|
187
|
-
defaultResponseActions.snackbar,
|
|
188
|
-
{ type: saveGlobalSettings.pending.type },
|
|
189
|
-
{ type: getGlobalSettings.pending.type },
|
|
190
|
-
defaultResponseActions.receive,
|
|
191
|
-
{ type: getSingleDeployment.fulfilled.type },
|
|
192
|
-
{ type: userActions.setGlobalSettings.type },
|
|
193
|
-
{ type: setOfflineThreshold.pending.type },
|
|
194
|
-
defaultResponseActions.setOfflineThreshold,
|
|
195
|
-
{ type: setOfflineThreshold.fulfilled.type },
|
|
196
|
-
{ type: getGlobalSettings.fulfilled.type },
|
|
197
|
-
{ type: userActions.setGlobalSettings.type },
|
|
198
|
-
{ type: saveGlobalSettings.fulfilled.type },
|
|
199
|
-
{ type: createDeployment.fulfilled.type }
|
|
200
|
-
];
|
|
201
|
-
return store.dispatch(createDeployment({ newDeployment: { filter_id } })).then(() => {
|
|
202
|
-
const storeActions = store.getActions();
|
|
203
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
204
|
-
expectedActions.map(assertionFunction(storeActions));
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
it('should allow creating deployments with a group', async () => {
|
|
208
|
-
const store = mockStore({ ...defaultState });
|
|
209
|
-
const group = Object.keys(defaultState.devices.groups.byId)[0];
|
|
210
|
-
const expectedActions = [
|
|
211
|
-
{ type: createDeployment.pending.type },
|
|
212
|
-
{ ...defaultResponseActions.creation, payload: { ...defaultResponseActions.creation.payload, devices: [], group, statistics: { status: {} } } },
|
|
213
|
-
{ type: getSingleDeployment.pending.type },
|
|
214
|
-
defaultResponseActions.snackbar,
|
|
215
|
-
{ type: saveGlobalSettings.pending.type },
|
|
216
|
-
{ type: getGlobalSettings.pending.type },
|
|
217
|
-
defaultResponseActions.receive,
|
|
218
|
-
{ type: getSingleDeployment.fulfilled.type },
|
|
219
|
-
{ type: userActions.setGlobalSettings.type },
|
|
220
|
-
{ type: setOfflineThreshold.pending.type },
|
|
221
|
-
defaultResponseActions.setOfflineThreshold,
|
|
222
|
-
{ type: setOfflineThreshold.fulfilled.type },
|
|
223
|
-
{ type: getGlobalSettings.fulfilled.type },
|
|
224
|
-
{ type: userActions.setGlobalSettings.type },
|
|
225
|
-
{ type: saveGlobalSettings.fulfilled.type },
|
|
226
|
-
{ type: createDeployment.fulfilled.type }
|
|
227
|
-
];
|
|
228
|
-
return store.dispatch(createDeployment({ newDeployment: { group } })).then(() => {
|
|
229
|
-
const storeActions = store.getActions();
|
|
230
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
231
|
-
expectedActions.map(assertionFunction(storeActions));
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
it('should allow deployments retrieval', async () => {
|
|
235
|
-
const store = mockStore({ ...defaultState });
|
|
236
|
-
const expectedActions = [
|
|
237
|
-
{ type: getDeploymentsByStatus.pending.type },
|
|
238
|
-
{ ...defaultResponseActions.receiveMultiple, payload: defaultState.deployments.byId },
|
|
239
|
-
{
|
|
240
|
-
...defaultResponseActions.receiveInprogress,
|
|
241
|
-
payload: {
|
|
242
|
-
deploymentIds: Object.keys(defaultState.deployments.byId),
|
|
243
|
-
total: defaultState.deployments.byStatus.inprogress.total
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
defaultResponseActions.selectMultiple,
|
|
247
|
-
{ type: getDeploymentsByStatus.fulfilled.type }
|
|
248
|
-
];
|
|
249
|
-
return store
|
|
250
|
-
.dispatch(getDeploymentsByStatus({ status: 'inprogress', group: Object.keys(defaultState.devices.groups.byId)[0], type: 'configuration' }))
|
|
251
|
-
.then(() => {
|
|
252
|
-
const storeActions = store.getActions();
|
|
253
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
254
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
it('should allow deployment device log retrieval', async () => {
|
|
258
|
-
const store = mockStore({ ...defaultState });
|
|
259
|
-
const expectedActions = [{ type: getDeviceLog.pending.type }, defaultResponseActions.log, { type: getDeviceLog.fulfilled.type }];
|
|
260
|
-
return store
|
|
261
|
-
.dispatch(getDeviceLog({ deploymentId: Object.keys(defaultState.deployments.byId)[0], deviceId: defaultState.deployments.byId.d1.devices.a1.id }))
|
|
262
|
-
.then(() => {
|
|
263
|
-
const storeActions = store.getActions();
|
|
264
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
265
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
it('should allow deployment device list retrieval', async () => {
|
|
269
|
-
const store = mockStore({ ...defaultState });
|
|
270
|
-
const expectedActions = [{ type: getDeploymentDevices.pending.type }, defaultResponseActions.devices, { type: getDeploymentDevices.fulfilled.type }];
|
|
271
|
-
return store.dispatch(getDeploymentDevices({ id: Object.keys(defaultState.deployments.byId)[0] })).then(() => {
|
|
272
|
-
const storeActions = store.getActions();
|
|
273
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
274
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
275
|
-
});
|
|
276
|
-
});
|
|
277
|
-
it('should allow device deployment history retrieval', async () => {
|
|
278
|
-
const store = mockStore({ ...defaultState });
|
|
279
|
-
const expectedActions = [
|
|
280
|
-
{ type: getDeviceDeployments.pending.type },
|
|
281
|
-
{
|
|
282
|
-
type: deviceActions.receivedDevice.type,
|
|
283
|
-
payload: {
|
|
284
|
-
id: defaultState.devices.byId.a1.id,
|
|
285
|
-
deploymentsCount: 34,
|
|
286
|
-
deviceDeployments: [
|
|
287
|
-
{
|
|
288
|
-
id: defaultState.deployments.byId.d1.id,
|
|
289
|
-
release: defaultState.deployments.byId.d1.artifact_name,
|
|
290
|
-
created: '2019-01-01T12:35:00.000Z',
|
|
291
|
-
finished: '2019-01-01T12:40:00.000Z',
|
|
292
|
-
status: 'noartifact',
|
|
293
|
-
route: DeploymentConstants.DEPLOYMENT_ROUTES.active.key
|
|
294
|
-
}
|
|
295
|
-
]
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
{ type: getDeviceDeployments.fulfilled.type }
|
|
299
|
-
];
|
|
300
|
-
await store.dispatch(getDeviceDeployments({ deviceId: defaultState.devices.byId.a1.id }));
|
|
301
|
-
const storeActions = store.getActions();
|
|
302
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
303
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
304
|
-
});
|
|
305
|
-
it('should allow device deployment history deletion', async () => {
|
|
306
|
-
const store = mockStore({ ...defaultState });
|
|
307
|
-
const expectedActions = [
|
|
308
|
-
{ type: resetDeviceDeployments.pending.type },
|
|
309
|
-
{ type: getDeviceDeployments.pending.type },
|
|
310
|
-
{
|
|
311
|
-
type: deviceActions.receivedDevice.type,
|
|
312
|
-
payload: {
|
|
313
|
-
id: defaultState.devices.byId.a1.id,
|
|
314
|
-
deploymentsCount: 34,
|
|
315
|
-
deviceDeployments: [
|
|
316
|
-
{
|
|
317
|
-
id: defaultState.deployments.byId.d1.id,
|
|
318
|
-
release: defaultState.deployments.byId.d1.artifact_name,
|
|
319
|
-
created: '2019-01-01T12:35:00.000Z',
|
|
320
|
-
finished: '2019-01-01T12:40:00.000Z',
|
|
321
|
-
status: 'noartifact',
|
|
322
|
-
route: DeploymentConstants.DEPLOYMENT_ROUTES.active.key
|
|
323
|
-
}
|
|
324
|
-
]
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
{ type: getDeviceDeployments.fulfilled.type },
|
|
328
|
-
{ type: resetDeviceDeployments.fulfilled.type }
|
|
329
|
-
];
|
|
330
|
-
await store.dispatch(resetDeviceDeployments(defaultState.devices.byId.a1.id));
|
|
331
|
-
const storeActions = store.getActions();
|
|
332
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
333
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
334
|
-
});
|
|
335
|
-
it('should allow updating a deployment to continue the execution', async () => {
|
|
336
|
-
const store = mockStore({ ...defaultState });
|
|
337
|
-
const expectedActions = [
|
|
338
|
-
{ type: updateDeploymentControlMap.pending.type },
|
|
339
|
-
{ type: getSingleDeployment.pending.type },
|
|
340
|
-
defaultResponseActions.receive,
|
|
341
|
-
{ type: getSingleDeployment.fulfilled.type },
|
|
342
|
-
{ type: updateDeploymentControlMap.fulfilled.type }
|
|
343
|
-
];
|
|
344
|
-
return store.dispatch(updateDeploymentControlMap({ deploymentId: createdDeployment.id, updateControlMap: { something: 'continue' } })).then(() => {
|
|
345
|
-
const storeActions = store.getActions();
|
|
346
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
347
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
348
|
-
});
|
|
349
|
-
});
|
|
350
|
-
it('should allow deployment state tracking', async () => {
|
|
351
|
-
const store = mockStore({ ...defaultState });
|
|
352
|
-
await store.dispatch(
|
|
353
|
-
setDeploymentsState({
|
|
354
|
-
general: { showCreationDialog: true },
|
|
355
|
-
[DeploymentConstants.DEPLOYMENT_STATES.finished]: { something: 'new' },
|
|
356
|
-
selectedId: createdDeployment.id
|
|
357
|
-
})
|
|
358
|
-
);
|
|
359
|
-
const expectedActions = [
|
|
360
|
-
{ type: setDeploymentsState.pending.type },
|
|
361
|
-
{
|
|
362
|
-
type: actions.setDeploymentsState.type,
|
|
363
|
-
payload: {
|
|
364
|
-
...defaultState.deployments.selectionState,
|
|
365
|
-
finished: {
|
|
366
|
-
...defaultState.deployments.selectionState.finished,
|
|
367
|
-
something: 'new'
|
|
368
|
-
},
|
|
369
|
-
general: {
|
|
370
|
-
...defaultState.deployments.selectionState.general,
|
|
371
|
-
showCreationDialog: true
|
|
372
|
-
},
|
|
373
|
-
selectedId: createdDeployment.id
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
{ type: getSingleDeployment.pending.type },
|
|
377
|
-
defaultResponseActions.receive,
|
|
378
|
-
{ type: getSingleDeployment.fulfilled.type },
|
|
379
|
-
{ type: setDeploymentsState.fulfilled.type }
|
|
380
|
-
];
|
|
381
|
-
const storeActions = store.getActions();
|
|
382
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
383
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
it('should allow retrieving config for deployments', async () => {
|
|
387
|
-
const store = mockStore({ ...defaultState });
|
|
388
|
-
const expectedActions = [
|
|
389
|
-
{ type: getDeploymentsConfig.pending.type },
|
|
390
|
-
{ type: actions.setDeploymentsConfig.type, payload: deploymentsConfig },
|
|
391
|
-
{ type: getDeploymentsConfig.fulfilled.type }
|
|
392
|
-
];
|
|
393
|
-
return store.dispatch(getDeploymentsConfig()).then(() => {
|
|
394
|
-
const storeActions = store.getActions();
|
|
395
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
396
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
397
|
-
});
|
|
398
|
-
});
|
|
399
|
-
it('should allow storing delta deployments settings', async () => {
|
|
400
|
-
const store = mockStore({ ...defaultState });
|
|
401
|
-
const changedConfig = {
|
|
402
|
-
timeout: 100,
|
|
403
|
-
duplicatesWindow: 734,
|
|
404
|
-
compressionLevel: 5,
|
|
405
|
-
disableChecksum: true,
|
|
406
|
-
disableDecompression: false,
|
|
407
|
-
inputWindow: 1253,
|
|
408
|
-
instructionBuffer: 123,
|
|
409
|
-
sourceWindow: 13
|
|
410
|
-
};
|
|
411
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
412
|
-
const { hasDelta, ...expectedConfig } = deploymentsConfig;
|
|
413
|
-
const expectedActions = [
|
|
414
|
-
{ type: saveDeltaDeploymentsConfig.pending.type },
|
|
415
|
-
{ type: actions.setDeploymentsConfig.type, payload: { ...expectedConfig, binaryDelta: { ...expectedConfig.binaryDelta, ...changedConfig } } },
|
|
416
|
-
{ ...defaultResponseActions.setSnackbar, payload: 'Settings saved successfully' },
|
|
417
|
-
{ type: saveDeltaDeploymentsConfig.fulfilled.type }
|
|
418
|
-
];
|
|
419
|
-
return store.dispatch(saveDeltaDeploymentsConfig(changedConfig)).then(() => {
|
|
420
|
-
const storeActions = store.getActions();
|
|
421
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
422
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
423
|
-
});
|
|
424
|
-
});
|
|
425
|
-
});
|