@northern.tech/store 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.d.mts +95 -0
- package/dist/actions.d.ts +95 -0
- package/dist/actions.js +1746 -0
- package/dist/actions.js.map +1 -0
- package/dist/actions.mjs +21 -0
- package/dist/actions.mjs.map +1 -0
- package/dist/api/general-api.d.mts +21 -0
- package/dist/api/general-api.d.ts +21 -0
- package/dist/api/general-api.js +1002 -0
- package/dist/api/general-api.js.map +1 -0
- package/dist/api/general-api.mjs +18 -0
- package/dist/api/general-api.mjs.map +1 -0
- package/dist/api/types/Address.ts +6 -0
- package/dist/api/types/AddressUpdate.ts +12 -0
- package/dist/api/types/AuthSet.ts +37 -0
- package/{api/types/AuthSet.ts → dist/api/types/AuthSetIot_manager.ts} +2 -2
- package/dist/api/types/BillingProfile.ts +37 -0
- package/dist/api/types/BillingProfileUpdate.ts +37 -0
- package/{api → dist/api}/types/BinaryDeltaLimits.ts +6 -0
- package/{api → dist/api}/types/BoundingBox.ts +1 -3
- package/dist/api/types/Deployment.ts +45 -0
- package/{api → dist/api}/types/DeploymentAggregation.ts +1 -3
- package/{api → dist/api}/types/DeploymentAggregationItem.ts +1 -3
- package/{api → dist/api}/types/DeploymentAggregationTerm.ts +1 -2
- package/{api → dist/api}/types/DeploymentAggregationTerms.ts +1 -3
- package/{api → dist/api}/types/DeploymentAttributeProjection.ts +1 -2
- package/{api → dist/api}/types/DeploymentDeployments.ts +4 -5
- package/{api → dist/api}/types/DeploymentFilterTerm.ts +1 -3
- package/dist/api/types/DeploymentPhaseDeployments.ts +23 -0
- package/{api → dist/api}/types/DeploymentSearchTerms.ts +1 -3
- package/{api → dist/api}/types/DeploymentSortTerm.ts +1 -3
- package/dist/api/types/DeploymentStatisticsDeployments.ts +15 -0
- package/dist/api/types/DeploymentStatusStatisticsDeployments.ts +54 -0
- package/dist/api/types/Device.ts +20 -0
- package/{api → dist/api}/types/DeviceAggregation.ts +1 -3
- package/{api → dist/api}/types/DeviceAggregationItem.ts +1 -3
- package/{api → dist/api}/types/DeviceAggregationTerm.ts +1 -2
- package/{api → dist/api}/types/DeviceAggregationTerms.ts +1 -3
- package/{api → dist/api}/types/DeviceAttribute.ts +1 -2
- package/{api → dist/api}/types/DeviceAttributeProjection.ts +1 -2
- package/{api/types/Device.ts → dist/api/types/DeviceDeployments.ts} +1 -1
- package/{api → dist/api}/types/DeviceFilterAttribute.ts +1 -2
- package/{api → dist/api}/types/DeviceFilterTerm.ts +1 -3
- package/{api → dist/api}/types/DeviceSearchTerms.ts +1 -3
- package/{api → dist/api}/types/DeviceSortTerm.ts +1 -3
- package/{api → dist/api}/types/Error.ts +1 -1
- package/{api/types/FilterInventory.ts → dist/api/types/Filter.ts} +3 -4
- package/{api/types/Filter.ts → dist/api/types/FilterInventory.ts} +1 -1
- package/dist/api/types/FilterPredicate.ts +48 -0
- package/{api/types/FilterPredicate.ts → dist/api/types/FilterPredicateInventory.ts} +3 -3
- package/{api → dist/api}/types/GeoBoundingBox.ts +1 -3
- package/{api → dist/api}/types/GeoBoundingBoxFilter.ts +1 -2
- package/{api → dist/api}/types/GeoDistance.ts +1 -3
- package/{api → dist/api}/types/GeoDistanceFilter.ts +1 -3
- package/{api → dist/api}/types/GeoPoint.ts +1 -2
- package/{api → dist/api}/types/Integration.ts +6 -0
- package/{api → dist/api}/types/MenderTypes.ts +41 -11
- package/{api → dist/api}/types/NewDeploymentV2.ts +3 -0
- package/{api → dist/api}/types/NewTenant.ts +16 -8
- package/{api → dist/api}/types/Object.ts +3 -0
- package/{api → dist/api}/types/PreAuthSet.ts +1 -1
- package/{api → dist/api}/types/Settings.ts +3 -3
- package/{api → dist/api}/types/Status.ts +5 -4
- package/{api → dist/api}/types/StatusTenantadm.ts +1 -3
- package/dist/api/types/Tenant.ts +21 -0
- package/{api → dist/api}/types/TenantTenantadm.ts +16 -0
- package/dist/api/types/UpdateChildTenant.ts +17 -0
- package/{api → dist/api}/types/UpdateDeployments.ts +1 -1
- package/{api → dist/api}/types/UpgradeCompleteRequest.ts +2 -0
- package/{api → dist/api}/types/UserWithTenantInfo.ts +7 -3
- package/dist/api/users-api.d.mts +16 -0
- package/dist/api/users-api.d.ts +16 -0
- package/dist/api/users-api.js +1026 -0
- package/dist/api/users-api.js.map +1 -0
- package/dist/api/users-api.mjs +15 -0
- package/dist/api/users-api.mjs.map +1 -0
- package/dist/appSlice/constants.d.mts +210 -0
- package/dist/appSlice/constants.d.ts +210 -0
- package/dist/appSlice/constants.js +221 -0
- package/dist/appSlice/constants.js.map +1 -0
- package/dist/appSlice/constants.mjs +42 -0
- package/dist/appSlice/constants.mjs.map +1 -0
- package/dist/appSlice/index.d.mts +1557 -0
- package/dist/appSlice/index.d.ts +1557 -0
- package/dist/appSlice/index.js +1067 -0
- package/dist/appSlice/index.js.map +1 -0
- package/dist/appSlice/index.mjs +21 -0
- package/dist/appSlice/index.mjs.map +1 -0
- package/dist/appSlice/selectors.d.mts +91 -0
- package/dist/appSlice/selectors.d.ts +91 -0
- package/dist/appSlice/selectors.js +90 -0
- package/dist/appSlice/selectors.js.map +1 -0
- package/dist/appSlice/selectors.mjs +20 -0
- package/dist/appSlice/selectors.mjs.map +1 -0
- package/dist/appSlice/thunks.d.mts +46 -0
- package/dist/appSlice/thunks.d.ts +46 -0
- package/dist/appSlice/thunks.js +5655 -0
- package/dist/appSlice/thunks.js.map +1 -0
- package/dist/appSlice/thunks.mjs +45 -0
- package/dist/appSlice/thunks.mjs.map +1 -0
- package/dist/auth.d.mts +17 -0
- package/dist/auth.d.ts +17 -0
- package/dist/auth.js +985 -0
- package/dist/auth.js.map +1 -0
- package/dist/auth.mjs +23 -0
- package/dist/auth.mjs.map +1 -0
- package/dist/chunk-6667TCAJ.mjs +135 -0
- package/dist/chunk-6667TCAJ.mjs.map +1 -0
- package/{releasesSlice/index.ts → dist/chunk-7E7KJHY3.mjs} +33 -32
- package/dist/chunk-7E7KJHY3.mjs.map +1 -0
- package/{usersSlice/index.ts → dist/chunk-BJSH2G7W.mjs} +39 -58
- package/dist/chunk-BJSH2G7W.mjs.map +1 -0
- package/dist/chunk-BOSBROA3.mjs +168 -0
- package/dist/chunk-BOSBROA3.mjs.map +1 -0
- package/dist/chunk-BRHSKNFC.mjs +70 -0
- package/dist/chunk-BRHSKNFC.mjs.map +1 -0
- package/dist/chunk-C2YZYTJ6.mjs +37 -0
- package/dist/chunk-C2YZYTJ6.mjs.map +1 -0
- package/dist/chunk-DZBVTSIX.mjs +55 -0
- package/dist/chunk-DZBVTSIX.mjs.map +1 -0
- package/{appSlice/index.ts → dist/chunk-F37LUTBX.mjs} +58 -68
- package/dist/chunk-F37LUTBX.mjs.map +1 -0
- package/dist/chunk-G32LAKW4.mjs +239 -0
- package/dist/chunk-G32LAKW4.mjs.map +1 -0
- package/dist/chunk-G3I53JGW.mjs +243 -0
- package/dist/chunk-G3I53JGW.mjs.map +1 -0
- package/dist/chunk-G4FGNSV3.mjs +13 -0
- package/dist/chunk-G4FGNSV3.mjs.map +1 -0
- package/dist/chunk-G7LATUT6.mjs +110 -0
- package/dist/chunk-G7LATUT6.mjs.map +1 -0
- package/dist/chunk-H2PQQMRY.mjs +7 -0
- package/dist/chunk-H2PQQMRY.mjs.map +1 -0
- package/{devicesSlice/index.ts → dist/chunk-HRWZJQMH.mjs} +57 -77
- package/dist/chunk-HRWZJQMH.mjs.map +1 -0
- package/dist/chunk-HVHZG2H4.mjs +56 -0
- package/dist/chunk-HVHZG2H4.mjs.map +1 -0
- package/dist/chunk-HXPYJ6QN.mjs +75 -0
- package/dist/chunk-HXPYJ6QN.mjs.map +1 -0
- package/dist/chunk-IPPIKGIB.mjs +35 -0
- package/dist/chunk-IPPIKGIB.mjs.map +1 -0
- package/dist/chunk-IU4OXOPA.mjs +46 -0
- package/dist/chunk-IU4OXOPA.mjs.map +1 -0
- package/dist/chunk-IVSYYXTC.mjs +36 -0
- package/dist/chunk-IVSYYXTC.mjs.map +1 -0
- package/{onboardingSlice/index.ts → dist/chunk-M4U5R7A4.mjs} +19 -22
- package/dist/chunk-M4U5R7A4.mjs.map +1 -0
- package/dist/chunk-N7G6QK2E.mjs +414 -0
- package/dist/chunk-N7G6QK2E.mjs.map +1 -0
- package/dist/chunk-O6O3D52B.mjs +39 -0
- package/dist/chunk-O6O3D52B.mjs.map +1 -0
- package/dist/chunk-QBKCUIWO.mjs +7 -0
- package/dist/chunk-QBKCUIWO.mjs.map +1 -0
- package/dist/chunk-R2GBNXLV.mjs +57 -0
- package/dist/chunk-R2GBNXLV.mjs.map +1 -0
- package/dist/chunk-RH6ONMG7.mjs +65 -0
- package/dist/chunk-RH6ONMG7.mjs.map +1 -0
- package/dist/chunk-RQOE5OOT.mjs +284 -0
- package/dist/chunk-RQOE5OOT.mjs.map +1 -0
- package/dist/chunk-TD45YTYK.mjs +108 -0
- package/dist/chunk-TD45YTYK.mjs.map +1 -0
- package/dist/chunk-V32GTKOS.mjs +1 -0
- package/dist/chunk-V32GTKOS.mjs.map +1 -0
- package/dist/chunk-XWBD7VOK.mjs +93 -0
- package/dist/chunk-XWBD7VOK.mjs.map +1 -0
- package/dist/chunk-XYVPYFSM.mjs +106 -0
- package/dist/chunk-XYVPYFSM.mjs.map +1 -0
- package/dist/chunk-YNVSU3AA.mjs +2977 -0
- package/dist/chunk-YNVSU3AA.mjs.map +1 -0
- package/dist/chunk-ZIYGEXSJ.mjs +145 -0
- package/dist/chunk-ZIYGEXSJ.mjs.map +1 -0
- package/dist/chunk-ZNST5R6O.mjs +658 -0
- package/dist/chunk-ZNST5R6O.mjs.map +1 -0
- package/dist/commonConstants.d.mts +248 -0
- package/dist/commonConstants.d.ts +248 -0
- package/dist/commonConstants.js +303 -0
- package/dist/commonConstants.js.map +1 -0
- package/dist/commonConstants.mjs +40 -0
- package/dist/commonConstants.mjs.map +1 -0
- package/dist/commonSelectors.d.mts +896 -0
- package/dist/commonSelectors.d.ts +896 -0
- package/dist/commonSelectors.js +1482 -0
- package/dist/commonSelectors.js.map +1 -0
- package/dist/commonSelectors.mjs +54 -0
- package/dist/commonSelectors.mjs.map +1 -0
- package/dist/constants.d.mts +12 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +1246 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +219 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/deploymentsSlice/constants.d.mts +142 -0
- package/dist/deploymentsSlice/constants.d.ts +142 -0
- package/dist/deploymentsSlice/constants.js +969 -0
- package/dist/deploymentsSlice/constants.js.map +1 -0
- package/dist/deploymentsSlice/constants.mjs +42 -0
- package/dist/deploymentsSlice/constants.mjs.map +1 -0
- package/dist/deploymentsSlice/index.d.mts +2373 -0
- package/dist/deploymentsSlice/index.d.ts +2373 -0
- package/dist/deploymentsSlice/index.js +1053 -0
- package/dist/deploymentsSlice/index.js.map +1 -0
- package/dist/deploymentsSlice/index.mjs +21 -0
- package/dist/deploymentsSlice/index.mjs.map +1 -0
- package/dist/deploymentsSlice/selectors.d.mts +59 -0
- package/dist/deploymentsSlice/selectors.d.ts +59 -0
- package/dist/deploymentsSlice/selectors.js +969 -0
- package/dist/deploymentsSlice/selectors.js.map +1 -0
- package/dist/deploymentsSlice/selectors.mjs +25 -0
- package/dist/deploymentsSlice/selectors.mjs.map +1 -0
- package/dist/deploymentsSlice/thunks.d.mts +202 -0
- package/dist/deploymentsSlice/thunks.d.ts +202 -0
- package/dist/deploymentsSlice/thunks.js +5671 -0
- package/dist/deploymentsSlice/thunks.js.map +1 -0
- package/dist/deploymentsSlice/thunks.mjs +63 -0
- package/dist/deploymentsSlice/thunks.mjs.map +1 -0
- package/dist/devicesSlice/constants.d.mts +44 -0
- package/dist/devicesSlice/constants.d.ts +44 -0
- package/dist/devicesSlice/constants.js +969 -0
- package/dist/devicesSlice/constants.js.map +1 -0
- package/dist/devicesSlice/constants.mjs +40 -0
- package/dist/devicesSlice/constants.mjs.map +1 -0
- package/dist/devicesSlice/index.d.mts +2223 -0
- package/dist/devicesSlice/index.d.ts +2223 -0
- package/dist/devicesSlice/index.js +1109 -0
- package/dist/devicesSlice/index.js.map +1 -0
- package/dist/devicesSlice/index.mjs +21 -0
- package/dist/devicesSlice/index.mjs.map +1 -0
- package/dist/devicesSlice/selectors.d.mts +261 -0
- package/dist/devicesSlice/selectors.d.ts +261 -0
- package/dist/devicesSlice/selectors.js +1084 -0
- package/dist/devicesSlice/selectors.js.map +1 -0
- package/dist/devicesSlice/selectors.mjs +53 -0
- package/dist/devicesSlice/selectors.mjs.map +1 -0
- package/dist/devicesSlice/thunks.d.mts +742 -0
- package/dist/devicesSlice/thunks.d.ts +742 -0
- package/dist/devicesSlice/thunks.js +5743 -0
- package/dist/devicesSlice/thunks.js.map +1 -0
- package/dist/devicesSlice/thunks.mjs +135 -0
- package/dist/devicesSlice/thunks.mjs.map +1 -0
- package/dist/monitorSlice/constants.d.mts +6 -0
- package/dist/monitorSlice/constants.d.ts +6 -0
- package/dist/monitorSlice/constants.js +919 -0
- package/dist/monitorSlice/constants.js.map +1 -0
- package/dist/monitorSlice/constants.mjs +14 -0
- package/dist/monitorSlice/constants.mjs.map +1 -0
- package/dist/monitorSlice/index.d.mts +291 -0
- package/dist/monitorSlice/index.d.ts +291 -0
- package/dist/monitorSlice/index.js +971 -0
- package/dist/monitorSlice/index.js.map +1 -0
- package/dist/monitorSlice/index.mjs +21 -0
- package/dist/monitorSlice/index.mjs.map +1 -0
- package/dist/monitorSlice/selectors.d.mts +3 -0
- package/dist/monitorSlice/selectors.d.ts +3 -0
- package/dist/monitorSlice/selectors.js +31 -0
- package/dist/monitorSlice/selectors.js.map +1 -0
- package/dist/monitorSlice/selectors.mjs +8 -0
- package/dist/monitorSlice/selectors.mjs.map +1 -0
- package/dist/monitorSlice/thunks.d.mts +71 -0
- package/dist/monitorSlice/thunks.d.ts +71 -0
- package/dist/monitorSlice/thunks.js +2531 -0
- package/dist/monitorSlice/thunks.js.map +1 -0
- package/dist/monitorSlice/thunks.mjs +44 -0
- package/dist/monitorSlice/thunks.mjs.map +1 -0
- package/dist/onboardingSlice/constants.d.mts +23 -0
- package/dist/onboardingSlice/constants.d.ts +23 -0
- package/dist/onboardingSlice/constants.js +71 -0
- package/dist/onboardingSlice/constants.js.map +1 -0
- package/dist/onboardingSlice/constants.mjs +10 -0
- package/dist/onboardingSlice/constants.mjs.map +1 -0
- package/dist/onboardingSlice/index.d.mts +237 -0
- package/dist/onboardingSlice/index.d.ts +237 -0
- package/dist/onboardingSlice/index.js +94 -0
- package/dist/onboardingSlice/index.js.map +1 -0
- package/dist/onboardingSlice/index.mjs +16 -0
- package/dist/onboardingSlice/index.mjs.map +1 -0
- package/dist/onboardingSlice/selectors.d.mts +3 -0
- package/dist/onboardingSlice/selectors.d.ts +3 -0
- package/dist/onboardingSlice/selectors.js +31 -0
- package/dist/onboardingSlice/selectors.js.map +1 -0
- package/dist/onboardingSlice/selectors.mjs +8 -0
- package/dist/onboardingSlice/selectors.mjs.map +1 -0
- package/dist/onboardingSlice/thunks.d.mts +172 -0
- package/dist/onboardingSlice/thunks.d.ts +172 -0
- package/dist/onboardingSlice/thunks.js +5661 -0
- package/dist/onboardingSlice/thunks.js.map +1 -0
- package/dist/onboardingSlice/thunks.mjs +51 -0
- package/dist/onboardingSlice/thunks.mjs.map +1 -0
- package/dist/organizationSlice/constants.d.mts +134 -0
- package/dist/organizationSlice/constants.d.ts +134 -0
- package/dist/organizationSlice/constants.js +978 -0
- package/dist/organizationSlice/constants.js.map +1 -0
- package/dist/organizationSlice/constants.mjs +34 -0
- package/dist/organizationSlice/constants.mjs.map +1 -0
- package/dist/organizationSlice/index.d.mts +1097 -0
- package/dist/organizationSlice/index.d.ts +1097 -0
- package/dist/organizationSlice/index.js +1015 -0
- package/dist/organizationSlice/index.js.map +1 -0
- package/dist/organizationSlice/index.mjs +21 -0
- package/dist/organizationSlice/index.mjs.map +1 -0
- package/dist/organizationSlice/selectors.d.mts +134 -0
- package/dist/organizationSlice/selectors.d.ts +134 -0
- package/dist/organizationSlice/selectors.js +977 -0
- package/dist/organizationSlice/selectors.js.map +1 -0
- package/dist/organizationSlice/selectors.mjs +39 -0
- package/dist/organizationSlice/selectors.mjs.map +1 -0
- package/dist/organizationSlice/thunks.d.mts +502 -0
- package/dist/organizationSlice/thunks.d.ts +502 -0
- package/dist/organizationSlice/thunks.js +5709 -0
- package/dist/organizationSlice/thunks.js.map +1 -0
- package/dist/organizationSlice/thunks.mjs +101 -0
- package/dist/organizationSlice/thunks.mjs.map +1 -0
- package/dist/releasesSlice/constants.d.mts +14 -0
- package/dist/releasesSlice/constants.d.ts +14 -0
- package/dist/releasesSlice/constants.js +40 -0
- package/dist/releasesSlice/constants.js.map +1 -0
- package/dist/releasesSlice/constants.mjs +14 -0
- package/dist/releasesSlice/constants.mjs.map +1 -0
- package/dist/releasesSlice/index.d.mts +483 -0
- package/dist/releasesSlice/index.d.ts +483 -0
- package/dist/releasesSlice/index.js +1034 -0
- package/dist/releasesSlice/index.js.map +1 -0
- package/dist/releasesSlice/index.mjs +21 -0
- package/dist/releasesSlice/index.mjs.map +1 -0
- package/dist/releasesSlice/selectors.d.mts +92 -0
- package/dist/releasesSlice/selectors.d.ts +92 -0
- package/dist/releasesSlice/selectors.js +967 -0
- package/dist/releasesSlice/selectors.js.map +1 -0
- package/dist/releasesSlice/selectors.mjs +28 -0
- package/dist/releasesSlice/selectors.mjs.map +1 -0
- package/dist/releasesSlice/thunks.d.mts +276 -0
- package/dist/releasesSlice/thunks.d.ts +276 -0
- package/dist/releasesSlice/thunks.js +2843 -0
- package/dist/releasesSlice/thunks.js.map +1 -0
- package/dist/releasesSlice/thunks.mjs +66 -0
- package/dist/releasesSlice/thunks.mjs.map +1 -0
- package/dist/selectors.d.mts +10 -0
- package/dist/selectors.d.ts +10 -0
- package/dist/selectors.js +1636 -0
- package/dist/selectors.js.map +1 -0
- package/dist/selectors.mjs +207 -0
- package/dist/selectors.mjs.map +1 -0
- package/dist/store.d.mts +2306 -0
- package/dist/store.d.ts +2306 -0
- package/dist/store.js +1877 -0
- package/dist/store.js.map +1 -0
- package/dist/store.mjs +32 -0
- package/dist/store.mjs.map +1 -0
- package/dist/storehooks.d.mts +4 -0
- package/dist/storehooks.d.ts +4 -0
- package/dist/storehooks.js +5844 -0
- package/dist/storehooks.js.map +1 -0
- package/dist/storehooks.mjs +265 -0
- package/dist/storehooks.mjs.map +1 -0
- package/dist/thunks.d.mts +12 -0
- package/dist/thunks.d.ts +12 -0
- package/dist/thunks.js +5973 -0
- package/dist/thunks.js.map +1 -0
- package/dist/thunks.mjs +363 -0
- package/dist/thunks.mjs.map +1 -0
- package/dist/usersSlice/constants.d.mts +635 -0
- package/dist/usersSlice/constants.d.ts +635 -0
- package/dist/usersSlice/constants.js +967 -0
- package/dist/usersSlice/constants.js.map +1 -0
- package/dist/usersSlice/constants.mjs +43 -0
- package/dist/usersSlice/constants.mjs.map +1 -0
- package/dist/usersSlice/index.d.mts +6993 -0
- package/dist/usersSlice/index.d.ts +6993 -0
- package/dist/usersSlice/index.js +1054 -0
- package/dist/usersSlice/index.js.map +1 -0
- package/dist/usersSlice/index.mjs +21 -0
- package/dist/usersSlice/index.mjs.map +1 -0
- package/dist/usersSlice/selectors.d.mts +209 -0
- package/dist/usersSlice/selectors.d.ts +209 -0
- package/dist/usersSlice/selectors.js +997 -0
- package/dist/usersSlice/selectors.js.map +1 -0
- package/dist/usersSlice/selectors.mjs +38 -0
- package/dist/usersSlice/selectors.mjs.map +1 -0
- package/dist/usersSlice/thunks.d.mts +881 -0
- package/dist/usersSlice/thunks.d.ts +881 -0
- package/dist/usersSlice/thunks.js +5717 -0
- package/dist/usersSlice/thunks.js.map +1 -0
- package/dist/usersSlice/thunks.mjs +109 -0
- package/dist/usersSlice/thunks.mjs.map +1 -0
- package/dist/utils.d.mts +60 -0
- package/dist/utils.d.ts +60 -0
- package/dist/utils.js +1160 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +49 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +14 -2
- package/.eslintrc.cjs +0 -9
- package/.prettierignore +0 -1
- package/CHANGELOG.md +0 -2
- package/actions.ts +0 -32
- package/api/general-api.test.ts +0 -51
- package/api/general-api.ts +0 -60
- package/api/types/Deployment.ts +0 -95
- package/api/types/DeviceDeployments.ts +0 -31
- package/api/types/FilterPredicateInventory.ts +0 -76
- package/api/types/Tenant.ts +0 -38
- package/api/users-api.ts +0 -34
- package/appSlice/constants.ts +0 -166
- package/appSlice/reducer.test.ts +0 -97
- package/appSlice/selectors.ts +0 -33
- package/appSlice/thunks.test.ts +0 -118
- package/appSlice/thunks.ts +0 -148
- package/auth.test.ts +0 -36
- package/auth.ts +0 -82
- package/commonConstants.tsx +0 -252
- package/commonSelectors.ts +0 -255
- package/constants.ts +0 -22
- package/deploymentsSlice/constants.ts +0 -175
- package/deploymentsSlice/index.ts +0 -145
- package/deploymentsSlice/reducer.test.ts +0 -108
- package/deploymentsSlice/selectors.ts +0 -58
- package/deploymentsSlice/thunks.test.ts +0 -425
- package/deploymentsSlice/thunks.ts +0 -382
- package/devicesSlice/constants.ts +0 -56
- package/devicesSlice/reducer.test.ts +0 -194
- package/devicesSlice/selectors.ts +0 -127
- package/devicesSlice/thunks.test.tsx +0 -1245
- package/devicesSlice/thunks.tsx +0 -1098
- package/monitorSlice/constants.ts +0 -17
- package/monitorSlice/index.ts +0 -65
- package/monitorSlice/reducer.test.ts +0 -79
- package/monitorSlice/selectors.ts +0 -15
- package/monitorSlice/thunks.test.ts +0 -112
- package/monitorSlice/thunks.ts +0 -101
- package/onboardingSlice/constants.ts +0 -53
- package/onboardingSlice/reducer.test.ts +0 -45
- package/onboardingSlice/selectors.ts +0 -15
- package/onboardingSlice/thunks.test.ts +0 -235
- package/onboardingSlice/thunks.ts +0 -142
- package/organizationSlice/constants.ts +0 -82
- package/organizationSlice/index.ts +0 -111
- package/organizationSlice/reducer.test.ts +0 -78
- package/organizationSlice/selectors.ts +0 -45
- package/organizationSlice/thunks.test.ts +0 -619
- package/organizationSlice/thunks.ts +0 -383
- package/releasesSlice/constants.ts +0 -18
- package/releasesSlice/reducer.test.ts +0 -78
- package/releasesSlice/selectors.ts +0 -33
- package/releasesSlice/thunks.test.ts +0 -389
- package/releasesSlice/thunks.ts +0 -379
- package/selectors.ts +0 -22
- package/store.ts +0 -89
- package/storehooks.test.tsx +0 -386
- package/storehooks.ts +0 -250
- package/thunks.ts +0 -21
- package/tsconfig.json +0 -11
- package/tsup.config.ts +0 -11
- package/usersSlice/constants.ts +0 -374
- package/usersSlice/reducer.test.ts +0 -141
- package/usersSlice/selectors.ts +0 -60
- package/usersSlice/thunks.test.ts +0 -660
- package/usersSlice/thunks.ts +0 -782
- package/utils.test.ts +0 -187
- package/utils.ts +0 -249
- /package/{api → dist/api}/types/AWSCredentials.ts +0 -0
- /package/{api → dist/api}/types/Actor.ts +0 -0
- /package/{api → dist/api}/types/Addon.ts +0 -0
- /package/{api → dist/api}/types/AddonTenantadm.ts +0 -0
- /package/{api → dist/api}/types/Alert.ts +0 -0
- /package/{api → dist/api}/types/AlertDetails.ts +0 -0
- /package/{api → dist/api}/types/AlertSubject.ts +0 -0
- /package/{api → dist/api}/types/ApiBurst.ts +0 -0
- /package/{api → dist/api}/types/ApiBurstTenantadm.ts +0 -0
- /package/{api → dist/api}/types/ApiLimits.ts +0 -0
- /package/{api → dist/api}/types/ApiLimitsTenantadm.ts +0 -0
- /package/{api → dist/api}/types/ApiQuota.ts +0 -0
- /package/{api → dist/api}/types/ApiQuotaTenantadm.ts +0 -0
- /package/{api → dist/api}/types/Artifact.ts +0 -0
- /package/{api → dist/api}/types/ArtifactDeployments.ts +0 -0
- /package/{api → dist/api}/types/ArtifactInfo.ts +0 -0
- /package/{api → dist/api}/types/ArtifactInfoDeployments.ts +0 -0
- /package/{api → dist/api}/types/ArtifactLink.ts +0 -0
- /package/{api → dist/api}/types/ArtifactTypeInfo.ts +0 -0
- /package/{api → dist/api}/types/ArtifactTypeInfoDeployments.ts +0 -0
- /package/{api → dist/api}/types/ArtifactUpdate.ts +0 -0
- /package/{api → dist/api}/types/ArtifactUploadLink.ts +0 -0
- /package/{api → dist/api}/types/Attribute.ts +0 -0
- /package/{api → dist/api}/types/AttributeInventory.ts +0 -0
- /package/{api → dist/api}/types/AuditLog.ts +0 -0
- /package/{api → dist/api}/types/AuthSetDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/AutoAuthRequest.ts +0 -0
- /package/{api → dist/api}/types/AzureSharedAccessSecret.ts +0 -0
- /package/{api → dist/api}/types/BillingInfo.ts +0 -0
- /package/{api → dist/api}/types/BinaryDeltaConfiguration.ts +0 -0
- /package/{api → dist/api}/types/BinaryDeltaConfigurationDeployments.ts +0 -0
- /package/{api → dist/api}/types/BinaryDeltaLimitsDeployments.ts +0 -0
- /package/{api → dist/api}/types/CancelRequest.ts +0 -0
- /package/{api → dist/api}/types/CardData.ts +0 -0
- /package/{api → dist/api}/types/CardSetupData.ts +0 -0
- /package/{api → dist/api}/types/CheckoutData.ts +0 -0
- /package/{api → dist/api}/types/Configuration.ts +0 -0
- /package/{api → dist/api}/types/Count.ts +0 -0
- /package/{api → dist/api}/types/Credentials.ts +0 -0
- /package/{api → dist/api}/types/DBusSubsystem.ts +0 -0
- /package/{api → dist/api}/types/DeltaConfiguration.ts +0 -0
- /package/{api → dist/api}/types/DeltaConfigurationDeployments.ts +0 -0
- /package/{api → dist/api}/types/DeploymentAuditlogs.ts +0 -0
- /package/{api → dist/api}/types/DeploymentIdentifier.ts +0 -0
- /package/{api → dist/api}/types/DeploymentPhase.ts +0 -0
- /package/{api → dist/api}/types/DeploymentReporting.ts +0 -0
- /package/{api → dist/api}/types/DeploymentStatistics.ts +0 -0
- /package/{api → dist/api}/types/DeploymentStatusStatistics.ts +0 -0
- /package/{api → dist/api}/types/DeviceAuditlogs.ts +0 -0
- /package/{api → dist/api}/types/DeviceAuthEvent.ts +0 -0
- /package/{api → dist/api}/types/DeviceConfiguration.ts +0 -0
- /package/{api → dist/api}/types/DeviceDeployment.ts +0 -0
- /package/{api → dist/api}/types/DeviceDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/DeviceInventory.ts +0 -0
- /package/{api → dist/api}/types/DeviceInventoryInventory.ts +0 -0
- /package/{api → dist/api}/types/DeviceReporting.ts +0 -0
- /package/{api → dist/api}/types/DeviceState.ts +0 -0
- /package/{api → dist/api}/types/DeviceStateDeviceconnect.ts +0 -0
- /package/{api → dist/api}/types/DeviceStateIot_manager.ts +0 -0
- /package/{api → dist/api}/types/DeviceStatus.ts +0 -0
- /package/{api → dist/api}/types/DeviceWithImage.ts +0 -0
- /package/{api → dist/api}/types/DirectUploadMetadata.ts +0 -0
- /package/{api → dist/api}/types/EmailVerificationCompletion.ts +0 -0
- /package/{api → dist/api}/types/EmailVerificationRequest.ts +0 -0
- /package/{api → dist/api}/types/ErrorAuditlogs.ts +0 -0
- /package/{api → dist/api}/types/ErrorDeployments.ts +0 -0
- /package/{api → dist/api}/types/ErrorDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/ErrorDeviceconfig.ts +0 -0
- /package/{api → dist/api}/types/ErrorDeviceconnect.ts +0 -0
- /package/{api → dist/api}/types/ErrorDevicemonitor.ts +0 -0
- /package/{api → dist/api}/types/ErrorExt.ts +0 -0
- /package/{api → dist/api}/types/ErrorInventory.ts +0 -0
- /package/{api → dist/api}/types/ErrorIot_manager.ts +0 -0
- /package/{api → dist/api}/types/ErrorNotFound.ts +0 -0
- /package/{api → dist/api}/types/ErrorReporting.ts +0 -0
- /package/{api → dist/api}/types/ErrorTenantadm.ts +0 -0
- /package/{api → dist/api}/types/ErrorUseradm.ts +0 -0
- /package/{api → dist/api}/types/Event.ts +0 -0
- /package/{api → dist/api}/types/ExternalIdentity.ts +0 -0
- /package/{api → dist/api}/types/Features.ts +0 -0
- /package/{api → dist/api}/types/FileUpload.ts +0 -0
- /package/{api → dist/api}/types/FilterAttribute.ts +0 -0
- /package/{api → dist/api}/types/FilterDefinition.ts +0 -0
- /package/{api → dist/api}/types/FilterDeployments.ts +0 -0
- /package/{api → dist/api}/types/FilterPredicateDeployments.ts +0 -0
- /package/{api → dist/api}/types/Group.ts +0 -0
- /package/{api → dist/api}/types/HTTP.ts +0 -0
- /package/{api → dist/api}/types/IdentityData.ts +0 -0
- /package/{api → dist/api}/types/InputParameter.ts +0 -0
- /package/{api → dist/api}/types/JobStatus.ts +0 -0
- /package/{api → dist/api}/types/Limit.ts +0 -0
- /package/{api → dist/api}/types/LimitDeployments.ts +0 -0
- /package/{api → dist/api}/types/LimitDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/LimitUseradm.ts +0 -0
- /package/{api → dist/api}/types/Limits.ts +0 -0
- /package/{api → dist/api}/types/LineDescriptor.ts +0 -0
- /package/{api → dist/api}/types/LogSubsystem.ts +0 -0
- /package/{api → dist/api}/types/LoginOptions.ts +0 -0
- /package/{api → dist/api}/types/ManagementAPIConfiguration.ts +0 -0
- /package/{api → dist/api}/types/MonitorConfiguration.ts +0 -0
- /package/{api → dist/api}/types/NewConfigurationDeployment.ts +0 -0
- /package/{api → dist/api}/types/NewConfigurationDeploymentResponse.ts +0 -0
- /package/{api → dist/api}/types/NewDeployment.ts +0 -0
- /package/{api → dist/api}/types/NewDeploymentForGroup.ts +0 -0
- /package/{api → dist/api}/types/NewDeploymentPhase.ts +0 -0
- /package/{api → dist/api}/types/NewDeploymentPhaseDeployments.ts +0 -0
- /package/{api → dist/api}/types/OwnUserUpdate.ts +0 -0
- /package/{api → dist/api}/types/PasswordResetCompletion.ts +0 -0
- /package/{api → dist/api}/types/PasswordResetRequest.ts +0 -0
- /package/{api → dist/api}/types/Permission.ts +0 -0
- /package/{api → dist/api}/types/PermissionObject.ts +0 -0
- /package/{api → dist/api}/types/PermissionSet.ts +0 -0
- /package/{api → dist/api}/types/PermissionSetWithScope.ts +0 -0
- /package/{api → dist/api}/types/PersonalAccessToken.ts +0 -0
- /package/{api → dist/api}/types/PersonalAccessTokenRequest.ts +0 -0
- /package/{api → dist/api}/types/Plan.ts +0 -0
- /package/{api → dist/api}/types/PlanBindingDetails.ts +0 -0
- /package/{api → dist/api}/types/PlanChangeRequest.ts +0 -0
- /package/{api → dist/api}/types/PlanLimits.ts +0 -0
- /package/{api → dist/api}/types/Release.ts +0 -0
- /package/{api → dist/api}/types/ReleaseDeployments.ts +0 -0
- /package/{api → dist/api}/types/ReleaseUpdate.ts +0 -0
- /package/{api → dist/api}/types/Releases.ts +0 -0
- /package/{api → dist/api}/types/ReleasesDeleteError.ts +0 -0
- /package/{api → dist/api}/types/ReleasesDeployments.ts +0 -0
- /package/{api → dist/api}/types/Role.ts +0 -0
- /package/{api → dist/api}/types/RolePermission.ts +0 -0
- /package/{api → dist/api}/types/RolePermissionObject.ts +0 -0
- /package/{api → dist/api}/types/RoleUseradm.ts +0 -0
- /package/{api → dist/api}/types/SAMLMetadata.ts +0 -0
- /package/{api → dist/api}/types/Scope.ts +0 -0
- /package/{api → dist/api}/types/SelectAttribute.ts +0 -0
- /package/{api → dist/api}/types/ServiceSubsystem.ts +0 -0
- /package/{api → dist/api}/types/SortCriteria.ts +0 -0
- /package/{api → dist/api}/types/SsoObject.ts +0 -0
- /package/{api → dist/api}/types/StatusDeviceauth.ts +0 -0
- /package/{api → dist/api}/types/StorageLimit.ts +0 -0
- /package/{api → dist/api}/types/SubscriptionData.ts +0 -0
- /package/{api → dist/api}/types/SupportRequest.ts +0 -0
- /package/{api → dist/api}/types/Tag.ts +0 -0
- /package/{api → dist/api}/types/Tags.ts +0 -0
- /package/{api → dist/api}/types/TaskResult.ts +0 -0
- /package/{api → dist/api}/types/TaskResultCLI.ts +0 -0
- /package/{api → dist/api}/types/TaskResultHTTPRequest.ts +0 -0
- /package/{api → dist/api}/types/TaskResultHTTPResponse.ts +0 -0
- /package/{api → dist/api}/types/TenantApiLimits.ts +0 -0
- /package/{api → dist/api}/types/TenantApiLimitsTenantadm.ts +0 -0
- /package/{api → dist/api}/types/TenantIdName.ts +0 -0
- /package/{api → dist/api}/types/TenantIdsData.ts +0 -0
- /package/{api → dist/api}/types/TenantInfo.ts +0 -0
- /package/{api → dist/api}/types/TenantShortInfo.ts +0 -0
- /package/{api → dist/api}/types/TenantsIdName.ts +0 -0
- /package/{api → dist/api}/types/Update.ts +0 -0
- /package/{api → dist/api}/types/UpdateFile.ts +0 -0
- /package/{api → dist/api}/types/UpdateFileDeployments.ts +0 -0
- /package/{api → dist/api}/types/UpdateTypes.ts +0 -0
- /package/{api → dist/api}/types/User.ts +0 -0
- /package/{api → dist/api}/types/UserAuditlogs.ts +0 -0
- /package/{api → dist/api}/types/UserNew.ts +0 -0
- /package/{api → dist/api}/types/UserUpdate.ts +0 -0
- /package/{api → dist/api}/types/UserUseradm.ts +0 -0
- /package/{api → dist/api}/types/XDeltaArgs.ts +0 -0
- /package/{api → dist/api}/types/XDeltaArgsDeployments.ts +0 -0
- /package/{api → dist/api}/types/XDeltaArgsLimits.ts +0 -0
- /package/{api → dist/api}/types/XDeltaArgsLimitsDeployments.ts +0 -0
|
@@ -1,45 +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 { EXTERNAL_PROVIDER } from '@northern.tech/store/constants';
|
|
15
|
-
import { createSelector } from '@reduxjs/toolkit';
|
|
16
|
-
|
|
17
|
-
export const getOrganization = state => state.organization.organization;
|
|
18
|
-
export const getExternalIntegrations = state => state.organization.externalDeviceIntegrations;
|
|
19
|
-
export const getAuditlogState = state => state.organization.auditlog.selectionState;
|
|
20
|
-
export const getAuditLog = state => state.organization.auditlog.events;
|
|
21
|
-
export const getAuditLogSelectionState = state => state.organization.auditlog.selectionState;
|
|
22
|
-
export const getSsoConfig = ({ organization: { ssoConfigs = [] } }) => ssoConfigs[0];
|
|
23
|
-
export const getTenantsList = state => state.organization.organization.tenantList;
|
|
24
|
-
export const getWebhookEvents = state => state.organization.webhooks.events;
|
|
25
|
-
export const getWebhookEventTotal = state => state.organization.webhooks.eventTotal;
|
|
26
|
-
|
|
27
|
-
export const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>
|
|
28
|
-
integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)
|
|
29
|
-
);
|
|
30
|
-
export const getIsServiceProvider = state => state.organization.organization.service_provider;
|
|
31
|
-
|
|
32
|
-
export const getWebhooks = createSelector([getExternalIntegrations], integrations =>
|
|
33
|
-
integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)
|
|
34
|
-
);
|
|
35
|
-
export const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>
|
|
36
|
-
webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
export const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {
|
|
40
|
-
if (!selectedId) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const [eventAction, eventTime] = atob(selectedId).split('|');
|
|
44
|
-
return events.find(item => item.action === eventAction && item.time === eventTime);
|
|
45
|
-
});
|
|
@@ -1,619 +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 { EXTERNAL_PROVIDER } from '@northern.tech/store/commonConstants';
|
|
16
|
-
import configureMockStore from 'redux-mock-store';
|
|
17
|
-
import { thunk } from 'redux-thunk';
|
|
18
|
-
|
|
19
|
-
import { actions } from '.';
|
|
20
|
-
import { defaultState, webhookEvents } from '../../../../tests/mockData';
|
|
21
|
-
import { actions as appActions } from '../appSlice';
|
|
22
|
-
import { locations } from '../appSlice/constants';
|
|
23
|
-
import { getSessionInfo } from '../auth';
|
|
24
|
-
import { TIMEOUTS } from '../commonConstants';
|
|
25
|
-
import { SSO_TYPES } from './constants';
|
|
26
|
-
import {
|
|
27
|
-
cancelRequest,
|
|
28
|
-
cancelUpgrade,
|
|
29
|
-
changeIntegration,
|
|
30
|
-
changeSsoConfig,
|
|
31
|
-
completeUpgrade,
|
|
32
|
-
confirmCardUpdate,
|
|
33
|
-
createIntegration,
|
|
34
|
-
createOrganizationTrial,
|
|
35
|
-
deleteIntegration,
|
|
36
|
-
deleteSsoConfig,
|
|
37
|
-
downloadLicenseReport,
|
|
38
|
-
getAuditLogs,
|
|
39
|
-
getAuditLogsCsvLink,
|
|
40
|
-
getCurrentCard,
|
|
41
|
-
getIntegrations,
|
|
42
|
-
getSsoConfigById,
|
|
43
|
-
getSsoConfigs,
|
|
44
|
-
getTargetLocation,
|
|
45
|
-
getUserOrganization,
|
|
46
|
-
getWebhookEvents,
|
|
47
|
-
requestPlanChange,
|
|
48
|
-
sendSupportMessage,
|
|
49
|
-
setAuditlogsState,
|
|
50
|
-
startCardUpdate,
|
|
51
|
-
startUpgrade,
|
|
52
|
-
storeSsoConfig,
|
|
53
|
-
tenantDataDivergedMessage
|
|
54
|
-
} from './thunks';
|
|
55
|
-
|
|
56
|
-
const middlewares = [thunk];
|
|
57
|
-
const mockStore = configureMockStore(middlewares);
|
|
58
|
-
|
|
59
|
-
const expectedDeviceProviders = [
|
|
60
|
-
{ id: 1, provider: EXTERNAL_PROVIDER['iot-hub'].provider, something: 'something', connection_string: 'something_else' },
|
|
61
|
-
{ id: 2, provider: EXTERNAL_PROVIDER['iot-core'].provider, something: 'new' }
|
|
62
|
-
];
|
|
63
|
-
|
|
64
|
-
const expectedSsoConfigs = [
|
|
65
|
-
{ id: '1', issuer: 'https://samltest.id/saml/idp', valid_until: '2038-08-24T21:14:09Z' },
|
|
66
|
-
{ id: '2', issuer: 'https://samltest2.id/saml/idp', valid_until: '2030-10-24T21:14:09Z' }
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
const oldHostname = window.location.hostname;
|
|
70
|
-
|
|
71
|
-
/* eslint-disable sonarjs/no-identical-functions */
|
|
72
|
-
describe('organization actions', () => {
|
|
73
|
-
it('should handle different error message formats', async () => {
|
|
74
|
-
const store = mockStore({ ...defaultState });
|
|
75
|
-
const expectedActions = [
|
|
76
|
-
{ type: cancelRequest.pending.type },
|
|
77
|
-
{ type: appActions.setSnackbar.type, payload: { message: 'Deactivation request was sent successfully', autoHideDuration: TIMEOUTS.fiveSeconds } },
|
|
78
|
-
{ type: cancelRequest.fulfilled.type }
|
|
79
|
-
];
|
|
80
|
-
await store.dispatch(cancelRequest(defaultState.organization.organization.id, 'testReason')).then(() => {
|
|
81
|
-
const storeActions = store.getActions();
|
|
82
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
83
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('should point to proper target locations from different circumstances', () => {
|
|
88
|
-
const expectations = [
|
|
89
|
-
{ hostname: locations.us.location, location: locations.us.key, result: locations.us.location },
|
|
90
|
-
{ hostname: locations.us.location, location: locations.eu.key, result: locations.eu.location },
|
|
91
|
-
{ hostname: locations.eu.location, location: locations.us.key, result: locations.us.location },
|
|
92
|
-
{ hostname: locations.eu.location, location: locations.eu.key, result: locations.eu.location },
|
|
93
|
-
{ hostname: `staging.${locations.us.location}`, location: locations.us.key, result: `staging.${locations.us.location}` },
|
|
94
|
-
{ hostname: `staging.${locations.us.location}`, location: locations.eu.key, result: `staging.${locations.eu.location}` },
|
|
95
|
-
{ hostname: `testing.staging.${locations.us.location}`, location: locations.us.key, result: `testing.staging.${locations.us.location}` },
|
|
96
|
-
{ hostname: `testing.staging.${locations.us.location}`, location: locations.eu.key, result: `testing.staging.${locations.eu.location}` },
|
|
97
|
-
{ hostname: 'docker.mender.io', location: locations.us.key, result: '' },
|
|
98
|
-
{ hostname: 'docker.mender.io', location: locations.eu.key, result: '' },
|
|
99
|
-
{ hostname: 'localhost', location: locations.us.key, result: '' },
|
|
100
|
-
{ hostname: 'localhost', location: locations.eu.key, result: '' }
|
|
101
|
-
];
|
|
102
|
-
|
|
103
|
-
expectations.map(({ hostname, location, result }) => {
|
|
104
|
-
window.location = { ...window.location, hostname };
|
|
105
|
-
let targetLocation = getTargetLocation(location);
|
|
106
|
-
expect(targetLocation).toBe(result ? `https://${result}` : result);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
window.location = { ...window.location, hostname: oldHostname };
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it('should handle trial creation', async () => {
|
|
113
|
-
const store = mockStore({ ...defaultState });
|
|
114
|
-
expect(store.getActions()).toHaveLength(0);
|
|
115
|
-
const expectedActions = [{ type: appActions.setFirstLoginAfterSignup.type, payload: true }];
|
|
116
|
-
const result = store.dispatch(
|
|
117
|
-
createOrganizationTrial({
|
|
118
|
-
'g-recaptcha-response': 'test',
|
|
119
|
-
email: 'test@test.com',
|
|
120
|
-
location: 'us',
|
|
121
|
-
marketing: true,
|
|
122
|
-
organization: 'test',
|
|
123
|
-
plan: 'os',
|
|
124
|
-
tos: true
|
|
125
|
-
})
|
|
126
|
-
);
|
|
127
|
-
jest.advanceTimersByTime(6000);
|
|
128
|
-
result.then(token => {
|
|
129
|
-
expect(token).toBeTruthy();
|
|
130
|
-
expect(store.getActions()).toHaveLength(expectedActions.length);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it('should handle credit card details retrieval', async () => {
|
|
135
|
-
const store = mockStore({ ...defaultState });
|
|
136
|
-
expect(store.getActions()).toHaveLength(0);
|
|
137
|
-
const expectedActions = [
|
|
138
|
-
{ type: getCurrentCard.pending.type },
|
|
139
|
-
{ type: actions.receiveCurrentCard.type, payload: defaultState.organization.card },
|
|
140
|
-
{ type: getCurrentCard.fulfilled.type }
|
|
141
|
-
];
|
|
142
|
-
await store.dispatch(getCurrentCard()).then(() => {
|
|
143
|
-
const storeActions = store.getActions();
|
|
144
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
145
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it('should handle organization retrieval', async () => {
|
|
150
|
-
const store = mockStore({ ...defaultState, users: { ...defaultState.users, currentSession: getSessionInfo() } });
|
|
151
|
-
expect(store.getActions()).toHaveLength(0);
|
|
152
|
-
const expectedActions = [
|
|
153
|
-
{ type: getUserOrganization.pending.type },
|
|
154
|
-
{ type: actions.setOrganization.type, payload: defaultState.organization.organization },
|
|
155
|
-
{ type: appActions.setAnnouncement.type, payload: tenantDataDivergedMessage },
|
|
156
|
-
{ type: getUserOrganization.fulfilled.type }
|
|
157
|
-
];
|
|
158
|
-
await store.dispatch(getUserOrganization()).then(() => {
|
|
159
|
-
const storeActions = store.getActions();
|
|
160
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
161
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('should handle support request sending', async () => {
|
|
166
|
-
const store = mockStore({ ...defaultState });
|
|
167
|
-
expect(store.getActions()).toHaveLength(0);
|
|
168
|
-
const expectedActions = [
|
|
169
|
-
{ type: sendSupportMessage.pending.type },
|
|
170
|
-
{ type: appActions.setSnackbar.type, payload: { message: 'Your request was sent successfully', autoHideDuration: TIMEOUTS.fiveSeconds } },
|
|
171
|
-
{ type: sendSupportMessage.fulfilled.type }
|
|
172
|
-
];
|
|
173
|
-
await store.dispatch(sendSupportMessage({ body: 'test', subject: 'testsubject' })).then(() => {
|
|
174
|
-
const storeActions = store.getActions();
|
|
175
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
176
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it('should handle schema based support request sending', async () => {
|
|
181
|
-
const store = mockStore({ ...defaultState });
|
|
182
|
-
expect(store.getActions()).toHaveLength(0);
|
|
183
|
-
const expectedActions = [
|
|
184
|
-
{ type: requestPlanChange.pending.type },
|
|
185
|
-
{ type: appActions.setSnackbar.type, payload: { message: 'Your request was sent successfully', autoHideDuration: TIMEOUTS.fiveSeconds } },
|
|
186
|
-
{ type: requestPlanChange.fulfilled.type }
|
|
187
|
-
];
|
|
188
|
-
await store
|
|
189
|
-
.dispatch(
|
|
190
|
-
requestPlanChange({
|
|
191
|
-
tenantId: defaultState.organization.organization.id,
|
|
192
|
-
content: {
|
|
193
|
-
current_plan: 'Basic',
|
|
194
|
-
requested_plan: 'Enterprise',
|
|
195
|
-
current_addons: 'something,extra',
|
|
196
|
-
requested_addons: 'something,extra,special',
|
|
197
|
-
user_message: 'more please'
|
|
198
|
-
}
|
|
199
|
-
})
|
|
200
|
-
)
|
|
201
|
-
.then(() => {
|
|
202
|
-
const storeActions = store.getActions();
|
|
203
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
204
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
it('should handle license report downloads', async () => {
|
|
209
|
-
const store = mockStore({ ...defaultState });
|
|
210
|
-
expect(store.getActions()).toHaveLength(0);
|
|
211
|
-
const expectedActions = [{ type: downloadLicenseReport.pending.type }, { type: downloadLicenseReport.fulfilled.type }];
|
|
212
|
-
const result = await store.dispatch(downloadLicenseReport()).unwrap();
|
|
213
|
-
const storeActions = store.getActions();
|
|
214
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
215
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
216
|
-
expect(result).toEqual('test,report');
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it('should handle account upgrade init', async () => {
|
|
220
|
-
const store = mockStore({ ...defaultState });
|
|
221
|
-
const expectedActions = [{ type: startUpgrade.pending.type }, { type: startUpgrade.fulfilled.type }];
|
|
222
|
-
const secret = await store.dispatch(startUpgrade(defaultState.organization.organization.id)).unwrap();
|
|
223
|
-
const storeActions = store.getActions();
|
|
224
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
225
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
226
|
-
expect(secret).toEqual('testSecret');
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it('should handle account upgrade cancelling', async () => {
|
|
230
|
-
const store = mockStore({ ...defaultState });
|
|
231
|
-
const expectedActions = [{ type: cancelUpgrade.pending.type }, { type: cancelUpgrade.fulfilled.type }];
|
|
232
|
-
await store.dispatch(cancelUpgrade(defaultState.organization.organization.id));
|
|
233
|
-
const storeActions = store.getActions();
|
|
234
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
235
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
it('should handle account upgrade completion', async () => {
|
|
239
|
-
const store = mockStore({ ...defaultState, users: { ...defaultState.users, currentSession: getSessionInfo() } });
|
|
240
|
-
expect(store.getActions()).toHaveLength(0);
|
|
241
|
-
const expectedActions = [
|
|
242
|
-
{ type: completeUpgrade.pending.type },
|
|
243
|
-
{ type: getUserOrganization.pending.type },
|
|
244
|
-
{ type: actions.setOrganization.type, payload: defaultState.organization.organization },
|
|
245
|
-
{ type: appActions.setAnnouncement.type, payload: tenantDataDivergedMessage },
|
|
246
|
-
{ type: getUserOrganization.fulfilled.type },
|
|
247
|
-
{ type: completeUpgrade.fulfilled.type }
|
|
248
|
-
];
|
|
249
|
-
await store.dispatch(completeUpgrade({ tenantId: defaultState.organization.organization.id, plan: 'enterprise' }));
|
|
250
|
-
const storeActions = store.getActions();
|
|
251
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
252
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
it('should handle confirm card update initialization', async () => {
|
|
256
|
-
const store = mockStore({ ...defaultState });
|
|
257
|
-
expect(store.getActions()).toHaveLength(0);
|
|
258
|
-
const expectedActions = [
|
|
259
|
-
{ type: startCardUpdate.pending.type },
|
|
260
|
-
{ type: actions.receiveSetupIntent.type, payload: 'testIntent' },
|
|
261
|
-
{ type: startCardUpdate.fulfilled.type }
|
|
262
|
-
];
|
|
263
|
-
const secret = await store.dispatch(startCardUpdate()).unwrap();
|
|
264
|
-
const storeActions = store.getActions();
|
|
265
|
-
expect(secret).toEqual('testSecret');
|
|
266
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
267
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
it('should handle confirm card update confirmation', async () => {
|
|
271
|
-
const store = mockStore({ ...defaultState });
|
|
272
|
-
expect(store.getActions()).toHaveLength(0);
|
|
273
|
-
const expectedActions = [
|
|
274
|
-
{ type: confirmCardUpdate.pending.type },
|
|
275
|
-
{ type: appActions.setSnackbar.type, payload: 'Payment card was updated successfully' },
|
|
276
|
-
{ type: actions.receiveSetupIntent.type, payload: null },
|
|
277
|
-
{ type: confirmCardUpdate.fulfilled.type }
|
|
278
|
-
];
|
|
279
|
-
const request = store.dispatch(confirmCardUpdate());
|
|
280
|
-
expect(request).resolves.toBeTruthy();
|
|
281
|
-
await request.then(() => {
|
|
282
|
-
const storeActions = store.getActions();
|
|
283
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
284
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
it('should handle auditlog retrieval', async () => {
|
|
289
|
-
const store = mockStore({
|
|
290
|
-
...defaultState,
|
|
291
|
-
app: {
|
|
292
|
-
...defaultState.app,
|
|
293
|
-
features: {
|
|
294
|
-
...defaultState.app.features,
|
|
295
|
-
hasAuditlogs: true,
|
|
296
|
-
isEnterprise: true
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
expect(store.getActions()).toHaveLength(0);
|
|
301
|
-
const expectedActions = [
|
|
302
|
-
{ type: getAuditLogs.pending.type },
|
|
303
|
-
{
|
|
304
|
-
type: actions.receiveAuditLogs.type,
|
|
305
|
-
payload: { events: defaultState.organization.auditlog.events, total: defaultState.organization.auditlog.selectionState.total }
|
|
306
|
-
},
|
|
307
|
-
{ type: getAuditLogs.fulfilled.type }
|
|
308
|
-
];
|
|
309
|
-
const request = store.dispatch(getAuditLogs({ page: 1, perPage: 20 }));
|
|
310
|
-
expect(request).resolves.toBeTruthy();
|
|
311
|
-
await request.then(() => {
|
|
312
|
-
const storeActions = store.getActions();
|
|
313
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
314
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
it('should allow auditlog state tracking', async () => {
|
|
318
|
-
const store = mockStore({ ...defaultState });
|
|
319
|
-
await store.dispatch(setAuditlogsState({ page: 1, sort: { direction: 'something' } }));
|
|
320
|
-
const expectedActions = [
|
|
321
|
-
{ type: setAuditlogsState.pending.type },
|
|
322
|
-
{ type: getAuditLogs.pending.type },
|
|
323
|
-
{
|
|
324
|
-
type: actions.setAuditLogState.type,
|
|
325
|
-
payload: { ...defaultState.organization.auditlog.selectionState, isLoading: true, sort: { direction: 'something' } }
|
|
326
|
-
},
|
|
327
|
-
{ type: getAuditLogs.fulfilled.type },
|
|
328
|
-
{ type: actions.setAuditLogState.type, payload: { isLoading: false } },
|
|
329
|
-
{ type: setAuditlogsState.fulfilled.type }
|
|
330
|
-
];
|
|
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 handle csv information download', async () => {
|
|
336
|
-
const store = mockStore({ ...defaultState });
|
|
337
|
-
expect(store.getActions()).toHaveLength(0);
|
|
338
|
-
const expectedActions = [{ type: getAuditLogsCsvLink.pending.type }, { type: getAuditLogsCsvLink.fulfilled.type }];
|
|
339
|
-
const request = store.dispatch(getAuditLogsCsvLink()).unwrap();
|
|
340
|
-
expect(request).resolves.toBeTruthy();
|
|
341
|
-
await request.then(link => {
|
|
342
|
-
const storeActions = store.getActions();
|
|
343
|
-
expect(storeActions.length).toEqual(expectedActions.length);
|
|
344
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
345
|
-
expect(link).toEqual('http://localhost/api/management/v1/auditlogs/logs/export?limit=20000&sort=desc');
|
|
346
|
-
});
|
|
347
|
-
});
|
|
348
|
-
it('should allow initializing external device providers', async () => {
|
|
349
|
-
const store = mockStore({
|
|
350
|
-
...defaultState,
|
|
351
|
-
organization: {
|
|
352
|
-
...defaultState.organization,
|
|
353
|
-
externalDeviceIntegrations: [
|
|
354
|
-
{ id: 1, something: 'something' },
|
|
355
|
-
{ id: 2, provider: 'aws', something: 'new' }
|
|
356
|
-
]
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
expect(store.getActions()).toHaveLength(0);
|
|
360
|
-
const expectedActions = [
|
|
361
|
-
{ type: createIntegration.pending.type },
|
|
362
|
-
{ type: appActions.setSnackbar.type, payload: 'The integration was set up successfully' },
|
|
363
|
-
{ type: getIntegrations.pending.type },
|
|
364
|
-
{ type: actions.receiveExternalDeviceIntegrations.type, payload: expectedDeviceProviders },
|
|
365
|
-
{ type: getIntegrations.fulfilled.type },
|
|
366
|
-
{ type: createIntegration.fulfilled.type }
|
|
367
|
-
];
|
|
368
|
-
const request = store.dispatch(createIntegration({ connection_string: 'testString', provider: 'iot-hub' }));
|
|
369
|
-
expect(request).resolves.toBeTruthy();
|
|
370
|
-
await request.then(() => {
|
|
371
|
-
const storeActions = store.getActions();
|
|
372
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
373
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
374
|
-
});
|
|
375
|
-
});
|
|
376
|
-
it('should allow configuring external device providers', async () => {
|
|
377
|
-
const store = mockStore({
|
|
378
|
-
...defaultState,
|
|
379
|
-
organization: {
|
|
380
|
-
...defaultState.organization,
|
|
381
|
-
externalDeviceIntegrations: [
|
|
382
|
-
{ id: 1, something: 'something' },
|
|
383
|
-
{ id: 2, provider: 'iot-core', something: 'new' }
|
|
384
|
-
]
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
expect(store.getActions()).toHaveLength(0);
|
|
388
|
-
const expectedActions = [
|
|
389
|
-
{ type: changeIntegration.pending.type },
|
|
390
|
-
{ type: appActions.setSnackbar.type, payload: 'The integration was updated successfully' },
|
|
391
|
-
{ type: getIntegrations.pending.type },
|
|
392
|
-
{ type: actions.receiveExternalDeviceIntegrations.type, payload: expectedDeviceProviders },
|
|
393
|
-
{ type: getIntegrations.fulfilled.type },
|
|
394
|
-
{ type: changeIntegration.fulfilled.type }
|
|
395
|
-
];
|
|
396
|
-
const request = store.dispatch(changeIntegration({ connection_string: 'testString2', id: 1, provider: 'iot-hub' }));
|
|
397
|
-
expect(request).resolves.toBeTruthy();
|
|
398
|
-
await request.then(() => {
|
|
399
|
-
const storeActions = store.getActions();
|
|
400
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
401
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
402
|
-
});
|
|
403
|
-
});
|
|
404
|
-
it('should allow retrieving external device providers', async () => {
|
|
405
|
-
const store = mockStore({
|
|
406
|
-
...defaultState,
|
|
407
|
-
organization: {
|
|
408
|
-
...defaultState.organization,
|
|
409
|
-
externalDeviceIntegrations: [
|
|
410
|
-
{ id: 1, something: 'something' },
|
|
411
|
-
{ id: 2, provider: 'iot-core', something: 'new' }
|
|
412
|
-
]
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
expect(store.getActions()).toHaveLength(0);
|
|
416
|
-
const expectedActions = [
|
|
417
|
-
{ type: getIntegrations.pending.type },
|
|
418
|
-
{ type: actions.receiveExternalDeviceIntegrations.type, payload: expectedDeviceProviders },
|
|
419
|
-
{ type: getIntegrations.fulfilled.type }
|
|
420
|
-
];
|
|
421
|
-
const request = store.dispatch(getIntegrations());
|
|
422
|
-
expect(request).resolves.toBeTruthy();
|
|
423
|
-
await request.then(() => {
|
|
424
|
-
const storeActions = store.getActions();
|
|
425
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
426
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
427
|
-
});
|
|
428
|
-
});
|
|
429
|
-
it('should allow deleting external device provider configurations', async () => {
|
|
430
|
-
const store = mockStore({ ...defaultState, externalDeviceIntegrations: [{ id: 1, something: 'something' }] });
|
|
431
|
-
expect(store.getActions()).toHaveLength(0);
|
|
432
|
-
const expectedActions = [
|
|
433
|
-
{ type: deleteIntegration.pending.type },
|
|
434
|
-
{ type: appActions.setSnackbar.type, payload: 'The integration was removed successfully' },
|
|
435
|
-
{ type: actions.receiveExternalDeviceIntegrations.type, payload: [] },
|
|
436
|
-
{ type: deleteIntegration.fulfilled.type }
|
|
437
|
-
];
|
|
438
|
-
const request = store.dispatch(deleteIntegration({ id: 1 }));
|
|
439
|
-
expect(request).resolves.toBeTruthy();
|
|
440
|
-
await request.then(() => {
|
|
441
|
-
const storeActions = store.getActions();
|
|
442
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
443
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
444
|
-
});
|
|
445
|
-
});
|
|
446
|
-
it('should allow retrieving webhook events', async () => {
|
|
447
|
-
const store = mockStore({
|
|
448
|
-
...defaultState,
|
|
449
|
-
organization: {
|
|
450
|
-
...defaultState.organization,
|
|
451
|
-
webhooks: {
|
|
452
|
-
...defaultState.organization.webhooks,
|
|
453
|
-
events: [
|
|
454
|
-
{ id: 1, something: 'something' },
|
|
455
|
-
{ id: 2, provider: 'aws', something: 'new' }
|
|
456
|
-
]
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
expect(store.getActions()).toHaveLength(0);
|
|
461
|
-
const expectedActions = [
|
|
462
|
-
{ type: getWebhookEvents.pending.type },
|
|
463
|
-
{ type: actions.receiveWebhookEvents.type, payload: { value: webhookEvents, total: 2 } },
|
|
464
|
-
{ type: getWebhookEvents.fulfilled.type }
|
|
465
|
-
];
|
|
466
|
-
const request = store.dispatch(getWebhookEvents());
|
|
467
|
-
expect(request).resolves.toBeTruthy();
|
|
468
|
-
await request.then(() => {
|
|
469
|
-
const storeActions = store.getActions();
|
|
470
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
471
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
472
|
-
});
|
|
473
|
-
});
|
|
474
|
-
it('should auto check for more webhook events', async () => {
|
|
475
|
-
const existingEvents = [
|
|
476
|
-
{ id: 1, something: 'something' },
|
|
477
|
-
{ id: 2, provider: 'aws', something: 'new' }
|
|
478
|
-
];
|
|
479
|
-
const store = mockStore({
|
|
480
|
-
...defaultState,
|
|
481
|
-
organization: {
|
|
482
|
-
...defaultState.organization,
|
|
483
|
-
webhooks: {
|
|
484
|
-
...defaultState.organization.webhooks,
|
|
485
|
-
events: existingEvents,
|
|
486
|
-
eventTotal: 2
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
});
|
|
490
|
-
expect(store.getActions()).toHaveLength(0);
|
|
491
|
-
const defaultEvent = webhookEvents[0];
|
|
492
|
-
const expectedActions = [
|
|
493
|
-
{ type: getWebhookEvents.pending.type },
|
|
494
|
-
{ type: actions.receiveWebhookEvents.type, payload: { value: [defaultEvent], total: 1 } },
|
|
495
|
-
{ type: getWebhookEvents.pending.type },
|
|
496
|
-
{ type: actions.receiveWebhookEvents.type, payload: { value: existingEvents, total: 2 } },
|
|
497
|
-
{ type: getWebhookEvents.fulfilled.type },
|
|
498
|
-
{ type: getWebhookEvents.fulfilled.type }
|
|
499
|
-
];
|
|
500
|
-
const request = store.dispatch(getWebhookEvents({ page: 1, perPage: 1 }));
|
|
501
|
-
expect(request).resolves.toBeTruthy();
|
|
502
|
-
await request.then(() => {
|
|
503
|
-
const storeActions = store.getActions();
|
|
504
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
505
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
506
|
-
});
|
|
507
|
-
});
|
|
508
|
-
it('should allow configuring external identity providers', async () => {
|
|
509
|
-
const store = mockStore({
|
|
510
|
-
...defaultState,
|
|
511
|
-
organization: {
|
|
512
|
-
...defaultState.organization,
|
|
513
|
-
ssoConfigs: [{ id: 1, something: 'something' }]
|
|
514
|
-
}
|
|
515
|
-
});
|
|
516
|
-
expect(store.getActions()).toHaveLength(0);
|
|
517
|
-
const expectedActions = [
|
|
518
|
-
{ type: storeSsoConfig.pending.type },
|
|
519
|
-
{ type: appActions.setSnackbar.type, payload: 'The SSO configuration was stored successfully' },
|
|
520
|
-
{ type: getSsoConfigs.pending.type },
|
|
521
|
-
{ type: getSsoConfigById.pending.type },
|
|
522
|
-
{ type: getSsoConfigById.pending.type },
|
|
523
|
-
{ type: getSsoConfigById.fulfilled.type },
|
|
524
|
-
{ type: getSsoConfigById.fulfilled.type },
|
|
525
|
-
{ type: actions.receiveSsoConfigs.type },
|
|
526
|
-
{ type: getSsoConfigs.fulfilled.type },
|
|
527
|
-
{ type: storeSsoConfig.fulfilled.type }
|
|
528
|
-
];
|
|
529
|
-
const request = store.dispatch(
|
|
530
|
-
storeSsoConfig({ config: { connection_string: 'testString', provider: 'iot-hub' }, contentType: SSO_TYPES.oidc.contentType })
|
|
531
|
-
);
|
|
532
|
-
expect(request).resolves.toBeTruthy();
|
|
533
|
-
await request.then(() => {
|
|
534
|
-
const storeActions = store.getActions();
|
|
535
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
536
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
537
|
-
});
|
|
538
|
-
});
|
|
539
|
-
it('should allow updating external identity providers', async () => {
|
|
540
|
-
const store = mockStore({
|
|
541
|
-
...defaultState,
|
|
542
|
-
organization: {
|
|
543
|
-
...defaultState.organization,
|
|
544
|
-
ssoConfigs: [
|
|
545
|
-
{ id: 1, something: 'something' },
|
|
546
|
-
{ id: 2, provider: 'aws', something: 'new' }
|
|
547
|
-
]
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
expect(store.getActions()).toHaveLength(0);
|
|
551
|
-
const expectedActions = [
|
|
552
|
-
{ type: changeSsoConfig.pending.type },
|
|
553
|
-
{ type: appActions.setSnackbar.type, payload: 'The SSO configuration was updated successfully' },
|
|
554
|
-
{ type: getSsoConfigs.pending.type },
|
|
555
|
-
{ type: getSsoConfigById.pending.type },
|
|
556
|
-
{ type: getSsoConfigById.pending.type },
|
|
557
|
-
{ type: getSsoConfigById.fulfilled.type },
|
|
558
|
-
{ type: getSsoConfigById.fulfilled.type },
|
|
559
|
-
{ type: actions.receiveSsoConfigs.type },
|
|
560
|
-
{ type: getSsoConfigs.fulfilled.type },
|
|
561
|
-
{ type: changeSsoConfig.fulfilled.type }
|
|
562
|
-
];
|
|
563
|
-
const request = store.dispatch(
|
|
564
|
-
changeSsoConfig({ config: { connection_string: 'testString2', id: 1, provider: 'iot-hub' }, contentType: SSO_TYPES.oidc.contentType })
|
|
565
|
-
);
|
|
566
|
-
expect(request).resolves.toBeTruthy();
|
|
567
|
-
await request.then(() => {
|
|
568
|
-
const storeActions = store.getActions();
|
|
569
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
570
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
571
|
-
});
|
|
572
|
-
});
|
|
573
|
-
it('should allow retrieving external identity providers', async () => {
|
|
574
|
-
const store = mockStore({
|
|
575
|
-
...defaultState,
|
|
576
|
-
organization: {
|
|
577
|
-
...defaultState.organization,
|
|
578
|
-
ssoConfigs: [
|
|
579
|
-
{ id: 1, something: 'something' },
|
|
580
|
-
{ id: 2, provider: 'aws', something: 'new' }
|
|
581
|
-
]
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
expect(store.getActions()).toHaveLength(0);
|
|
585
|
-
const expectedActions = [
|
|
586
|
-
{ type: getSsoConfigs.pending.type },
|
|
587
|
-
{ type: getSsoConfigById.pending.type },
|
|
588
|
-
{ type: getSsoConfigById.pending.type },
|
|
589
|
-
{ type: getSsoConfigById.fulfilled.type },
|
|
590
|
-
{ type: getSsoConfigById.fulfilled.type },
|
|
591
|
-
{ type: actions.receiveSsoConfigs.type, payload: expectedSsoConfigs },
|
|
592
|
-
{ type: getSsoConfigs.fulfilled.type }
|
|
593
|
-
];
|
|
594
|
-
const request = store.dispatch(getSsoConfigs());
|
|
595
|
-
expect(request).resolves.toBeTruthy();
|
|
596
|
-
await request.then(() => {
|
|
597
|
-
const storeActions = store.getActions();
|
|
598
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
599
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
600
|
-
});
|
|
601
|
-
});
|
|
602
|
-
it('should allow deleting external identity providers', async () => {
|
|
603
|
-
const store = mockStore({ ...defaultState, organization: { ...defaultState.organization, ssoConfigs: [...expectedSsoConfigs] } });
|
|
604
|
-
expect(store.getActions()).toHaveLength(0);
|
|
605
|
-
const expectedActions = [
|
|
606
|
-
{ type: deleteSsoConfig.pending.type },
|
|
607
|
-
{ type: appActions.setSnackbar.type, payload: 'The SSO configuration was removed successfully' },
|
|
608
|
-
{ type: actions.receiveSsoConfigs.type, payload: [expectedSsoConfigs[1]] },
|
|
609
|
-
{ type: deleteSsoConfig.fulfilled.type }
|
|
610
|
-
];
|
|
611
|
-
const request = store.dispatch(deleteSsoConfig({ id: '1' }));
|
|
612
|
-
expect(request).resolves.toBeTruthy();
|
|
613
|
-
await request.then(() => {
|
|
614
|
-
const storeActions = store.getActions();
|
|
615
|
-
expect(storeActions).toHaveLength(expectedActions.length);
|
|
616
|
-
expectedActions.map((action, index) => expect(storeActions[index]).toMatchObject(action));
|
|
617
|
-
});
|
|
618
|
-
});
|
|
619
|
-
});
|