@northern.tech/store 0.30.0 → 0.30.2
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.cjs +21 -1130
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +212 -221
- package/dist/actions.d.ts +212 -220
- package/dist/actions.js +21 -18
- package/dist/actions.js.map +1 -1
- package/dist/api/general-api.cjs +61 -459
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.d.cts +15 -17
- package/dist/api/general-api.d.ts +15 -17
- package/dist/api/general-api.js +56 -15
- package/dist/api/general-api.js.map +1 -1
- package/dist/api/users-api.cjs +32 -469
- package/dist/api/users-api.cjs.map +1 -1
- package/dist/api/users-api.d.cts +19 -14
- package/dist/api/users-api.d.ts +19 -13
- package/dist/api/users-api.js +30 -12
- package/dist/api/users-api.js.map +1 -1
- package/dist/appSlice/constants.cjs +190 -144
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.d.cts +2 -159
- package/dist/appSlice/constants.d.ts +2 -159
- package/dist/appSlice/constants.js +181 -29
- package/dist/appSlice/constants.js.map +1 -1
- package/dist/appSlice/index.cjs +147 -178
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.d.cts +2 -148
- package/dist/appSlice/index.d.ts +2 -148
- package/dist/appSlice/index.js +142 -18
- package/dist/appSlice/index.js.map +1 -1
- package/dist/appSlice/mocks.cjs +17 -191
- package/dist/appSlice/mocks.cjs.map +1 -1
- package/dist/appSlice/mocks.d.cts +33 -36
- package/dist/appSlice/mocks.d.ts +33 -36
- package/dist/appSlice/mocks.js +17 -25
- package/dist/appSlice/mocks.js.map +1 -1
- package/dist/appSlice/selectors.cjs +49 -91
- package/dist/appSlice/selectors.cjs.map +1 -1
- package/dist/appSlice/selectors.d.cts +216 -230
- package/dist/appSlice/selectors.d.ts +216 -230
- package/dist/appSlice/selectors.js +29 -44
- package/dist/appSlice/selectors.js.map +1 -1
- package/dist/appSlice/thunks.cjs +6 -4636
- package/dist/appSlice/thunks.d.cts +59 -62
- package/dist/appSlice/thunks.d.ts +59 -62
- package/dist/appSlice/thunks.js +2 -45
- package/dist/auth.cjs +68 -433
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +14 -14
- package/dist/auth.d.ts +14 -14
- package/dist/auth.js +65 -18
- package/dist/auth.js.map +1 -1
- package/dist/chunk-CKQMccvm.cjs +28 -0
- package/dist/commonConstants.cjs +14 -393
- package/dist/commonConstants.d.cts +2 -83
- package/dist/commonConstants.d.ts +2 -83
- package/dist/commonConstants.js +2 -33
- package/dist/commonSelectors.cjs +284 -1269
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +1623 -1416
- package/dist/commonSelectors.d.ts +1623 -1416
- package/dist/commonSelectors.js +277 -51
- package/dist/commonSelectors.js.map +1 -1
- package/dist/constants-5cdwz1iH.d.ts +160 -0
- package/dist/constants-BWEsNG5c.d.ts +28 -0
- package/dist/constants-BciiayPt.d.ts +17 -0
- package/dist/constants-C5AU0mCY.d.ts +157 -0
- package/dist/constants-CIx3fnBv.d.cts +17 -0
- package/dist/constants-CNhpIMME.d.cts +93 -0
- package/dist/constants-Cpgyuy_r.d.ts +57 -0
- package/dist/constants-D41U_jbR.d.cts +160 -0
- package/dist/constants-DK7fI3Rh.d.cts +28 -0
- package/dist/constants-DPLHhjVN.d.cts +157 -0
- package/dist/constants-DrwXHsJ1.d.ts +120 -0
- package/dist/constants-G3wymKIl.d.cts +57 -0
- package/dist/constants-MPLfugsi.d.cts +120 -0
- package/dist/constants-y2XVLQWf.d.ts +93 -0
- package/dist/constants.cjs +784 -972
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +8 -14
- package/dist/constants.d.ts +8 -14
- package/dist/constants.js +674 -232
- package/dist/constants.js.map +1 -1
- package/dist/deploymentsSlice/constants.cjs +15 -214
- package/dist/deploymentsSlice/constants.d.cts +2 -163
- package/dist/deploymentsSlice/constants.d.ts +2 -163
- package/dist/deploymentsSlice/constants.js +2 -35
- package/dist/deploymentsSlice/index.cjs +168 -302
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.d.cts +2 -157
- package/dist/deploymentsSlice/index.d.ts +2 -157
- package/dist/deploymentsSlice/index.js +161 -18
- package/dist/deploymentsSlice/index.js.map +1 -1
- package/dist/deploymentsSlice/mocks.cjs +178 -433
- package/dist/deploymentsSlice/mocks.cjs.map +1 -1
- package/dist/deploymentsSlice/mocks.d.cts +176 -178
- package/dist/deploymentsSlice/mocks.d.ts +176 -178
- package/dist/deploymentsSlice/mocks.js +178 -144
- package/dist/deploymentsSlice/mocks.js.map +1 -1
- package/dist/deploymentsSlice/selectors.cjs +44 -223
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +73 -87
- package/dist/deploymentsSlice/selectors.d.ts +73 -87
- package/dist/deploymentsSlice/selectors.js +37 -25
- package/dist/deploymentsSlice/selectors.js.map +1 -1
- package/dist/deploymentsSlice/thunks.cjs +16 -4654
- package/dist/deploymentsSlice/thunks.d.cts +223 -236
- package/dist/deploymentsSlice/thunks.d.ts +223 -236
- package/dist/deploymentsSlice/thunks.js +2 -65
- package/dist/devicesSlice/constants.cjs +9 -68
- package/dist/devicesSlice/constants.d.cts +2 -37
- package/dist/devicesSlice/constants.d.ts +2 -37
- package/dist/devicesSlice/constants.js +2 -23
- package/dist/devicesSlice/index.cjs +215 -225
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.d.cts +2 -202
- package/dist/devicesSlice/index.d.ts +2 -202
- package/dist/devicesSlice/index.js +209 -18
- package/dist/devicesSlice/index.js.map +1 -1
- package/dist/devicesSlice/mocks.cjs +146 -339
- package/dist/devicesSlice/mocks.cjs.map +1 -1
- package/dist/devicesSlice/mocks.d.cts +150 -148
- package/dist/devicesSlice/mocks.d.ts +150 -148
- package/dist/devicesSlice/mocks.js +145 -132
- package/dist/devicesSlice/mocks.js.map +1 -1
- package/dist/devicesSlice/selectors.cjs +145 -539
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +685 -699
- package/dist/devicesSlice/selectors.d.ts +685 -699
- package/dist/devicesSlice/selectors.js +123 -59
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.cjs +48 -4718
- package/dist/devicesSlice/thunks.d.cts +800 -752
- package/dist/devicesSlice/thunks.d.ts +800 -752
- package/dist/devicesSlice/thunks.js +2 -129
- package/dist/index-4eaLEXy_.d.cts +152 -0
- package/dist/index-BEVkIiNa.d.cts +95 -0
- package/dist/index-BP0uAq36.d.cts +159 -0
- package/dist/index-Bwx9jEiL.d.cts +71 -0
- package/dist/index-CJkrL0oA.d.ts +64 -0
- package/dist/index-CO-py5d4.d.ts +95 -0
- package/dist/index-CTt-eIY8.d.cts +154 -0
- package/dist/index-CkwVnIqd.d.ts +159 -0
- package/dist/index-Cvkvcz4r.d.ts +115 -0
- package/dist/index-DJSlDPRX.d.ts +71 -0
- package/dist/index-DqyY6oZ3.d.ts +205 -0
- package/dist/index-DtePEQPT.d.ts +152 -0
- package/dist/index-Dv3Hfxk_.d.ts +154 -0
- package/dist/index-FyYBBeN-.d.cts +115 -0
- package/dist/index-Lz5JsJ6O.d.cts +205 -0
- package/dist/index-UPc3wvVd.d.cts +64 -0
- package/dist/liststatehook.cjs +83 -948
- package/dist/liststatehook.cjs.map +1 -1
- package/dist/liststatehook.d.cts +29 -239
- package/dist/liststatehook.d.ts +29 -239
- package/dist/liststatehook.js +77 -85
- package/dist/liststatehook.js.map +1 -1
- package/dist/locationutils.cjs +459 -916
- package/dist/locationutils.cjs.map +1 -1
- package/dist/locationutils.d.cts +244 -110
- package/dist/locationutils.d.ts +244 -110
- package/dist/locationutils.js +440 -44
- package/dist/locationutils.js.map +1 -1
- package/dist/monitorSlice/constants.cjs +0 -19
- package/dist/monitorSlice/constants.d.cts +2 -5
- package/dist/monitorSlice/constants.d.ts +2 -5
- package/dist/monitorSlice/constants.js +1 -2
- package/dist/monitorSlice/index.cjs +65 -82
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.d.cts +2 -94
- package/dist/monitorSlice/index.d.ts +2 -94
- package/dist/monitorSlice/index.js +59 -18
- package/dist/monitorSlice/index.js.map +1 -1
- package/dist/monitorSlice/mocks.cjs +50 -126
- package/dist/monitorSlice/mocks.cjs.map +1 -1
- package/dist/monitorSlice/mocks.d.cts +49 -45
- package/dist/monitorSlice/mocks.d.ts +49 -45
- package/dist/monitorSlice/mocks.js +49 -62
- package/dist/monitorSlice/mocks.js.map +1 -1
- package/dist/monitorSlice/selectors.cjs +5 -29
- package/dist/monitorSlice/selectors.cjs.map +1 -1
- package/dist/monitorSlice/selectors.d.cts +10 -1
- package/dist/monitorSlice/selectors.d.ts +10 -1
- package/dist/monitorSlice/selectors.js +5 -6
- package/dist/monitorSlice/selectors.js.map +1 -1
- package/dist/monitorSlice/thunks.cjs +83 -1914
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +112 -120
- package/dist/monitorSlice/thunks.d.ts +112 -120
- package/dist/monitorSlice/thunks.js +78 -42
- package/dist/monitorSlice/thunks.js.map +1 -1
- package/dist/onboardingSlice/constants.cjs +44 -69
- package/dist/onboardingSlice/constants.cjs.map +1 -1
- package/dist/onboardingSlice/constants.d.cts +2 -26
- package/dist/onboardingSlice/constants.d.ts +2 -26
- package/dist/onboardingSlice/constants.js +43 -7
- package/dist/onboardingSlice/constants.js.map +1 -1
- package/dist/onboardingSlice/index.cjs +53 -73
- package/dist/onboardingSlice/index.cjs.map +1 -1
- package/dist/onboardingSlice/index.d.cts +2 -62
- package/dist/onboardingSlice/index.d.ts +2 -62
- package/dist/onboardingSlice/index.js +47 -13
- package/dist/onboardingSlice/index.js.map +1 -1
- package/dist/onboardingSlice/mocks.cjs +12 -81
- package/dist/onboardingSlice/mocks.cjs.map +1 -1
- package/dist/onboardingSlice/mocks.d.cts +14 -15
- package/dist/onboardingSlice/mocks.d.ts +14 -15
- package/dist/onboardingSlice/mocks.js +12 -15
- package/dist/onboardingSlice/mocks.js.map +1 -1
- package/dist/onboardingSlice/selectors.cjs +5 -29
- package/dist/onboardingSlice/selectors.cjs.map +1 -1
- package/dist/onboardingSlice/selectors.d.cts +6 -1
- package/dist/onboardingSlice/selectors.d.ts +6 -1
- package/dist/onboardingSlice/selectors.js +5 -6
- package/dist/onboardingSlice/selectors.js.map +1 -1
- package/dist/onboardingSlice/thunks.cjs +8 -4746
- package/dist/onboardingSlice/thunks.d.cts +124 -143
- package/dist/onboardingSlice/thunks.d.ts +124 -143
- package/dist/onboardingSlice/thunks.js +2 -49
- package/dist/organizationSlice/constants.cjs +11 -95
- package/dist/organizationSlice/constants.d.cts +2 -91
- package/dist/organizationSlice/constants.d.ts +2 -91
- package/dist/organizationSlice/constants.js +2 -27
- package/dist/organizationSlice/index.cjs +113 -152
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.d.cts +2 -74
- package/dist/organizationSlice/index.d.ts +2 -74
- package/dist/organizationSlice/index.js +106 -18
- package/dist/organizationSlice/index.js.map +1 -1
- package/dist/organizationSlice/mocks.cjs +215 -406
- package/dist/organizationSlice/mocks.cjs.map +1 -1
- package/dist/organizationSlice/mocks.d.cts +209 -212
- package/dist/organizationSlice/mocks.d.ts +209 -212
- package/dist/organizationSlice/mocks.js +214 -184
- package/dist/organizationSlice/mocks.js.map +1 -1
- package/dist/organizationSlice/selectors.cjs +97 -474
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +381 -389
- package/dist/organizationSlice/selectors.d.ts +381 -389
- package/dist/organizationSlice/selectors.js +78 -50
- package/dist/organizationSlice/selectors.js.map +1 -1
- package/dist/organizationSlice/thunks.cjs +43 -5150
- package/dist/organizationSlice/thunks.d.cts +638 -649
- package/dist/organizationSlice/thunks.d.ts +638 -649
- package/dist/organizationSlice/thunks.js +2 -119
- package/dist/organizationSlice/types.cjs +0 -19
- package/dist/organizationSlice/types.d.cts +2 -88
- package/dist/organizationSlice/types.d.ts +2 -88
- package/dist/organizationSlice/types.js +1 -1
- package/dist/releasesSlice/constants.cjs +17 -41
- package/dist/releasesSlice/constants.cjs.map +1 -1
- package/dist/releasesSlice/constants.d.cts +2 -15
- package/dist/releasesSlice/constants.d.ts +2 -15
- package/dist/releasesSlice/constants.js +13 -14
- package/dist/releasesSlice/constants.js.map +1 -1
- package/dist/releasesSlice/index.cjs +106 -179
- package/dist/releasesSlice/index.cjs.map +1 -1
- package/dist/releasesSlice/index.d.cts +2 -113
- package/dist/releasesSlice/index.d.ts +2 -113
- package/dist/releasesSlice/index.js +100 -18
- package/dist/releasesSlice/index.js.map +1 -1
- package/dist/releasesSlice/mocks.cjs +44 -220
- package/dist/releasesSlice/mocks.cjs.map +1 -1
- package/dist/releasesSlice/mocks.d.cts +63 -61
- package/dist/releasesSlice/mocks.d.ts +63 -61
- package/dist/releasesSlice/mocks.js +43 -59
- package/dist/releasesSlice/mocks.js.map +1 -1
- package/dist/releasesSlice/selectors.cjs +44 -439
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.d.cts +268 -280
- package/dist/releasesSlice/selectors.d.ts +268 -280
- package/dist/releasesSlice/selectors.js +31 -36
- package/dist/releasesSlice/selectors.js.map +1 -1
- package/dist/releasesSlice/thunks.cjs +422 -2175
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +305 -307
- package/dist/releasesSlice/thunks.d.ts +305 -307
- package/dist/releasesSlice/thunks.js +413 -65
- package/dist/releasesSlice/thunks.js.map +1 -1
- package/dist/selectors.cjs +136 -1530
- package/dist/selectors.d.cts +10 -36
- package/dist/selectors.d.ts +10 -36
- package/dist/selectors.js +10 -280
- package/dist/sockethook.cjs +140 -515
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.d.cts +25 -9
- package/dist/sockethook.d.ts +25 -9
- package/dist/sockethook.js +134 -135
- package/dist/sockethook.js.map +1 -1
- package/dist/store-BQxOSRC1.d.ts +234 -0
- package/dist/store-BiIA0r0A.d.cts +234 -0
- package/dist/store.cjs +117 -1290
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +3 -206
- package/dist/store.d.ts +3 -206
- package/dist/store.js +110 -32
- package/dist/store.js.map +1 -1
- package/dist/storehooks.cjs +240 -5783
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.d.cts +76 -4
- package/dist/storehooks.d.ts +76 -4
- package/dist/storehooks.js +229 -265
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +2656 -5918
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +9 -36
- package/dist/thunks.d.ts +9 -36
- package/dist/thunks.js +2481 -385
- package/dist/thunks.js.map +1 -1
- package/dist/types-B2NRQLFw.d.ts +88 -0
- package/dist/types-ClEfo0dK.d.cts +88 -0
- package/dist/useDeploymentDevice.cjs +26 -4650
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.d.cts +4 -2
- package/dist/useDeploymentDevice.d.ts +4 -2
- package/dist/useDeploymentDevice.js +21 -60
- package/dist/useDeploymentDevice.js.map +1 -1
- package/dist/usersSlice/constants.cjs +8 -55
- package/dist/usersSlice/constants.d.cts +2 -52
- package/dist/usersSlice/constants.d.ts +2 -52
- package/dist/usersSlice/constants.js +2 -21
- package/dist/usersSlice/index.cjs +132 -172
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/index.d.cts +2 -152
- package/dist/usersSlice/index.d.ts +2 -152
- package/dist/usersSlice/index.js +125 -18
- package/dist/usersSlice/index.js.map +1 -1
- package/dist/usersSlice/mocks.cjs +55 -196
- package/dist/usersSlice/mocks.cjs.map +1 -1
- package/dist/usersSlice/mocks.d.cts +68 -72
- package/dist/usersSlice/mocks.d.ts +68 -72
- package/dist/usersSlice/mocks.js +54 -46
- package/dist/usersSlice/mocks.js.map +1 -1
- package/dist/usersSlice/selectors.cjs +65 -567
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +364 -376
- package/dist/usersSlice/selectors.d.ts +364 -376
- package/dist/usersSlice/selectors.js +44 -50
- package/dist/usersSlice/selectors.js.map +1 -1
- package/dist/usersSlice/thunks.cjs +39 -4698
- package/dist/usersSlice/thunks.d.cts +820 -856
- package/dist/usersSlice/thunks.d.ts +820 -856
- package/dist/usersSlice/thunks.js +2 -111
- package/dist/utils-CO_CpGFP.d.ts +105 -0
- package/dist/utils-CpPfqW0Q.d.cts +105 -0
- package/dist/utils.cjs +231 -850
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -80
- package/dist/utils.d.ts +2 -80
- package/dist/utils.js +211 -50
- package/dist/utils.js.map +1 -1
- package/package.json +11 -13
- package/dist/appSlice/thunks.cjs.map +0 -1
- package/dist/appSlice/thunks.js.map +0 -1
- package/dist/chunk-2DYA3X77.js +0 -15
- package/dist/chunk-2DYA3X77.js.map +0 -1
- package/dist/chunk-4BHM6WVX.js +0 -50
- package/dist/chunk-4BHM6WVX.js.map +0 -1
- package/dist/chunk-4UNLEL5A.js +0 -143
- package/dist/chunk-4UNLEL5A.js.map +0 -1
- package/dist/chunk-6V5IIIF7.js +0 -396
- package/dist/chunk-6V5IIIF7.js.map +0 -1
- package/dist/chunk-ARMI6SZS.js +0 -446
- package/dist/chunk-ARMI6SZS.js.map +0 -1
- package/dist/chunk-AZF4YY3P.js +0 -108
- package/dist/chunk-AZF4YY3P.js.map +0 -1
- package/dist/chunk-B5AI2YPV.js +0 -156
- package/dist/chunk-B5AI2YPV.js.map +0 -1
- package/dist/chunk-CQXDAXQF.js +0 -51
- package/dist/chunk-CQXDAXQF.js.map +0 -1
- package/dist/chunk-DBBE6D36.js +0 -115
- package/dist/chunk-DBBE6D36.js.map +0 -1
- package/dist/chunk-ECVQVQEL.js +0 -68
- package/dist/chunk-ECVQVQEL.js.map +0 -1
- package/dist/chunk-FAJ3I2UQ.js +0 -47
- package/dist/chunk-FAJ3I2UQ.js.map +0 -1
- package/dist/chunk-FCY7BUGK.js +0 -2876
- package/dist/chunk-FCY7BUGK.js.map +0 -1
- package/dist/chunk-FG37HJLC.js +0 -157
- package/dist/chunk-FG37HJLC.js.map +0 -1
- package/dist/chunk-FQAUVV6C.js +0 -246
- package/dist/chunk-FQAUVV6C.js.map +0 -1
- package/dist/chunk-HKN3RN2Z.js +0 -41
- package/dist/chunk-HKN3RN2Z.js.map +0 -1
- package/dist/chunk-HPKXWNEF.js +0 -100
- package/dist/chunk-HPKXWNEF.js.map +0 -1
- package/dist/chunk-JIS4PA3R.js +0 -7
- package/dist/chunk-JIS4PA3R.js.map +0 -1
- package/dist/chunk-JXBTIFMS.js +0 -82
- package/dist/chunk-JXBTIFMS.js.map +0 -1
- package/dist/chunk-JYPSCCT4.js +0 -58
- package/dist/chunk-JYPSCCT4.js.map +0 -1
- package/dist/chunk-L53CPHJU.js +0 -721
- package/dist/chunk-L53CPHJU.js.map +0 -1
- package/dist/chunk-MNJXEB7S.js +0 -304
- package/dist/chunk-MNJXEB7S.js.map +0 -1
- package/dist/chunk-NMAXZ3ZY.js +0 -1
- package/dist/chunk-NMAXZ3ZY.js.map +0 -1
- package/dist/chunk-NXLXPRYW.js +0 -142
- package/dist/chunk-NXLXPRYW.js.map +0 -1
- package/dist/chunk-O6VCSLNE.js +0 -59
- package/dist/chunk-O6VCSLNE.js.map +0 -1
- package/dist/chunk-PQADM3M3.js +0 -115
- package/dist/chunk-PQADM3M3.js.map +0 -1
- package/dist/chunk-SJ75YKOA.js +0 -44
- package/dist/chunk-SJ75YKOA.js.map +0 -1
- package/dist/chunk-TUPBZ6MQ.js +0 -162
- package/dist/chunk-TUPBZ6MQ.js.map +0 -1
- package/dist/chunk-XF3TZSZS.js +0 -25
- package/dist/chunk-XF3TZSZS.js.map +0 -1
- package/dist/chunk-YB3US6OT.js +0 -61
- package/dist/chunk-YB3US6OT.js.map +0 -1
- package/dist/chunk-YDDE5TIH.js +0 -204
- package/dist/chunk-YDDE5TIH.js.map +0 -1
- package/dist/chunk-YO22XLHI.js +0 -7
- package/dist/chunk-YO22XLHI.js.map +0 -1
- package/dist/chunk-Z2O6LYVP.js +0 -144
- package/dist/chunk-Z2O6LYVP.js.map +0 -1
- package/dist/chunk-ZKAH3APE.js +0 -1
- package/dist/chunk-ZKAH3APE.js.map +0 -1
- package/dist/commonConstants.cjs.map +0 -1
- package/dist/commonConstants.js.map +0 -1
- package/dist/deploymentsSlice/constants.cjs.map +0 -1
- package/dist/deploymentsSlice/constants.js.map +0 -1
- package/dist/deploymentsSlice/thunks.cjs.map +0 -1
- package/dist/deploymentsSlice/thunks.js.map +0 -1
- package/dist/devicesSlice/constants.cjs.map +0 -1
- package/dist/devicesSlice/constants.js.map +0 -1
- package/dist/devicesSlice/thunks.cjs.map +0 -1
- package/dist/devicesSlice/thunks.js.map +0 -1
- package/dist/monitorSlice/constants.cjs.map +0 -1
- package/dist/monitorSlice/constants.js.map +0 -1
- package/dist/onboardingSlice/thunks.cjs.map +0 -1
- package/dist/onboardingSlice/thunks.js.map +0 -1
- package/dist/organizationSlice/constants.cjs.map +0 -1
- package/dist/organizationSlice/constants.js.map +0 -1
- package/dist/organizationSlice/thunks.cjs.map +0 -1
- package/dist/organizationSlice/thunks.js.map +0 -1
- package/dist/organizationSlice/types.cjs.map +0 -1
- package/dist/organizationSlice/types.js.map +0 -1
- package/dist/selectors.cjs.map +0 -1
- package/dist/selectors.js.map +0 -1
- package/dist/usersSlice/constants.cjs.map +0 -1
- package/dist/usersSlice/constants.js.map +0 -1
- package/dist/usersSlice/thunks.cjs.map +0 -1
- package/dist/usersSlice/thunks.js.map +0 -1
|
@@ -1,1917 +1,86 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/monitorSlice/thunks.ts
|
|
31
|
-
var thunks_exports = {};
|
|
32
|
-
__export(thunks_exports, {
|
|
33
|
-
changeNotificationSetting: () => changeNotificationSetting,
|
|
34
|
-
getDeviceAlerts: () => getDeviceAlerts,
|
|
35
|
-
getDeviceMonitorConfig: () => getDeviceMonitorConfig,
|
|
36
|
-
getIssueCountsByType: () => getIssueCountsByType,
|
|
37
|
-
getLatestDeviceAlerts: () => getLatestDeviceAlerts
|
|
38
|
-
});
|
|
39
|
-
module.exports = __toCommonJS(thunks_exports);
|
|
40
|
-
|
|
41
|
-
// src/monitorSlice/index.ts
|
|
42
|
-
var import_toolkit = require("@reduxjs/toolkit");
|
|
43
|
-
|
|
44
|
-
// src/constants.ts
|
|
45
|
-
var import_constants3 = require("@northern.tech/utils/constants");
|
|
46
|
-
|
|
47
|
-
// src/commonConstants.tsx
|
|
48
|
-
var import_js = require("@mdi/js");
|
|
49
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
-
var timeUnits = {
|
|
51
|
-
days: "days",
|
|
52
|
-
minutes: "minutes",
|
|
53
|
-
hours: "hours"
|
|
54
|
-
};
|
|
55
|
-
var UNGROUPED_GROUP = { id: "*|=ungrouped=|*", name: "Unassigned" };
|
|
56
|
-
var oneSecond = 1e3;
|
|
57
|
-
var TIMEOUTS = {
|
|
58
|
-
debounceDefault: 700,
|
|
59
|
-
debounceShort: 300,
|
|
60
|
-
halfASecond: 0.5 * oneSecond,
|
|
61
|
-
oneSecond,
|
|
62
|
-
twoSeconds: 2 * oneSecond,
|
|
63
|
-
threeSeconds: 3 * oneSecond,
|
|
64
|
-
fiveSeconds: 5 * oneSecond,
|
|
65
|
-
refreshDefault: 10 * oneSecond,
|
|
66
|
-
refreshLong: 60 * oneSecond
|
|
67
|
-
};
|
|
68
|
-
var DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };
|
|
69
|
-
var defaultIdAttribute = Object.freeze({ attribute: "id", scope: import_constants3.ATTRIBUTE_SCOPES.identity });
|
|
70
|
-
var credentialTypes = {
|
|
71
|
-
aws: "aws",
|
|
72
|
-
http: "http",
|
|
73
|
-
sas: "sas",
|
|
74
|
-
x509: "x509"
|
|
75
|
-
};
|
|
76
|
-
var EXTERNAL_PROVIDER = {
|
|
77
|
-
"iot-core": {
|
|
78
|
-
credentialsType: credentialTypes.aws,
|
|
79
|
-
icon: import_js.mdiAws,
|
|
80
|
-
title: "AWS IoT Core",
|
|
81
|
-
twinTitle: "Device Shadow",
|
|
82
|
-
provider: "iot-core",
|
|
83
|
-
enabled: true,
|
|
84
|
-
deviceTwin: true,
|
|
85
|
-
configHint: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: "For help finding your AWS IoT Core connection string, check the AWS IoT documentation." })
|
|
86
|
-
},
|
|
87
|
-
"iot-hub": {
|
|
88
|
-
credentialsType: credentialTypes.sas,
|
|
89
|
-
icon: import_js.mdiMicrosoftAzure,
|
|
90
|
-
title: "Azure IoT Hub",
|
|
91
|
-
twinTitle: "Device Twin",
|
|
92
|
-
provider: "iot-hub",
|
|
93
|
-
enabled: true,
|
|
94
|
-
deviceTwin: true,
|
|
95
|
-
configHint: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
96
|
-
"For help finding your Azure IoT Hub connection string, look under 'Shared access policies' in the Microsoft Azure UI as described",
|
|
97
|
-
" ",
|
|
98
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
|
-
"a",
|
|
100
|
-
{
|
|
101
|
-
href: "https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn",
|
|
102
|
-
target: "_blank",
|
|
103
|
-
rel: "noopener noreferrer",
|
|
104
|
-
children: "here"
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
"."
|
|
108
|
-
] })
|
|
109
|
-
},
|
|
110
|
-
webhook: {
|
|
111
|
-
credentialsType: credentialTypes.http,
|
|
112
|
-
deviceTwin: false,
|
|
113
|
-
twinTitle: "",
|
|
114
|
-
// disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.
|
|
115
|
-
enabled: false,
|
|
116
|
-
provider: "webhook"
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
var emptyWebhook = {
|
|
120
|
-
description: "",
|
|
121
|
-
provider: "webhook",
|
|
122
|
-
credentials: {
|
|
123
|
-
type: EXTERNAL_PROVIDER.webhook.credentialsType,
|
|
124
|
-
[EXTERNAL_PROVIDER.webhook.credentialsType]: {
|
|
125
|
-
secret: "",
|
|
126
|
-
url: ""
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
var regionNames = new Intl.DisplayNames(["en"], { type: "region" });
|
|
131
|
-
var countries = [
|
|
132
|
-
"AD",
|
|
133
|
-
"AE",
|
|
134
|
-
"AF",
|
|
135
|
-
"AG",
|
|
136
|
-
"AI",
|
|
137
|
-
"AL",
|
|
138
|
-
"AM",
|
|
139
|
-
"AO",
|
|
140
|
-
"AQ",
|
|
141
|
-
"AR",
|
|
142
|
-
"AS",
|
|
143
|
-
"AT",
|
|
144
|
-
"AU",
|
|
145
|
-
"AW",
|
|
146
|
-
"AX",
|
|
147
|
-
"AZ",
|
|
148
|
-
"BA",
|
|
149
|
-
"BB",
|
|
150
|
-
"BD",
|
|
151
|
-
"BE",
|
|
152
|
-
"BF",
|
|
153
|
-
"BG",
|
|
154
|
-
"BH",
|
|
155
|
-
"BI",
|
|
156
|
-
"BJ",
|
|
157
|
-
"BL",
|
|
158
|
-
"BM",
|
|
159
|
-
"BN",
|
|
160
|
-
"BO",
|
|
161
|
-
"BR",
|
|
162
|
-
"BS",
|
|
163
|
-
"BT",
|
|
164
|
-
"BV",
|
|
165
|
-
"BW",
|
|
166
|
-
"BY",
|
|
167
|
-
"BZ",
|
|
168
|
-
"CA",
|
|
169
|
-
"CC",
|
|
170
|
-
"CD",
|
|
171
|
-
"CF",
|
|
172
|
-
"CG",
|
|
173
|
-
"CH",
|
|
174
|
-
"CI",
|
|
175
|
-
"CK",
|
|
176
|
-
"CL",
|
|
177
|
-
"CM",
|
|
178
|
-
"CN",
|
|
179
|
-
"CO",
|
|
180
|
-
"CR",
|
|
181
|
-
"CU",
|
|
182
|
-
"CV",
|
|
183
|
-
"CW",
|
|
184
|
-
"CX",
|
|
185
|
-
"CY",
|
|
186
|
-
"CZ",
|
|
187
|
-
"DE",
|
|
188
|
-
"DJ",
|
|
189
|
-
"DK",
|
|
190
|
-
"DM",
|
|
191
|
-
"DO",
|
|
192
|
-
"DZ",
|
|
193
|
-
"EC",
|
|
194
|
-
"EE",
|
|
195
|
-
"EG",
|
|
196
|
-
"EH",
|
|
197
|
-
"ER",
|
|
198
|
-
"ES",
|
|
199
|
-
"ET",
|
|
200
|
-
"FI",
|
|
201
|
-
"FJ",
|
|
202
|
-
"FK",
|
|
203
|
-
"FM",
|
|
204
|
-
"FO",
|
|
205
|
-
"FR",
|
|
206
|
-
"GA",
|
|
207
|
-
"GB",
|
|
208
|
-
"GD",
|
|
209
|
-
"GE",
|
|
210
|
-
"GF",
|
|
211
|
-
"GG",
|
|
212
|
-
"GH",
|
|
213
|
-
"GI",
|
|
214
|
-
"GL",
|
|
215
|
-
"GM",
|
|
216
|
-
"GN",
|
|
217
|
-
"GP",
|
|
218
|
-
"GQ",
|
|
219
|
-
"GR",
|
|
220
|
-
"GS",
|
|
221
|
-
"GT",
|
|
222
|
-
"GU",
|
|
223
|
-
"GW",
|
|
224
|
-
"GY",
|
|
225
|
-
"HK",
|
|
226
|
-
"HM",
|
|
227
|
-
"HN",
|
|
228
|
-
"HR",
|
|
229
|
-
"HT",
|
|
230
|
-
"HU",
|
|
231
|
-
"ID",
|
|
232
|
-
"IE",
|
|
233
|
-
"IL",
|
|
234
|
-
"IM",
|
|
235
|
-
"IN",
|
|
236
|
-
"IO",
|
|
237
|
-
"IQ",
|
|
238
|
-
"IR",
|
|
239
|
-
"IS",
|
|
240
|
-
"IT",
|
|
241
|
-
"JE",
|
|
242
|
-
"JM",
|
|
243
|
-
"JO",
|
|
244
|
-
"JP",
|
|
245
|
-
"KE",
|
|
246
|
-
"KG",
|
|
247
|
-
"KH",
|
|
248
|
-
"KI",
|
|
249
|
-
"KM",
|
|
250
|
-
"KN",
|
|
251
|
-
"KP",
|
|
252
|
-
"KR",
|
|
253
|
-
"KW",
|
|
254
|
-
"KY",
|
|
255
|
-
"KZ",
|
|
256
|
-
"LA",
|
|
257
|
-
"LB",
|
|
258
|
-
"LC",
|
|
259
|
-
"LI",
|
|
260
|
-
"LK",
|
|
261
|
-
"LR",
|
|
262
|
-
"LS",
|
|
263
|
-
"LT",
|
|
264
|
-
"LU",
|
|
265
|
-
"LV",
|
|
266
|
-
"LY",
|
|
267
|
-
"MA",
|
|
268
|
-
"MC",
|
|
269
|
-
"MD",
|
|
270
|
-
"ME",
|
|
271
|
-
"MF",
|
|
272
|
-
"MG",
|
|
273
|
-
"MH",
|
|
274
|
-
"MK",
|
|
275
|
-
"ML",
|
|
276
|
-
"MM",
|
|
277
|
-
"MN",
|
|
278
|
-
"MO",
|
|
279
|
-
"MP",
|
|
280
|
-
"MQ",
|
|
281
|
-
"MR",
|
|
282
|
-
"MS",
|
|
283
|
-
"MT",
|
|
284
|
-
"MU",
|
|
285
|
-
"MV",
|
|
286
|
-
"MW",
|
|
287
|
-
"MX",
|
|
288
|
-
"MY",
|
|
289
|
-
"MZ",
|
|
290
|
-
"NA",
|
|
291
|
-
"NC",
|
|
292
|
-
"NE",
|
|
293
|
-
"NF",
|
|
294
|
-
"NG",
|
|
295
|
-
"NI",
|
|
296
|
-
"NL",
|
|
297
|
-
"NO",
|
|
298
|
-
"NP",
|
|
299
|
-
"NR",
|
|
300
|
-
"NU",
|
|
301
|
-
"NZ",
|
|
302
|
-
"OM",
|
|
303
|
-
"PA",
|
|
304
|
-
"PE",
|
|
305
|
-
"PF",
|
|
306
|
-
"PG",
|
|
307
|
-
"PH",
|
|
308
|
-
"PK",
|
|
309
|
-
"PL",
|
|
310
|
-
"PM",
|
|
311
|
-
"PN",
|
|
312
|
-
"PR",
|
|
313
|
-
"PS",
|
|
314
|
-
"PT",
|
|
315
|
-
"PW",
|
|
316
|
-
"PY",
|
|
317
|
-
"QA",
|
|
318
|
-
"RE",
|
|
319
|
-
"RO",
|
|
320
|
-
"RS",
|
|
321
|
-
"RU",
|
|
322
|
-
"RW",
|
|
323
|
-
"SA",
|
|
324
|
-
"SB",
|
|
325
|
-
"SC",
|
|
326
|
-
"SD",
|
|
327
|
-
"SE",
|
|
328
|
-
"SG",
|
|
329
|
-
"SH",
|
|
330
|
-
"SI",
|
|
331
|
-
"SJ",
|
|
332
|
-
"SK",
|
|
333
|
-
"SL",
|
|
334
|
-
"SM",
|
|
335
|
-
"SN",
|
|
336
|
-
"SO",
|
|
337
|
-
"SR",
|
|
338
|
-
"SS",
|
|
339
|
-
"ST",
|
|
340
|
-
"SV",
|
|
341
|
-
"SX",
|
|
342
|
-
"SY",
|
|
343
|
-
"SZ",
|
|
344
|
-
"TC",
|
|
345
|
-
"TD",
|
|
346
|
-
"TF",
|
|
347
|
-
"TG",
|
|
348
|
-
"TH",
|
|
349
|
-
"TJ",
|
|
350
|
-
"TK",
|
|
351
|
-
"TL",
|
|
352
|
-
"TM",
|
|
353
|
-
"TN",
|
|
354
|
-
"TO",
|
|
355
|
-
"TR",
|
|
356
|
-
"TT",
|
|
357
|
-
"TV",
|
|
358
|
-
"TW",
|
|
359
|
-
"TZ",
|
|
360
|
-
"UA",
|
|
361
|
-
"UG",
|
|
362
|
-
"US",
|
|
363
|
-
"UY",
|
|
364
|
-
"UZ",
|
|
365
|
-
"VA",
|
|
366
|
-
"VC",
|
|
367
|
-
"VE",
|
|
368
|
-
"VG",
|
|
369
|
-
"VI",
|
|
370
|
-
"VN",
|
|
371
|
-
"VU",
|
|
372
|
-
"WF",
|
|
373
|
-
"WS",
|
|
374
|
-
"XK",
|
|
375
|
-
"YE",
|
|
376
|
-
"YT",
|
|
377
|
-
"ZA",
|
|
378
|
-
"ZM",
|
|
379
|
-
"ZW"
|
|
380
|
-
].map((code) => ({ code, label: regionNames.of(code) })).sort((a, b) => a.label.localeCompare(b.label));
|
|
381
|
-
|
|
382
|
-
// src/deploymentsSlice/constants.ts
|
|
383
|
-
var alreadyInstalled = "already-installed";
|
|
384
|
-
var deploymentSubstates = {
|
|
385
|
-
aborted: "aborted",
|
|
386
|
-
alreadyInstalled,
|
|
387
|
-
decommissioned: "decommissioned",
|
|
388
|
-
downloading: "downloading",
|
|
389
|
-
failure: "failure",
|
|
390
|
-
installing: "installing",
|
|
391
|
-
noartifact: "noartifact",
|
|
392
|
-
artifact_too_big: "artifact_too_big",
|
|
393
|
-
pause_before_committing: "pause_before_committing",
|
|
394
|
-
pause_before_installing: "pause_before_installing",
|
|
395
|
-
pause_before_rebooting: "pause_before_rebooting",
|
|
396
|
-
pending: "pending",
|
|
397
|
-
rebooting: "rebooting",
|
|
398
|
-
success: "success"
|
|
399
|
-
};
|
|
400
|
-
var deploymentStatesToSubstates = {
|
|
401
|
-
failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],
|
|
402
|
-
inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],
|
|
403
|
-
paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],
|
|
404
|
-
pending: [deploymentSubstates.pending],
|
|
405
|
-
successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact, deploymentSubstates.artifact_too_big]
|
|
406
|
-
};
|
|
407
|
-
var deploymentStatesToSubstatesWithSkipped = {
|
|
408
|
-
...deploymentStatesToSubstates,
|
|
409
|
-
failures: [deploymentSubstates.failure],
|
|
410
|
-
skipped: [
|
|
411
|
-
deploymentSubstates.aborted,
|
|
412
|
-
deploymentSubstates.noartifact,
|
|
413
|
-
deploymentSubstates.artifact_too_big,
|
|
414
|
-
deploymentSubstates.alreadyInstalled,
|
|
415
|
-
deploymentSubstates.decommissioned
|
|
416
|
-
],
|
|
417
|
-
successes: [deploymentSubstates.success]
|
|
418
|
-
};
|
|
419
|
-
var installationSubstatesMap = {
|
|
420
|
-
download: {
|
|
421
|
-
title: "download",
|
|
422
|
-
done: "downloaded",
|
|
423
|
-
successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],
|
|
424
|
-
failureIndicators: deploymentStatesToSubstates.failures,
|
|
425
|
-
pauseConfigurationIndicator: "ArtifactInstall_Enter"
|
|
426
|
-
},
|
|
427
|
-
install: {
|
|
428
|
-
title: "install",
|
|
429
|
-
done: "installed",
|
|
430
|
-
successIndicators: [
|
|
431
|
-
deploymentSubstates.rebooting,
|
|
432
|
-
deploymentSubstates.pause_before_rebooting,
|
|
433
|
-
deploymentSubstates.pause_before_committing,
|
|
434
|
-
deploymentSubstates.success
|
|
435
|
-
],
|
|
436
|
-
failureIndicators: deploymentStatesToSubstates.failures,
|
|
437
|
-
pauseConfigurationIndicator: "ArtifactReboot_Enter"
|
|
438
|
-
},
|
|
439
|
-
reboot: {
|
|
440
|
-
title: "reboot",
|
|
441
|
-
done: "rebooted",
|
|
442
|
-
successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],
|
|
443
|
-
failureIndicators: deploymentStatesToSubstates.failures,
|
|
444
|
-
pauseConfigurationIndicator: "ArtifactCommit_Enter"
|
|
445
|
-
},
|
|
446
|
-
commit: {
|
|
447
|
-
title: "commit",
|
|
448
|
-
done: "committed",
|
|
449
|
-
successIndicators: deploymentStatesToSubstates.successes,
|
|
450
|
-
failureIndicators: deploymentStatesToSubstates.failures,
|
|
451
|
-
pauseConfigurationIndicator: void 0
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
var DEPLOYMENT_STATES = {
|
|
455
|
-
finished: "finished",
|
|
456
|
-
inprogress: "inprogress",
|
|
457
|
-
pending: "pending",
|
|
458
|
-
scheduled: "scheduled"
|
|
459
|
-
};
|
|
460
|
-
var listDefaultsByState = {
|
|
461
|
-
[DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },
|
|
462
|
-
[DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },
|
|
463
|
-
[DEPLOYMENT_STATES.scheduled]: { ...import_constants3.DEVICE_LIST_DEFAULTS },
|
|
464
|
-
[DEPLOYMENT_STATES.finished]: { ...import_constants3.DEVICE_LIST_DEFAULTS },
|
|
465
|
-
sort: { direction: import_constants3.SORTING_OPTIONS.desc }
|
|
466
|
-
};
|
|
467
|
-
var DEFAULT_PENDING_INPROGRESS_COUNT = 10;
|
|
468
|
-
var DEPLOYMENT_ROUTES = {
|
|
469
|
-
active: {
|
|
470
|
-
key: "active",
|
|
471
|
-
route: "/deployments/active",
|
|
472
|
-
states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],
|
|
473
|
-
title: "Active"
|
|
474
|
-
},
|
|
475
|
-
finished: {
|
|
476
|
-
key: "finished",
|
|
477
|
-
route: "/deployments/finished",
|
|
478
|
-
states: [DEPLOYMENT_STATES.finished],
|
|
479
|
-
title: "Finished"
|
|
480
|
-
},
|
|
481
|
-
scheduled: {
|
|
482
|
-
key: "scheduled",
|
|
483
|
-
route: "/deployments/scheduled",
|
|
484
|
-
states: [DEPLOYMENT_STATES.scheduled],
|
|
485
|
-
title: "Scheduled"
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
var defaultStats = {
|
|
489
|
-
[deploymentSubstates.aborted]: 0,
|
|
490
|
-
[deploymentSubstates.alreadyInstalled]: 0,
|
|
491
|
-
[deploymentSubstates.decommissioned]: 0,
|
|
492
|
-
[deploymentSubstates.downloading]: 0,
|
|
493
|
-
[deploymentSubstates.failure]: 0,
|
|
494
|
-
[deploymentSubstates.installing]: 0,
|
|
495
|
-
[deploymentSubstates.noartifact]: 0,
|
|
496
|
-
[deploymentSubstates.pause_before_committing]: 0,
|
|
497
|
-
[deploymentSubstates.pause_before_installing]: 0,
|
|
498
|
-
[deploymentSubstates.pause_before_rebooting]: 0,
|
|
499
|
-
[deploymentSubstates.pending]: 0,
|
|
500
|
-
[deploymentSubstates.rebooting]: 0,
|
|
501
|
-
[deploymentSubstates.success]: 0
|
|
502
|
-
};
|
|
503
|
-
var deploymentPrototype = {
|
|
504
|
-
devices: {},
|
|
505
|
-
name: void 0,
|
|
506
|
-
statistics: { status: {} }
|
|
507
|
-
};
|
|
508
|
-
var pauseMap = {
|
|
509
|
-
[deploymentSubstates.pause_before_installing]: {
|
|
510
|
-
title: installationSubstatesMap.download.done,
|
|
511
|
-
followUp: installationSubstatesMap.download.pauseConfigurationIndicator
|
|
512
|
-
},
|
|
513
|
-
[deploymentSubstates.pause_before_rebooting]: {
|
|
514
|
-
title: installationSubstatesMap.install.done,
|
|
515
|
-
followUp: installationSubstatesMap.install.pauseConfigurationIndicator
|
|
516
|
-
},
|
|
517
|
-
[deploymentSubstates.pause_before_committing]: {
|
|
518
|
-
title: installationSubstatesMap.reboot.done,
|
|
519
|
-
followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
|
|
523
|
-
// src/organizationSlice/constants.ts
|
|
524
|
-
var auditlogTypes = {
|
|
525
|
-
artifact: { title: "Artifact", queryParameter: "object_type", value: "artifact" },
|
|
526
|
-
deployment: { title: "Deployment", queryParameter: "object_deployment_name", value: "deployment" },
|
|
527
|
-
device: { title: "Device", queryParameter: "object_id", value: "device" },
|
|
528
|
-
user_access_token: { title: "Personal Access Token", queryParameter: "user_access_token", value: "user_access_token" },
|
|
529
|
-
user: { title: "User", queryParameter: "object_id", value: "user" },
|
|
530
|
-
tenant: { title: "Tenant", queryParameter: "object_id", value: "tenant" }
|
|
531
|
-
};
|
|
532
|
-
var AUDIT_LOGS_TYPES = [auditlogTypes.artifact, auditlogTypes.deployment, auditlogTypes.device, auditlogTypes.user_access_token, auditlogTypes.user];
|
|
533
|
-
var SP_AUDIT_LOGS_TYPES = [auditlogTypes.user, auditlogTypes.tenant];
|
|
534
|
-
var TENANT_LIST_DEFAULT = {
|
|
535
|
-
page: 1,
|
|
536
|
-
perPage: 20
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
// src/usersSlice/constants.ts
|
|
540
|
-
var USER_LOGOUT = "USER_LOGOUT";
|
|
541
|
-
var settingsKeys = { initialized: "settings-initialized" };
|
|
542
|
-
var READ_STATES = {
|
|
543
|
-
read: "read",
|
|
544
|
-
seen: "seen",
|
|
545
|
-
unread: "unread"
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
// src/monitorSlice/index.ts
|
|
549
|
-
var sliceName = "monitor";
|
|
550
|
-
var initialState = {
|
|
551
|
-
alerts: {
|
|
552
|
-
alertList: { ...import_constants3.DEVICE_LIST_DEFAULTS, total: 0 },
|
|
553
|
-
byDeviceId: {}
|
|
554
|
-
},
|
|
555
|
-
issueCounts: {
|
|
556
|
-
byType: Object.keys(import_constants3.DEVICE_ISSUE_OPTIONS).reduce((accu, key) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {})
|
|
557
|
-
},
|
|
558
|
-
settings: {
|
|
559
|
-
global: {
|
|
560
|
-
channels: {
|
|
561
|
-
...Object.keys(import_constants3.alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {})
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
var monitorSlice = (0, import_toolkit.createSlice)({
|
|
567
|
-
name: sliceName,
|
|
568
|
-
initialState,
|
|
569
|
-
reducers: {
|
|
570
|
-
changeAlertChannel: (state, action) => {
|
|
571
|
-
const { channel, enabled } = action.payload;
|
|
572
|
-
state.settings.global.channels[channel] = { enabled };
|
|
573
|
-
},
|
|
574
|
-
receiveDeviceAlerts: (state, action) => {
|
|
575
|
-
const { deviceId, alerts } = action.payload;
|
|
576
|
-
state.alerts.byDeviceId[deviceId] = { alerts };
|
|
577
|
-
},
|
|
578
|
-
receiveLatestDeviceAlerts: (state, action) => {
|
|
579
|
-
const { deviceId, alerts } = action.payload;
|
|
580
|
-
state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };
|
|
581
|
-
},
|
|
582
|
-
receiveDeviceIssueCounts: (state, action) => {
|
|
583
|
-
const { issueType, counts } = action.payload;
|
|
584
|
-
state.issueCounts.byType[issueType] = counts;
|
|
585
|
-
},
|
|
586
|
-
setAlertListState: (state, action) => {
|
|
587
|
-
state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
});
|
|
591
|
-
var actions = monitorSlice.actions;
|
|
592
|
-
var monitorSlice_default = monitorSlice.reducer;
|
|
593
|
-
|
|
594
|
-
// src/appSlice/index.ts
|
|
595
|
-
var import_toolkit2 = require("@reduxjs/toolkit");
|
|
596
|
-
var sliceName2 = "app";
|
|
597
|
-
var getYesterday = () => {
|
|
598
|
-
const today = /* @__PURE__ */ new Date();
|
|
599
|
-
today.setDate(today.getDate() - 1);
|
|
600
|
-
return today.toISOString();
|
|
601
|
-
};
|
|
602
|
-
var initialState2 = {
|
|
603
|
-
appInitDone: false,
|
|
604
|
-
cancelSource: void 0,
|
|
605
|
-
commit: "",
|
|
606
|
-
demoArtifactLink: "https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender",
|
|
607
|
-
hostAddress: null,
|
|
608
|
-
snackbar: {
|
|
609
|
-
action: void 0,
|
|
610
|
-
autoHideDuration: void 0,
|
|
611
|
-
message: "",
|
|
612
|
-
open: false,
|
|
613
|
-
preventClickToCopy: false
|
|
614
|
-
},
|
|
615
|
-
// return boolean rather than organization details
|
|
616
|
-
features: {
|
|
617
|
-
hasAiEnabled: false,
|
|
618
|
-
hasAuditlogs: false,
|
|
619
|
-
hasDeltaProgress: false,
|
|
620
|
-
hasMultitenancy: false,
|
|
621
|
-
hasDeviceConfig: false,
|
|
622
|
-
hasDeviceConnect: false,
|
|
623
|
-
hasFeedbackEnabled: false,
|
|
624
|
-
hasManifestsEnabled: false,
|
|
625
|
-
hasMonitor: false,
|
|
626
|
-
hasMCUEnabled: false,
|
|
627
|
-
isHosted: true,
|
|
628
|
-
isEnterprise: false
|
|
629
|
-
},
|
|
630
|
-
feedbackProbability: 0.3,
|
|
631
|
-
firstLoginAfterSignup: false,
|
|
632
|
-
hostedAnnouncement: "",
|
|
633
|
-
docsVersion: "",
|
|
634
|
-
recaptchaSiteKey: "",
|
|
635
|
-
searchState: {
|
|
636
|
-
deviceIds: [],
|
|
637
|
-
searchTerm: "",
|
|
638
|
-
searchTotal: 0,
|
|
639
|
-
isSearching: false,
|
|
640
|
-
sort: {
|
|
641
|
-
direction: import_constants3.SORTING_OPTIONS.desc
|
|
642
|
-
// key: null,
|
|
643
|
-
// scope: null
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
sentry: {
|
|
647
|
-
location: "",
|
|
648
|
-
replaysSessionSampleRate: 0.1,
|
|
649
|
-
tracesSampleRate: 1
|
|
650
|
-
},
|
|
651
|
-
stripeAPIKey: "",
|
|
652
|
-
trackerCode: "",
|
|
653
|
-
uploadsById: {
|
|
654
|
-
// id: { progress: 0, cancelSource: undefined }
|
|
655
|
-
},
|
|
656
|
-
newThreshold: getYesterday(),
|
|
657
|
-
offlineThreshold: getYesterday(),
|
|
658
|
-
versionInformation: {
|
|
659
|
-
Integration: "",
|
|
660
|
-
"Mender-Artifact": "",
|
|
661
|
-
"Meta-Mender": ""
|
|
662
|
-
},
|
|
663
|
-
yesterday: void 0
|
|
664
|
-
};
|
|
665
|
-
var appSlice = (0, import_toolkit2.createSlice)({
|
|
666
|
-
name: sliceName2,
|
|
667
|
-
initialState: initialState2,
|
|
668
|
-
reducers: {
|
|
669
|
-
setFeatures: (state, action) => {
|
|
670
|
-
state.features = {
|
|
671
|
-
...state.features,
|
|
672
|
-
...action.payload
|
|
673
|
-
};
|
|
674
|
-
},
|
|
675
|
-
setSnackbar: (state, { payload }) => {
|
|
676
|
-
if (typeof payload === "string" || payload instanceof String) {
|
|
677
|
-
state.snackbar = {
|
|
678
|
-
...initialState2.snackbar,
|
|
679
|
-
message: payload,
|
|
680
|
-
open: !!payload
|
|
681
|
-
};
|
|
682
|
-
return;
|
|
683
|
-
}
|
|
684
|
-
const { message, autoHideDuration, action, preventClickToCopy = false } = payload;
|
|
685
|
-
state.snackbar = {
|
|
686
|
-
message,
|
|
687
|
-
autoHideDuration,
|
|
688
|
-
action,
|
|
689
|
-
preventClickToCopy,
|
|
690
|
-
open: !!message
|
|
691
|
-
};
|
|
692
|
-
},
|
|
693
|
-
setFirstLoginAfterSignup: (state, action) => {
|
|
694
|
-
state.firstLoginAfterSignup = action.payload;
|
|
695
|
-
},
|
|
696
|
-
setAnnouncement: (state, action) => {
|
|
697
|
-
state.hostedAnnouncement = action.payload;
|
|
698
|
-
},
|
|
699
|
-
setSearchState: (state, action) => {
|
|
700
|
-
state.searchState = {
|
|
701
|
-
...state.searchState,
|
|
702
|
-
...action.payload
|
|
703
|
-
};
|
|
704
|
-
},
|
|
705
|
-
setOfflineThreshold: (state, action) => {
|
|
706
|
-
state.offlineThreshold = action.payload;
|
|
707
|
-
},
|
|
708
|
-
initUpload: (state, action) => {
|
|
709
|
-
const { id, upload } = action.payload;
|
|
710
|
-
state.uploadsById[id] = upload;
|
|
711
|
-
},
|
|
712
|
-
uploadProgress: (state, action) => {
|
|
713
|
-
const { id, progress } = action.payload;
|
|
714
|
-
state.uploadsById[id] = {
|
|
715
|
-
...state.uploadsById[id],
|
|
716
|
-
progress
|
|
717
|
-
};
|
|
718
|
-
},
|
|
719
|
-
cleanUpUpload: (state, action) => {
|
|
720
|
-
const { [action.payload]: current, ...remainder } = state.uploadsById;
|
|
721
|
-
state.uploadsById = remainder;
|
|
722
|
-
},
|
|
723
|
-
setVersionInformation: (state, action) => {
|
|
724
|
-
state.versionInformation = {
|
|
725
|
-
...state.versionInformation,
|
|
726
|
-
...action.payload
|
|
727
|
-
};
|
|
728
|
-
},
|
|
729
|
-
setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),
|
|
730
|
-
setAppInitDone: (state) => {
|
|
731
|
-
state.appInitDone = true;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
});
|
|
735
|
-
var actions2 = appSlice.actions;
|
|
736
|
-
var appSlice_default = appSlice.reducer;
|
|
737
|
-
|
|
738
|
-
// src/deploymentsSlice/index.ts
|
|
739
|
-
var import_toolkit3 = require("@reduxjs/toolkit");
|
|
740
|
-
var sliceName3 = "deployments";
|
|
741
|
-
var initialState3 = {
|
|
742
|
-
byId: {
|
|
743
|
-
// [id]: { statistics: { status: {}, total_size }, devices: { [deploymentId]: { id, log } }, totalDeviceCount }
|
|
744
|
-
},
|
|
745
|
-
byStatus: {
|
|
746
|
-
finished: { deploymentIds: [], total: 0 },
|
|
747
|
-
inprogress: { deploymentIds: [], total: 0 },
|
|
748
|
-
pending: { deploymentIds: [], total: 0 },
|
|
749
|
-
scheduled: { deploymentIds: [], total: 0 }
|
|
750
|
-
},
|
|
751
|
-
config: {
|
|
752
|
-
binaryDelta: {
|
|
753
|
-
timeout: -1,
|
|
754
|
-
duplicatesWindow: -1,
|
|
755
|
-
compressionLevel: -1,
|
|
756
|
-
disableChecksum: false,
|
|
757
|
-
disableDecompression: false,
|
|
758
|
-
inputWindow: -1,
|
|
759
|
-
instructionBuffer: -1,
|
|
760
|
-
sourceWindow: -1
|
|
761
|
-
},
|
|
762
|
-
binaryDeltaLimits: {
|
|
763
|
-
timeout: { ...import_constants3.limitDefault, default: 60, max: 3600, min: 60 },
|
|
764
|
-
sourceWindow: import_constants3.limitDefault,
|
|
765
|
-
inputWindow: import_constants3.limitDefault,
|
|
766
|
-
duplicatesWindow: import_constants3.limitDefault,
|
|
767
|
-
instructionBuffer: import_constants3.limitDefault
|
|
768
|
-
}
|
|
769
|
-
},
|
|
770
|
-
deploymentDeviceLimit: 5e3,
|
|
771
|
-
selectedDeviceIds: [],
|
|
772
|
-
selectionState: {
|
|
773
|
-
finished: { ...import_constants3.DEVICE_LIST_DEFAULTS, endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" },
|
|
774
|
-
inprogress: { ...import_constants3.DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
|
|
775
|
-
pending: { ...import_constants3.DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
|
|
776
|
-
scheduled: { ...import_constants3.DEVICE_LIST_DEFAULTS, selection: [] },
|
|
777
|
-
general: {
|
|
778
|
-
state: DEPLOYMENT_ROUTES.active.key,
|
|
779
|
-
showCreationDialog: false,
|
|
780
|
-
showReportDialog: false,
|
|
781
|
-
reportType: null
|
|
782
|
-
// DeploymentConstants.DEPLOYMENT_TYPES.configuration|DeploymentConstants.DEPLOYMENT_TYPES.software
|
|
783
|
-
},
|
|
784
|
-
selectedId: void 0
|
|
785
|
-
}
|
|
786
|
-
};
|
|
787
|
-
var deploymentsSlice = (0, import_toolkit3.createSlice)({
|
|
788
|
-
name: sliceName3,
|
|
789
|
-
initialState: initialState3,
|
|
790
|
-
reducers: {
|
|
791
|
-
createdDeployment: (state, action) => {
|
|
792
|
-
state.byId[action.payload.id] = {
|
|
793
|
-
...deploymentPrototype,
|
|
794
|
-
...action.payload
|
|
795
|
-
};
|
|
796
|
-
state.byStatus[DEPLOYMENT_STATES.pending].total = state.byStatus[DEPLOYMENT_STATES.pending].total + 1;
|
|
797
|
-
state.byStatus[DEPLOYMENT_STATES.pending].deploymentIds = [...state.byStatus.pending.deploymentIds, action.payload.id];
|
|
798
|
-
state.selectionState[DEPLOYMENT_STATES.pending].selection = [action.payload.id, ...state.selectionState[DEPLOYMENT_STATES.pending].selection];
|
|
799
|
-
state.selectionState[DEPLOYMENT_STATES.pending].total = (state.selectionState[DEPLOYMENT_STATES.pending].total || 0) + 1;
|
|
800
|
-
},
|
|
801
|
-
removedDeployment: (state, action) => {
|
|
802
|
-
const { [action.payload]: removedDeployment, ...remainder } = state.byId;
|
|
803
|
-
state.byId = remainder;
|
|
804
|
-
},
|
|
805
|
-
receivedDeployment: (state, action) => {
|
|
806
|
-
state.byId[action.payload.id] = {
|
|
807
|
-
...state.byId[action.payload.id] || {},
|
|
808
|
-
...action.payload
|
|
809
|
-
};
|
|
810
|
-
},
|
|
811
|
-
receivedDeploymentDeviceLog: (state, action) => {
|
|
812
|
-
const { id, deviceId, log } = action.payload;
|
|
813
|
-
const deployment = {
|
|
814
|
-
...deploymentPrototype,
|
|
815
|
-
...state.byId[id]
|
|
816
|
-
};
|
|
817
|
-
state.byId[id] = {
|
|
818
|
-
...deployment,
|
|
819
|
-
devices: {
|
|
820
|
-
...deployment.devices,
|
|
821
|
-
[deviceId]: {
|
|
822
|
-
...deployment.devices[deviceId],
|
|
823
|
-
log
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
},
|
|
828
|
-
receivedDeploymentDevices: (state, action) => {
|
|
829
|
-
const { id, devices, selectedDeviceIds, totalDeviceCount } = action.payload;
|
|
830
|
-
state.byId[id] = {
|
|
831
|
-
...state.byId[id],
|
|
832
|
-
devices,
|
|
833
|
-
totalDeviceCount
|
|
834
|
-
};
|
|
835
|
-
state.selectedDeviceIds = selectedDeviceIds;
|
|
836
|
-
},
|
|
837
|
-
receivedDeployments: (state, action) => {
|
|
838
|
-
state.byId = {
|
|
839
|
-
...state.byId,
|
|
840
|
-
...action.payload
|
|
841
|
-
};
|
|
842
|
-
},
|
|
843
|
-
receivedDeploymentsForStatus: (state, action) => {
|
|
844
|
-
const { status, deploymentIds, total } = action.payload;
|
|
845
|
-
state.byStatus[status].deploymentIds = deploymentIds;
|
|
846
|
-
state.byStatus[status].total = total;
|
|
847
|
-
},
|
|
848
|
-
selectDeploymentsForStatus: (state, action) => {
|
|
849
|
-
const { status, deploymentIds, total } = action.payload;
|
|
850
|
-
state.selectionState[status].selection = deploymentIds;
|
|
851
|
-
state.selectionState[status].total = total;
|
|
852
|
-
},
|
|
853
|
-
setDeploymentsState: (state, action) => {
|
|
854
|
-
state.selectionState = action.payload;
|
|
855
|
-
},
|
|
856
|
-
setDeploymentsConfig: (state, action) => {
|
|
857
|
-
state.config = action.payload;
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
});
|
|
861
|
-
var actions3 = deploymentsSlice.actions;
|
|
862
|
-
var deploymentsSlice_default = deploymentsSlice.reducer;
|
|
863
|
-
|
|
864
|
-
// src/devicesSlice/index.ts
|
|
865
|
-
var import_helpers = require("@northern.tech/utils/helpers");
|
|
866
|
-
var import_toolkit4 = require("@reduxjs/toolkit");
|
|
867
|
-
var sliceName4 = "devices";
|
|
868
|
-
var initialState4 = {
|
|
869
|
-
byId: {
|
|
870
|
-
// [deviceId]: {
|
|
871
|
-
// ...,
|
|
872
|
-
// twinsByIntegration: { [external.provider.id]: twinData }
|
|
873
|
-
// }
|
|
874
|
-
},
|
|
875
|
-
byStatus: {
|
|
876
|
-
[import_constants3.DEVICE_STATES.accepted]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
877
|
-
[import_constants3.DEVICE_STATES.pending]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
878
|
-
[import_constants3.DEVICE_STATES.preauth]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
879
|
-
[import_constants3.DEVICE_STATES.rejected]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } }
|
|
880
|
-
},
|
|
881
|
-
deviceList: {
|
|
882
|
-
deviceIds: [],
|
|
883
|
-
...import_constants3.DEVICE_LIST_DEFAULTS,
|
|
884
|
-
selectedAttributes: [],
|
|
885
|
-
selectedIssues: [],
|
|
886
|
-
selection: [],
|
|
887
|
-
sort: {
|
|
888
|
-
direction: import_constants3.SORTING_OPTIONS.desc
|
|
889
|
-
// key: null,
|
|
890
|
-
// scope: null
|
|
891
|
-
},
|
|
892
|
-
state: import_constants3.DEVICE_STATES.accepted,
|
|
893
|
-
total: 0,
|
|
894
|
-
refreshTrigger: false,
|
|
895
|
-
isLoading: false,
|
|
896
|
-
detailsTab: "",
|
|
897
|
-
open: false
|
|
898
|
-
},
|
|
899
|
-
filters: [
|
|
900
|
-
// { key: 'device_type', value: 'raspberry', operator: '$eq', scope: 'inventory' }
|
|
901
|
-
],
|
|
902
|
-
filteringAttributes: { identityAttributes: [], inventoryAttributes: [], systemAttributes: [], tagAttributes: [] },
|
|
903
|
-
filteringAttributesLimit: 10,
|
|
904
|
-
filteringAttributesConfig: {
|
|
905
|
-
attributes: {
|
|
906
|
-
// inventory: ['some_attribute']
|
|
907
|
-
},
|
|
908
|
-
count: 0,
|
|
909
|
-
limit: 100
|
|
910
|
-
},
|
|
911
|
-
reports: [
|
|
912
|
-
// { items: [{ key: "someKey", count: 42 }], otherCount: 123, total: <otherCount + itemsCount> }
|
|
913
|
-
],
|
|
914
|
-
total: 0,
|
|
915
|
-
limits: {
|
|
916
|
-
standard: 0,
|
|
917
|
-
micro: 0,
|
|
918
|
-
system: 0
|
|
919
|
-
},
|
|
920
|
-
groups: {
|
|
921
|
-
byId: {
|
|
922
|
-
// groupName: { deviceIds: [], total: 0, filters: [] },
|
|
923
|
-
// dynamo: { deviceIds: [], total: 3, filters: [{ a: 1 }] }
|
|
924
|
-
},
|
|
925
|
-
selectedGroup: void 0
|
|
926
|
-
}
|
|
927
|
-
};
|
|
928
|
-
var devicesSlice = (0, import_toolkit4.createSlice)({
|
|
929
|
-
name: sliceName4,
|
|
930
|
-
initialState: initialState4,
|
|
931
|
-
reducers: {
|
|
932
|
-
receivedGroups: (state, action) => {
|
|
933
|
-
state.groups.byId = action.payload;
|
|
934
|
-
},
|
|
935
|
-
addToGroup: (state, action) => {
|
|
936
|
-
const { group, deviceIds } = action.payload;
|
|
937
|
-
const maybeExistingGroup = {
|
|
938
|
-
filters: [],
|
|
939
|
-
deviceIds: [],
|
|
940
|
-
...state.groups.byId[group]
|
|
941
|
-
};
|
|
942
|
-
state.groups.byId[group] = {
|
|
943
|
-
...maybeExistingGroup,
|
|
944
|
-
deviceIds: [...maybeExistingGroup.deviceIds, ...deviceIds].filter(import_helpers.duplicateFilter),
|
|
945
|
-
total: (maybeExistingGroup.total || 0) + 1
|
|
946
|
-
};
|
|
947
|
-
},
|
|
948
|
-
removeFromGroup: (state, action) => {
|
|
949
|
-
const { group, deviceIds: removedIds } = action.payload;
|
|
950
|
-
const { deviceIds = [], total = 0, ...maybeExistingGroup } = state.groups.byId[group] || {};
|
|
951
|
-
const changedGroup = {
|
|
952
|
-
...maybeExistingGroup,
|
|
953
|
-
deviceIds: deviceIds.filter((id) => !removedIds.includes(id)),
|
|
954
|
-
total: Math.max(total - removedIds.length, 0)
|
|
955
|
-
};
|
|
956
|
-
if (changedGroup.total || changedGroup.deviceIds.length) {
|
|
957
|
-
state.groups.byId[group] = changedGroup;
|
|
958
|
-
return;
|
|
959
|
-
} else if (state.groups.selectedGroup === group) {
|
|
960
|
-
state.groups.selectedGroup = void 0;
|
|
961
|
-
}
|
|
962
|
-
const { [group]: removal, ...remainingById } = state.groups.byId;
|
|
963
|
-
state.groups.byId = remainingById;
|
|
964
|
-
},
|
|
965
|
-
addGroup: (state, action) => {
|
|
966
|
-
const { groupName, group } = action.payload;
|
|
967
|
-
state.groups.byId[groupName] = {
|
|
968
|
-
...state.groups.byId[groupName],
|
|
969
|
-
...group
|
|
970
|
-
};
|
|
971
|
-
},
|
|
972
|
-
selectGroup: (state, { payload: group }) => {
|
|
973
|
-
state.deviceList.deviceIds = group && state.groups.byId[group] && state.groups.byId[group].deviceIds && state.groups.byId[group].deviceIds.length > 0 ? state.groups.byId[group].deviceIds : [];
|
|
974
|
-
state.groups.selectedGroup = group;
|
|
975
|
-
},
|
|
976
|
-
removeGroup: (state, action) => {
|
|
977
|
-
const { [action.payload]: removal, ...remainingById } = state.groups.byId;
|
|
978
|
-
state.groups.byId = remainingById;
|
|
979
|
-
state.groups.selectedGroup = state.groups.selectedGroup === action.payload ? void 0 : state.groups.selectedGroup;
|
|
980
|
-
},
|
|
981
|
-
setDeviceListState: (state, action) => {
|
|
982
|
-
state.deviceList = {
|
|
983
|
-
...state.deviceList,
|
|
984
|
-
...action.payload,
|
|
985
|
-
sort: {
|
|
986
|
-
...state.deviceList.sort,
|
|
987
|
-
...action.payload.sort
|
|
988
|
-
}
|
|
989
|
-
};
|
|
990
|
-
},
|
|
991
|
-
setFilterAttributes: (state, action) => {
|
|
992
|
-
state.filteringAttributes = action.payload;
|
|
993
|
-
},
|
|
994
|
-
setFilterablesConfig: (state, action) => {
|
|
995
|
-
state.filteringAttributesConfig = action.payload;
|
|
996
|
-
},
|
|
997
|
-
receivedDevices: (state, action) => {
|
|
998
|
-
state.byId = {
|
|
999
|
-
...state.byId,
|
|
1000
|
-
...action.payload
|
|
1001
|
-
};
|
|
1002
|
-
},
|
|
1003
|
-
setDeviceFilters: (state, action) => {
|
|
1004
|
-
if ((0, import_helpers.deepCompare)(action.payload, state.filters)) {
|
|
1005
|
-
return;
|
|
1006
|
-
}
|
|
1007
|
-
state.filters = action.payload.filter((filter) => filter.key && filter.operator && filter.scope && typeof filter.value !== "undefined");
|
|
1008
|
-
},
|
|
1009
|
-
setDeviceReports: (state, action) => {
|
|
1010
|
-
state.reports = action.payload;
|
|
1011
|
-
},
|
|
1012
|
-
setDevicesByStatus: (state, action) => {
|
|
1013
|
-
const { status, total, deviceIds } = action.payload;
|
|
1014
|
-
if (total) {
|
|
1015
|
-
state.byStatus[status].deviceIds = deviceIds;
|
|
1016
|
-
state.byStatus[status].counts.total = total;
|
|
1017
|
-
}
|
|
1018
|
-
},
|
|
1019
|
-
setDevicesCountByStatus: (state, action) => {
|
|
1020
|
-
const { countsPerTier, status } = action.payload;
|
|
1021
|
-
state.byStatus[status].counts = { ...countsPerTier, total: Object.values(countsPerTier).reduce((accu, tieredCount) => accu += tieredCount, 0) };
|
|
1022
|
-
},
|
|
1023
|
-
setDeviceLimits: (state, action) => {
|
|
1024
|
-
state.limits = action.payload;
|
|
1025
|
-
},
|
|
1026
|
-
receivedDevice: (state, action) => {
|
|
1027
|
-
state.byId[action.payload.id] = {
|
|
1028
|
-
...state.byId[action.payload.id],
|
|
1029
|
-
...action.payload
|
|
1030
|
-
};
|
|
1031
|
-
},
|
|
1032
|
-
maybeUpdateDevicesByStatus: (state, action) => {
|
|
1033
|
-
const { deviceId, authId } = action.payload;
|
|
1034
|
-
const device = state.byId[deviceId];
|
|
1035
|
-
const hasMultipleAuthSets = authId && device.auth_sets ? device.auth_sets.filter((authset) => authset.id !== authId).length > 0 : false;
|
|
1036
|
-
if (!hasMultipleAuthSets && Object.values(import_constants3.DEVICE_STATES).includes(device.status)) {
|
|
1037
|
-
const deviceIds = state.byStatus[device.status].deviceIds.filter((id) => id !== deviceId);
|
|
1038
|
-
const deviceTier = device.attributes.tier || "standard";
|
|
1039
|
-
state.byStatus[device.status] = {
|
|
1040
|
-
deviceIds,
|
|
1041
|
-
counts: {
|
|
1042
|
-
...state.byStatus[device.status].counts,
|
|
1043
|
-
[deviceTier]: Math.max(0, state.byStatus[device.status].counts[deviceTier] - 1),
|
|
1044
|
-
total: Math.max(0, state.byStatus[device.status].counts.total - 1)
|
|
1045
|
-
}
|
|
1046
|
-
};
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
});
|
|
1051
|
-
var actions4 = devicesSlice.actions;
|
|
1052
|
-
var devicesSlice_default = devicesSlice.reducer;
|
|
1053
|
-
|
|
1054
|
-
// src/onboardingSlice/index.ts
|
|
1055
|
-
var import_toolkit5 = require("@reduxjs/toolkit");
|
|
1056
|
-
var sliceName5 = "onboarding";
|
|
1057
|
-
var initialState5 = {
|
|
1058
|
-
approach: null,
|
|
1059
|
-
complete: false,
|
|
1060
|
-
deviceType: null,
|
|
1061
|
-
demoArtifactPort: 85,
|
|
1062
|
-
progress: null,
|
|
1063
|
-
showTips: null,
|
|
1064
|
-
showTipsDialog: false
|
|
1065
|
-
};
|
|
1066
|
-
var onboardingSlice = (0, import_toolkit5.createSlice)({
|
|
1067
|
-
name: sliceName5,
|
|
1068
|
-
initialState: initialState5,
|
|
1069
|
-
reducers: {
|
|
1070
|
-
setOnboardingState: (state, action) => ({ ...state, ...action.payload }),
|
|
1071
|
-
setDemoArtifactPort: (state, action) => {
|
|
1072
|
-
state.demoArtifactPort = action.payload;
|
|
1073
|
-
},
|
|
1074
|
-
setShowOnboardingHelp: (state, action) => {
|
|
1075
|
-
state.showTips = action.payload;
|
|
1076
|
-
},
|
|
1077
|
-
setShowDismissOnboardingTipsDialog: (state, action) => {
|
|
1078
|
-
state.showTipsDialog = action.payload;
|
|
1079
|
-
},
|
|
1080
|
-
setOnboardingComplete: (state, action) => {
|
|
1081
|
-
state.complete = action.payload;
|
|
1082
|
-
},
|
|
1083
|
-
setOnboardingProgress: (state, action) => {
|
|
1084
|
-
state.progress = action.payload;
|
|
1085
|
-
},
|
|
1086
|
-
setOnboardingDeviceType: (state, action) => {
|
|
1087
|
-
state.deviceType = action.payload;
|
|
1088
|
-
},
|
|
1089
|
-
setOnboardingApproach: (state, action) => {
|
|
1090
|
-
state.approach = action.payload;
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
});
|
|
1094
|
-
var actions5 = onboardingSlice.actions;
|
|
1095
|
-
var onboardingSlice_default = onboardingSlice.reducer;
|
|
1096
|
-
|
|
1097
|
-
// src/organizationSlice/index.ts
|
|
1098
|
-
var import_toolkit6 = require("@reduxjs/toolkit");
|
|
1099
|
-
var sliceName6 = "organization";
|
|
1100
|
-
var initialState6 = {
|
|
1101
|
-
card: {
|
|
1102
|
-
last4: "",
|
|
1103
|
-
expiration: { month: 1, year: 2020 },
|
|
1104
|
-
brand: ""
|
|
1105
|
-
},
|
|
1106
|
-
intentId: null,
|
|
1107
|
-
tenantList: {
|
|
1108
|
-
...TENANT_LIST_DEFAULT,
|
|
1109
|
-
total: 0,
|
|
1110
|
-
tenants: [],
|
|
1111
|
-
selectedTenant: null,
|
|
1112
|
-
sort: {
|
|
1113
|
-
direction: import_constants3.SORTING_OPTIONS.desc,
|
|
1114
|
-
key: "name"
|
|
1115
|
-
}
|
|
1116
|
-
},
|
|
1117
|
-
organization: {
|
|
1118
|
-
// id, name, status, tenant_token, plan
|
|
1119
|
-
},
|
|
1120
|
-
auditlog: {
|
|
1121
|
-
events: [],
|
|
1122
|
-
selectionState: {
|
|
1123
|
-
...import_constants3.DEVICE_LIST_DEFAULTS,
|
|
1124
|
-
detail: void 0,
|
|
1125
|
-
endDate: void 0,
|
|
1126
|
-
selectedIssue: void 0,
|
|
1127
|
-
sort: { direction: import_constants3.SORTING_OPTIONS.desc },
|
|
1128
|
-
startDate: void 0,
|
|
1129
|
-
total: 0,
|
|
1130
|
-
type: void 0,
|
|
1131
|
-
user: void 0,
|
|
1132
|
-
isLoading: false
|
|
1133
|
-
}
|
|
1134
|
-
},
|
|
1135
|
-
externalDeviceIntegrations: [
|
|
1136
|
-
// { <connection_string|x509|...>, id, provider }
|
|
1137
|
-
],
|
|
1138
|
-
ssoConfigs: [],
|
|
1139
|
-
webhooks: {
|
|
1140
|
-
// [id]: { events: [] }
|
|
1141
|
-
// for now:
|
|
1142
|
-
events: [],
|
|
1143
|
-
eventsTotal: 0
|
|
1144
|
-
}
|
|
1145
|
-
};
|
|
1146
|
-
var organizationSlice = (0, import_toolkit6.createSlice)({
|
|
1147
|
-
name: sliceName6,
|
|
1148
|
-
initialState: initialState6,
|
|
1149
|
-
reducers: {
|
|
1150
|
-
receiveAuditLogs: (state, action) => {
|
|
1151
|
-
const { events, total } = action.payload;
|
|
1152
|
-
state.auditlog.events = events;
|
|
1153
|
-
state.auditlog.selectionState.total = total;
|
|
1154
|
-
},
|
|
1155
|
-
setAuditLogState: (state, action) => {
|
|
1156
|
-
state.auditlog.selectionState = {
|
|
1157
|
-
...state.auditlog.selectionState,
|
|
1158
|
-
...action.payload
|
|
1159
|
-
};
|
|
1160
|
-
},
|
|
1161
|
-
receiveCurrentCard: (state, action) => {
|
|
1162
|
-
state.card = action.payload;
|
|
1163
|
-
},
|
|
1164
|
-
receiveSetupIntent: (state, action) => {
|
|
1165
|
-
state.intentId = action.payload;
|
|
1166
|
-
},
|
|
1167
|
-
setOrganization: (state, action) => {
|
|
1168
|
-
state.organization = { ...state.organization, ...action.payload };
|
|
1169
|
-
},
|
|
1170
|
-
setSubscription: (state, action) => {
|
|
1171
|
-
state.organization.subscription = { ...state.organization.subscription, ...action.payload };
|
|
1172
|
-
},
|
|
1173
|
-
setProducts: (state, action) => {
|
|
1174
|
-
state.products = action.payload;
|
|
1175
|
-
},
|
|
1176
|
-
setBillingProfile: (state, action) => {
|
|
1177
|
-
state.organization.billing_profile = action.payload;
|
|
1178
|
-
},
|
|
1179
|
-
setTenantListState: (state, action) => {
|
|
1180
|
-
state.tenantList = action.payload;
|
|
1181
|
-
},
|
|
1182
|
-
receiveExternalDeviceIntegrations: (state, action) => {
|
|
1183
|
-
state.externalDeviceIntegrations = action.payload;
|
|
1184
|
-
},
|
|
1185
|
-
receiveSsoConfigs: (state, action) => {
|
|
1186
|
-
state.ssoConfigs = action.payload;
|
|
1187
|
-
},
|
|
1188
|
-
receiveWebhookEvents: (state, action) => {
|
|
1189
|
-
const { value, total } = action.payload;
|
|
1190
|
-
state.webhooks.events = value;
|
|
1191
|
-
state.webhooks.eventsTotal = total;
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
});
|
|
1195
|
-
var actions6 = organizationSlice.actions;
|
|
1196
|
-
var organizationSlice_default = organizationSlice.reducer;
|
|
1197
|
-
|
|
1198
|
-
// src/releasesSlice/index.ts
|
|
1199
|
-
var import_toolkit7 = require("@reduxjs/toolkit");
|
|
1200
|
-
var sliceName7 = "releases";
|
|
1201
|
-
var initialState7 = {
|
|
1202
|
-
/*
|
|
1203
|
-
* Return list of saved artifacts objects
|
|
1204
|
-
*/
|
|
1205
|
-
/*
|
|
1206
|
-
* return list of artifacts where duplicate names are collated with device compatibility lists combined
|
|
1207
|
-
*/
|
|
1208
|
-
// artifacts: AppStore.getCollatedArtifacts(AppStore.getArtifactsRepo()),
|
|
1209
|
-
artifacts: [],
|
|
1210
|
-
/*
|
|
1211
|
-
* Return list of saved release objects
|
|
1212
|
-
*/
|
|
1213
|
-
byId: {
|
|
1214
|
-
/*
|
|
1215
|
-
[releaseName]: {
|
|
1216
|
-
artifacts: [
|
|
1217
|
-
{
|
|
1218
|
-
id: '',
|
|
1219
|
-
name: '',
|
|
1220
|
-
description: '',
|
|
1221
|
-
device_types_compatible: [],
|
|
1222
|
-
...
|
|
1223
|
-
updates: [{
|
|
1224
|
-
files: [
|
|
1225
|
-
{ size: 123, name: '' }
|
|
1226
|
-
],
|
|
1227
|
-
type_info: { type: '' }
|
|
1228
|
-
}],
|
|
1229
|
-
url: '' // optional
|
|
1230
|
-
}
|
|
1231
|
-
],
|
|
1232
|
-
modified: ''
|
|
1233
|
-
device_types_compatible,
|
|
1234
|
-
name: '',
|
|
1235
|
-
tags: ['something'],
|
|
1236
|
-
notes: ''
|
|
1237
|
-
}
|
|
1238
|
-
*/
|
|
1239
|
-
},
|
|
1240
|
-
deltaJobs: {
|
|
1241
|
-
/*
|
|
1242
|
-
[jobId]: {
|
|
1243
|
-
id: '',
|
|
1244
|
-
...
|
|
1245
|
-
}
|
|
1246
|
-
*/
|
|
1247
|
-
},
|
|
1248
|
-
deltaJobsList: {
|
|
1249
|
-
...import_constants3.DEVICE_LIST_DEFAULTS,
|
|
1250
|
-
jobIds: [],
|
|
1251
|
-
total: 0,
|
|
1252
|
-
sort: {
|
|
1253
|
-
direction: import_constants3.SORTING_OPTIONS.desc,
|
|
1254
|
-
key: "started"
|
|
1255
|
-
}
|
|
1256
|
-
},
|
|
1257
|
-
releasesList: {
|
|
1258
|
-
...import_constants3.DEVICE_LIST_DEFAULTS,
|
|
1259
|
-
searchedIds: [],
|
|
1260
|
-
releaseIds: [],
|
|
1261
|
-
selection: [],
|
|
1262
|
-
sort: {
|
|
1263
|
-
direction: import_constants3.SORTING_OPTIONS.desc,
|
|
1264
|
-
key: "modified"
|
|
1265
|
-
},
|
|
1266
|
-
isLoading: void 0,
|
|
1267
|
-
searchTerm: "",
|
|
1268
|
-
searchTotal: 0,
|
|
1269
|
-
selectedTags: [],
|
|
1270
|
-
total: 0,
|
|
1271
|
-
type: ""
|
|
1272
|
-
},
|
|
1273
|
-
tags: [],
|
|
1274
|
-
updateTypes: [],
|
|
1275
|
-
selectedJob: null,
|
|
1276
|
-
/*
|
|
1277
|
-
* Return single release with corresponding Artifacts
|
|
1278
|
-
*/
|
|
1279
|
-
selectedRelease: null
|
|
1280
|
-
};
|
|
1281
|
-
var releaseSlice = (0, import_toolkit7.createSlice)({
|
|
1282
|
-
name: sliceName7,
|
|
1283
|
-
initialState: initialState7,
|
|
1284
|
-
reducers: {
|
|
1285
|
-
receiveRelease: (state, action) => {
|
|
1286
|
-
const { name } = action.payload;
|
|
1287
|
-
state.byId[name] = action.payload;
|
|
1288
|
-
},
|
|
1289
|
-
receiveReleases: (state, action) => {
|
|
1290
|
-
state.byId = action.payload;
|
|
1291
|
-
},
|
|
1292
|
-
receiveReleaseTags: (state, action) => {
|
|
1293
|
-
state.tags = action.payload;
|
|
1294
|
-
},
|
|
1295
|
-
receiveReleaseTypes: (state, action) => {
|
|
1296
|
-
state.updateTypes = action.payload;
|
|
1297
|
-
},
|
|
1298
|
-
removeRelease: (state, action) => {
|
|
1299
|
-
const { [action.payload]: toBeRemoved, ...byId } = state.byId;
|
|
1300
|
-
state.byId = byId;
|
|
1301
|
-
state.selectedRelease = action.payload === state.selectedRelease ? null : state.selectedRelease;
|
|
1302
|
-
},
|
|
1303
|
-
selectedRelease: (state, action) => {
|
|
1304
|
-
state.selectedRelease = action.payload;
|
|
1305
|
-
},
|
|
1306
|
-
setReleaseListState: (state, action) => {
|
|
1307
|
-
state.releasesList = action.payload;
|
|
1308
|
-
},
|
|
1309
|
-
receivedDeltaJobs: (state, action) => {
|
|
1310
|
-
const { jobs, total } = action.payload;
|
|
1311
|
-
state.deltaJobs = jobs.reduce(
|
|
1312
|
-
(accu, job) => {
|
|
1313
|
-
accu[job.id] = {
|
|
1314
|
-
...accu[job.id],
|
|
1315
|
-
...job
|
|
1316
|
-
};
|
|
1317
|
-
return accu;
|
|
1318
|
-
},
|
|
1319
|
-
{ ...state.deltaJobs }
|
|
1320
|
-
);
|
|
1321
|
-
state.deltaJobsList.jobIds = jobs.map((job) => job.id);
|
|
1322
|
-
state.deltaJobsList.total = total;
|
|
1323
|
-
},
|
|
1324
|
-
receivedDeltaJobDetails: (state, action) => {
|
|
1325
|
-
const job = action.payload;
|
|
1326
|
-
state.deltaJobs[job.id] = {
|
|
1327
|
-
...state.deltaJobs[job.id],
|
|
1328
|
-
...job
|
|
1329
|
-
};
|
|
1330
|
-
},
|
|
1331
|
-
setDeltaJobsListState: (state, action) => {
|
|
1332
|
-
state.deltaJobsList = { ...state.deltaJobsList, ...action.payload };
|
|
1333
|
-
},
|
|
1334
|
-
setSelectedJob: (state, action) => {
|
|
1335
|
-
state.selectedJob = action.payload;
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
});
|
|
1339
|
-
var actions7 = releaseSlice.actions;
|
|
1340
|
-
var releasesSlice_default = releaseSlice.reducer;
|
|
1341
|
-
|
|
1342
|
-
// src/usersSlice/index.ts
|
|
1343
|
-
var import_toolkit8 = require("@reduxjs/toolkit");
|
|
1344
|
-
var sliceName8 = "users";
|
|
1345
|
-
var initialState8 = {
|
|
1346
|
-
byId: {},
|
|
1347
|
-
currentUser: null,
|
|
1348
|
-
currentSession: {
|
|
1349
|
-
// { token: window.localStorage.getItem('JWT'), expiresAt: '2023-01-01T00:15:00.000Z' | undefined }, // expiresAt depending on the stay logged in setting
|
|
1350
|
-
},
|
|
1351
|
-
customColumns: [],
|
|
1352
|
-
qrCode: null,
|
|
1353
|
-
globalSettings: {
|
|
1354
|
-
id_attribute: void 0,
|
|
1355
|
-
previousFilters: [],
|
|
1356
|
-
previousPhases: [],
|
|
1357
|
-
retries: 0
|
|
1358
|
-
},
|
|
1359
|
-
permissionSetsById: {
|
|
1360
|
-
...import_constants3.defaultPermissionSets
|
|
1361
|
-
},
|
|
1362
|
-
rolesById: {
|
|
1363
|
-
...import_constants3.rolesById
|
|
1364
|
-
},
|
|
1365
|
-
rolesInitialized: false,
|
|
1366
|
-
settingsInitialized: false,
|
|
1367
|
-
showConnectDeviceDialog: false,
|
|
1368
|
-
showFeedbackDialog: false,
|
|
1369
|
-
showStartupNotification: false,
|
|
1370
|
-
tooltips: {
|
|
1371
|
-
byId: {
|
|
1372
|
-
// <id>: { readState: <read|unread> } // this object is getting enhanced by the tooltip texts in the app constants
|
|
1373
|
-
}
|
|
1374
|
-
},
|
|
1375
|
-
userSettings: {
|
|
1376
|
-
columnSelection: [],
|
|
1377
|
-
onboarding: {},
|
|
1378
|
-
firstLoginTimestamp: null,
|
|
1379
|
-
securityAlertDismissedTimestamp: null
|
|
1380
|
-
},
|
|
1381
|
-
userSettingsInitialized: false
|
|
1382
|
-
};
|
|
1383
|
-
var usersSlice = (0, import_toolkit8.createSlice)({
|
|
1384
|
-
name: sliceName8,
|
|
1385
|
-
initialState: initialState8,
|
|
1386
|
-
reducers: {
|
|
1387
|
-
receivedQrCode: (state, action) => {
|
|
1388
|
-
state.qrCode = action.payload;
|
|
1389
|
-
},
|
|
1390
|
-
successfullyLoggedIn: (state, action) => {
|
|
1391
|
-
state.currentSession = action.payload;
|
|
1392
|
-
},
|
|
1393
|
-
receivedUserList: (state, action) => {
|
|
1394
|
-
state.byId = action.payload;
|
|
1395
|
-
},
|
|
1396
|
-
receivedUser: (state, action) => {
|
|
1397
|
-
state.byId[action.payload.id] = action.payload;
|
|
1398
|
-
state.currentUser = action.payload.id;
|
|
1399
|
-
},
|
|
1400
|
-
removedUser: (state, action) => {
|
|
1401
|
-
const { [action.payload]: removedUser, ...byId } = state.byId;
|
|
1402
|
-
state.byId = byId;
|
|
1403
|
-
state.currentUser = state.currentUser === action.payload ? null : state.currentUser;
|
|
1404
|
-
},
|
|
1405
|
-
updatedUser: (state, action) => {
|
|
1406
|
-
state.byId[action.payload.id] = {
|
|
1407
|
-
...state.byId[action.payload.id],
|
|
1408
|
-
...action.payload
|
|
1409
|
-
};
|
|
1410
|
-
},
|
|
1411
|
-
receivedPermissionSets: (state, action) => {
|
|
1412
|
-
state.permissionSetsById = action.payload;
|
|
1413
|
-
},
|
|
1414
|
-
receivedRoles: (state, action) => {
|
|
1415
|
-
state.rolesById = action.payload;
|
|
1416
|
-
state.rolesInitialized = true;
|
|
1417
|
-
},
|
|
1418
|
-
finishedRoleInitialization: (state, action) => {
|
|
1419
|
-
state.rolesInitialized = action.payload;
|
|
1420
|
-
},
|
|
1421
|
-
createdRole: (state, action) => {
|
|
1422
|
-
state.rolesById[action.payload.name] = {
|
|
1423
|
-
...state.rolesById[action.payload.name],
|
|
1424
|
-
...action.payload
|
|
1425
|
-
};
|
|
1426
|
-
},
|
|
1427
|
-
removedRole: (state, action) => {
|
|
1428
|
-
const { [action.payload]: toBeRemoved, ...rolesById2 } = state.rolesById;
|
|
1429
|
-
state.rolesById = rolesById2;
|
|
1430
|
-
},
|
|
1431
|
-
setCustomColumns: (state, action) => {
|
|
1432
|
-
state.customColumns = action.payload;
|
|
1433
|
-
},
|
|
1434
|
-
setGlobalSettings: (state, action) => {
|
|
1435
|
-
state.settingsInitialized = true;
|
|
1436
|
-
state.globalSettings = {
|
|
1437
|
-
...state.globalSettings,
|
|
1438
|
-
...action.payload
|
|
1439
|
-
};
|
|
1440
|
-
},
|
|
1441
|
-
setUserSettings: (state, action) => {
|
|
1442
|
-
state.userSettingsInitialized = true;
|
|
1443
|
-
state.userSettings = {
|
|
1444
|
-
...state.userSettings,
|
|
1445
|
-
...action.payload
|
|
1446
|
-
};
|
|
1447
|
-
},
|
|
1448
|
-
setTooltipState: (state, action) => {
|
|
1449
|
-
const { id, readState = READ_STATES.read } = action.payload;
|
|
1450
|
-
state.tooltips.byId[id] = { ...state.tooltips.byId[id], readState };
|
|
1451
|
-
},
|
|
1452
|
-
setTooltipsState: (state, action) => {
|
|
1453
|
-
state.tooltips.byId = {
|
|
1454
|
-
...state.tooltips.byId,
|
|
1455
|
-
...action.payload
|
|
1456
|
-
};
|
|
1457
|
-
},
|
|
1458
|
-
setShowFeedbackDialog: (state, action) => {
|
|
1459
|
-
state.showFeedbackDialog = action.payload;
|
|
1460
|
-
},
|
|
1461
|
-
setShowConnectingDialog: (state, action) => {
|
|
1462
|
-
state.showConnectDeviceDialog = action.payload;
|
|
1463
|
-
},
|
|
1464
|
-
setShowStartupNotification: (state, action) => {
|
|
1465
|
-
state.showStartupNotification = action.payload;
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
});
|
|
1469
|
-
var actions8 = usersSlice.actions;
|
|
1470
|
-
var usersSlice_default = usersSlice.reducer;
|
|
1471
|
-
|
|
1472
|
-
// src/actions.ts
|
|
1473
|
-
var actions_default = {
|
|
1474
|
-
...actions2,
|
|
1475
|
-
...actions3,
|
|
1476
|
-
...actions4,
|
|
1477
|
-
...actions,
|
|
1478
|
-
...actions5,
|
|
1479
|
-
...actions6,
|
|
1480
|
-
...actions7,
|
|
1481
|
-
...actions8
|
|
1482
|
-
};
|
|
1483
|
-
|
|
1484
|
-
// src/api/general-api.ts
|
|
1485
|
-
var import_axios = __toESM(require("axios"), 1);
|
|
1486
|
-
var import_universal_cookie2 = __toESM(require("universal-cookie"), 1);
|
|
1487
|
-
|
|
1488
|
-
// src/auth.ts
|
|
1489
|
-
var import_universal_cookie = __toESM(require("universal-cookie"), 1);
|
|
1490
|
-
var cookies = new import_universal_cookie.default();
|
|
1491
|
-
var emptySession = Object.freeze({ token: "", expiresAt: void 0 });
|
|
1492
|
-
var tokenCache = "";
|
|
1493
|
-
var getSessionInfo = () => {
|
|
1494
|
-
let sessionInfo = { ...emptySession };
|
|
1495
|
-
try {
|
|
1496
|
-
sessionInfo = JSON.parse(window.localStorage.getItem("JWT") ?? "");
|
|
1497
|
-
} catch {
|
|
1498
|
-
}
|
|
1499
|
-
const jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
|
|
1500
|
-
if (jwtTokenFromCookie) {
|
|
1501
|
-
setSessionInfo({ token: jwtTokenFromCookie });
|
|
1502
|
-
cookies.remove("JWT");
|
|
1503
|
-
cookies.remove("JWT", { path: "/" });
|
|
1504
|
-
return { token: jwtTokenFromCookie, expiresAt: void 0 };
|
|
1505
|
-
}
|
|
1506
|
-
if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < /* @__PURE__ */ new Date()) {
|
|
1507
|
-
cleanUp();
|
|
1508
|
-
return { ...emptySession };
|
|
1509
|
-
}
|
|
1510
|
-
sessionInfo.token = sessionInfo.token || "";
|
|
1511
|
-
tokenCache = sessionInfo.token;
|
|
1512
|
-
return sessionInfo;
|
|
1513
|
-
};
|
|
1514
|
-
var getToken = () => tokenCache ? tokenCache : getSessionInfo().token;
|
|
1515
|
-
var setSessionInfo = ({ token, expiresAt }) => {
|
|
1516
|
-
tokenCache = token;
|
|
1517
|
-
window.localStorage.setItem("JWT", JSON.stringify({ token, expiresAt }));
|
|
1518
|
-
};
|
|
1519
|
-
var cleanUp = () => {
|
|
1520
|
-
tokenCache = "";
|
|
1521
|
-
cookies.remove("JWT");
|
|
1522
|
-
cookies.remove("JWT", { path: "/" });
|
|
1523
|
-
window.localStorage.removeItem("JWT");
|
|
1524
|
-
window.localStorage.removeItem("oauth");
|
|
1525
|
-
};
|
|
1526
|
-
|
|
1527
|
-
// src/api/general-api.ts
|
|
1528
|
-
var cookies2 = new import_universal_cookie2.default();
|
|
1529
|
-
var unauthorizedRedirect = (error) => {
|
|
1530
|
-
if (!(0, import_axios.isCancel)(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith("/subscription")) {
|
|
1531
|
-
if (cookies2.get("JWT", { doNotParse: true })) {
|
|
1532
|
-
window.location.reload();
|
|
1533
|
-
return Promise.reject(error);
|
|
1534
|
-
}
|
|
1535
|
-
cleanUp();
|
|
1536
|
-
window.location.replace("/ui/");
|
|
1537
|
-
}
|
|
1538
|
-
return Promise.reject(error);
|
|
1539
|
-
};
|
|
1540
|
-
var commonRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { "Content-Type": "application/json" } };
|
|
1541
|
-
var authenticatedRequest = import_axios.default.create(commonRequestConfig);
|
|
1542
|
-
authenticatedRequest.interceptors.response.use((res) => res, unauthorizedRedirect);
|
|
1543
|
-
authenticatedRequest.interceptors.request.use(
|
|
1544
|
-
(config) => ({ ...config, headers: { ...config.headers, Authorization: `Bearer ${getToken()}` } }),
|
|
1545
|
-
(error) => Promise.reject(error)
|
|
1546
|
-
);
|
|
1547
|
-
var Api = {
|
|
1548
|
-
get: authenticatedRequest.get,
|
|
1549
|
-
delete: (url, data) => authenticatedRequest.request({ method: "delete", url, data }),
|
|
1550
|
-
patch: authenticatedRequest.patch,
|
|
1551
|
-
post: authenticatedRequest.post,
|
|
1552
|
-
postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, { ...commonRequestConfig, ...config }),
|
|
1553
|
-
put: authenticatedRequest.put,
|
|
1554
|
-
upload: (url, formData, progress, cancelSignal) => authenticatedRequest.post(url, formData, {
|
|
1555
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
1556
|
-
onUploadProgress: progress,
|
|
1557
|
-
timeout: 0,
|
|
1558
|
-
signal: cancelSignal
|
|
1559
|
-
}),
|
|
1560
|
-
uploadPut: (url, formData, progress, cancelSignal) => authenticatedRequest.put(url, formData, {
|
|
1561
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
1562
|
-
onUploadProgress: progress,
|
|
1563
|
-
timeout: 0,
|
|
1564
|
-
signal: cancelSignal
|
|
1565
|
-
})
|
|
1566
|
-
};
|
|
1567
|
-
var general_api_default = Api;
|
|
1568
|
-
|
|
1569
|
-
// src/devicesSlice/selectors.ts
|
|
1570
|
-
var import_helpers2 = require("@northern.tech/utils/helpers");
|
|
1571
|
-
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
1572
|
-
var getAcceptedDevices = (state) => state.devices.byStatus.accepted;
|
|
1573
|
-
var getDevicesByStatus = (state) => state.devices.byStatus;
|
|
1574
|
-
var getDevicesById = (state) => state.devices.byId;
|
|
1575
|
-
var getGroupsById = (state) => state.devices.groups.byId;
|
|
1576
|
-
var getSelectedGroup = (state) => state.devices.groups.selectedGroup;
|
|
1577
|
-
var getFilteringAttributes = (state) => state.devices.filteringAttributes;
|
|
1578
|
-
var getDeviceFilters = (state) => state.devices.filters || [];
|
|
1579
|
-
var getFilteringAttributesFromConfig = (state) => state.devices.filteringAttributesConfig.attributes;
|
|
1580
|
-
var getSortedFilteringAttributes = (0, import_toolkit9.createSelector)([getFilteringAttributes], (filteringAttributes) => ({
|
|
1581
|
-
...filteringAttributes,
|
|
1582
|
-
identityAttributes: [...filteringAttributes.identityAttributes, "id"]
|
|
1583
|
-
}));
|
|
1584
|
-
var getDeviceLimits = (state) => state.devices.limits;
|
|
1585
|
-
var getFilteringAttributesLimit = (state) => state.devices.filteringAttributesLimit;
|
|
1586
|
-
var getDeviceIdentityAttributes = (0, import_toolkit9.createSelector)(
|
|
1587
|
-
[getFilteringAttributes, getFilteringAttributesLimit],
|
|
1588
|
-
({ identityAttributes }, filteringAttributesLimit) => {
|
|
1589
|
-
const attributes = identityAttributes.slice(0, filteringAttributesLimit);
|
|
1590
|
-
return attributes.reduce(
|
|
1591
|
-
(accu, value) => {
|
|
1592
|
-
accu.push({ value, label: value, scope: "identity" });
|
|
1593
|
-
return accu;
|
|
1594
|
-
},
|
|
1595
|
-
[
|
|
1596
|
-
{ value: "name", label: "Name", scope: "tags" },
|
|
1597
|
-
{ value: "id", label: "Device ID", scope: "identity" }
|
|
1598
|
-
]
|
|
1599
|
-
);
|
|
1600
|
-
}
|
|
1601
|
-
);
|
|
1602
|
-
var getDeviceCountsByStatus = (0, import_toolkit9.createSelector)(
|
|
1603
|
-
[getDevicesByStatus],
|
|
1604
|
-
(byStatus) => Object.values(import_constants3.DEVICE_STATES).reduce(
|
|
1605
|
-
(accu, deviceState) => {
|
|
1606
|
-
const { counts } = byStatus[deviceState];
|
|
1607
|
-
const { total, ...tieredCounts } = counts;
|
|
1608
|
-
const count = Object.values(tieredCounts).reduce((accu2, countPerTier) => accu2 + countPerTier, 0);
|
|
1609
|
-
accu[deviceState] = count;
|
|
1610
|
-
accu.total = accu.total + count;
|
|
1611
|
-
return accu;
|
|
1612
|
-
},
|
|
1613
|
-
{ total: 0 }
|
|
1614
|
-
)
|
|
1615
|
-
);
|
|
1616
|
-
var getDeviceById = (0, import_toolkit9.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
|
|
1617
|
-
var getSelectedGroupInfo = (0, import_toolkit9.createSelector)(
|
|
1618
|
-
[getDeviceCountsByStatus, getGroupsById, getSelectedGroup],
|
|
1619
|
-
({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {
|
|
1620
|
-
let groupCount = acceptedDeviceTotal;
|
|
1621
|
-
let groupFilters = [];
|
|
1622
|
-
if (selectedGroup && groupsById[selectedGroup]) {
|
|
1623
|
-
groupCount = groupsById[selectedGroup].total || 0;
|
|
1624
|
-
groupFilters = groupsById[selectedGroup].filters || [];
|
|
1625
|
-
}
|
|
1626
|
-
return { groupCount, selectedGroup, groupFilters };
|
|
1627
|
-
}
|
|
1628
|
-
);
|
|
1629
|
-
var getCombinedLimit = (0, import_toolkit9.createSelector)(
|
|
1630
|
-
[getDeviceLimits],
|
|
1631
|
-
(deviceLimits) => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0)
|
|
1632
|
-
// limit might be -1 for unlimited devices
|
|
1633
|
-
);
|
|
1634
|
-
var getLimitMaxed = (0, import_toolkit9.createSelector)(
|
|
1635
|
-
[getDeviceCountsByStatus, getCombinedLimit],
|
|
1636
|
-
({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices
|
|
1637
|
-
);
|
|
1638
|
-
var getGroupsByIdWithoutUngrouped = (0, import_toolkit9.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
|
|
1639
|
-
var getGroupData = (0, import_toolkit9.createSelector)([getGroupsByIdWithoutUngrouped], (groups) => {
|
|
1640
|
-
const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : void 0;
|
|
1641
|
-
const hasDynamicGroups = Object.values(groups).some((group) => !!group.id);
|
|
1642
|
-
return { createdGroup, hasDynamicGroups, groups };
|
|
1643
|
-
});
|
|
1644
|
-
var getGroups = (0, import_toolkit9.createSelector)([getGroupsById], (groupsById) => {
|
|
1645
|
-
const groupNames = Object.keys(groupsById).sort();
|
|
1646
|
-
const groupedGroups = Object.entries(groupsById).sort((a, b) => a[0].localeCompare(b[0])).reduce(
|
|
1647
|
-
(accu, [groupname, group]) => {
|
|
1648
|
-
const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;
|
|
1649
|
-
const groupItem = { ...group, groupId: name, name: groupname };
|
|
1650
|
-
if ((group.filters ?? []).length > 0) {
|
|
1651
|
-
if (groupname !== UNGROUPED_GROUP.id) {
|
|
1652
|
-
accu.dynamic.push(groupItem);
|
|
1653
|
-
} else {
|
|
1654
|
-
accu.ungrouped.push(groupItem);
|
|
1655
|
-
}
|
|
1656
|
-
} else {
|
|
1657
|
-
accu.static.push(groupItem);
|
|
1658
|
-
}
|
|
1659
|
-
return accu;
|
|
1660
|
-
},
|
|
1661
|
-
{ dynamic: [], static: [], ungrouped: [] }
|
|
1662
|
-
);
|
|
1663
|
-
return { groupNames, ...groupedGroups };
|
|
1664
|
-
});
|
|
1665
|
-
var getAttributesList = (0, import_toolkit9.createSelector)(
|
|
1666
|
-
[getFilteringAttributes, getFilteringAttributesFromConfig],
|
|
1667
|
-
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers2.duplicateFilter)
|
|
1668
|
-
);
|
|
1669
|
-
var getEnabledTierLimits = (0, import_toolkit9.createSelector)([getDeviceLimits], (limits) => Object.entries(limits).filter(([, limit]) => limit !== 0));
|
|
1670
|
-
var getEnabledTiers = (0, import_toolkit9.createSelector)([getEnabledTierLimits], (enabledTierLimits) => enabledTierLimits.map(([type]) => type));
|
|
1671
|
-
var getDeviceLimitStats = (0, import_toolkit9.createSelector)([getEnabledTierLimits, getAcceptedDevices], (enabledTierLimits, accepted) => {
|
|
1672
|
-
const { counts } = accepted;
|
|
1673
|
-
return enabledTierLimits.map(([type, limit]) => ({
|
|
1674
|
-
type,
|
|
1675
|
-
limit,
|
|
1676
|
-
total: counts[type] || 0
|
|
1677
|
-
}));
|
|
1678
|
-
});
|
|
1679
|
-
var getDeviceTypes = (0, import_toolkit9.createSelector)(
|
|
1680
|
-
[getAcceptedDevices, getDevicesById],
|
|
1681
|
-
({ deviceIds = [] }, devicesById) => Object.keys(
|
|
1682
|
-
deviceIds.slice(0, 200).reduce((accu, item) => {
|
|
1683
|
-
const { device_type: deviceTypes = [] } = devicesById[item] ? devicesById[item].attributes : {};
|
|
1684
|
-
accu = deviceTypes.reduce((deviceTypeAccu, deviceType) => {
|
|
1685
|
-
if (deviceType.length > 1) {
|
|
1686
|
-
deviceTypeAccu[deviceType] = deviceTypeAccu[deviceType] ? deviceTypeAccu[deviceType] + 1 : 1;
|
|
1687
|
-
}
|
|
1688
|
-
return deviceTypeAccu;
|
|
1689
|
-
}, accu);
|
|
1690
|
-
return accu;
|
|
1691
|
-
}, {})
|
|
1692
|
-
)
|
|
1693
|
-
);
|
|
1694
|
-
|
|
1695
|
-
// src/utils.ts
|
|
1696
|
-
var import_helpers3 = require("@northern.tech/utils/helpers");
|
|
1697
|
-
var filterProcessors = {
|
|
1698
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$gt.key]: (val) => Number(val) || val,
|
|
1699
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$gte.key]: (val) => Number(val) || val,
|
|
1700
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$lt.key]: (val) => Number(val) || val,
|
|
1701
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$lte.key]: (val) => Number(val) || val,
|
|
1702
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$ltne.key]: (val) => Number(val) || val,
|
|
1703
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$in.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
1704
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$nin.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
1705
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$exists.key]: import_helpers3.yes,
|
|
1706
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$nexists.key]: () => false
|
|
1707
|
-
};
|
|
1708
|
-
var filterAliases = {
|
|
1709
|
-
$nexists: { alias: import_constants3.DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
|
|
1710
|
-
};
|
|
1711
|
-
var mapFiltersToTerms = (filters) => filters.map((filter) => ({
|
|
1712
|
-
scope: filter.scope,
|
|
1713
|
-
attribute: filter.key,
|
|
1714
|
-
type: filterAliases[filter.operator]?.alias || filter.operator,
|
|
1715
|
-
value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../chunk-CKQMccvm.cjs");
|
|
3
|
+
const require_constants = require("../constants.cjs");
|
|
4
|
+
const require_monitorSlice_index = require("./index.cjs");
|
|
5
|
+
const require_actions = require("../actions.cjs");
|
|
6
|
+
const require_devicesSlice_selectors = require("../devicesSlice/selectors.cjs");
|
|
7
|
+
const require_utils = require("../utils.cjs");
|
|
8
|
+
const require_store = require("../store.cjs");
|
|
9
|
+
const require_api_general_api = require("../api/general-api.cjs");
|
|
10
|
+
let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
|
|
11
|
+
//#region src/monitorSlice/thunks.ts
|
|
12
|
+
const { page: defaultPage, perPage: defaultPerPage } = _northern_tech_utils_constants.DEVICE_LIST_DEFAULTS;
|
|
13
|
+
const cutoffLength = 75;
|
|
14
|
+
const ellipsis = "...";
|
|
15
|
+
const longTextTrimmer = (text) => text.length >= cutoffLength + 3 ? `${text.substring(0, cutoffLength + 3)}${ellipsis}` : text;
|
|
16
|
+
const sanitizeDeviceAlerts = (alerts) => alerts.map((alert) => ({
|
|
17
|
+
...alert,
|
|
18
|
+
fullName: alert.name,
|
|
19
|
+
name: longTextTrimmer(alert.name || "")
|
|
1716
20
|
}));
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
};
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
const { error } = action;
|
|
1782
|
-
console.error("Rejection in action:", action);
|
|
1783
|
-
console.error(error.stack);
|
|
1784
|
-
}
|
|
1785
|
-
return next(action);
|
|
1786
|
-
};
|
|
1787
|
-
var tracingActionIgnoreList = [actions8.successfullyLoggedIn.type, "users/loginUser/pending", "users/loginUser/fulfilled", "users/loginUser/rejected"];
|
|
1788
|
-
var sentryReduxEnhancer = (0, import_react.createReduxEnhancer)({
|
|
1789
|
-
actionTransformer: (action) => {
|
|
1790
|
-
if (tracingActionIgnoreList.includes(action.type)) {
|
|
1791
|
-
return null;
|
|
1792
|
-
}
|
|
1793
|
-
return action;
|
|
1794
|
-
},
|
|
1795
|
-
// Transform the state to remove sensitive information
|
|
1796
|
-
stateTransformer: (state) => {
|
|
1797
|
-
const transformedState = {
|
|
1798
|
-
...state,
|
|
1799
|
-
users: { ...state.users, currentSession: null },
|
|
1800
|
-
organization: {
|
|
1801
|
-
...state.organization,
|
|
1802
|
-
organization: {
|
|
1803
|
-
...state.organization.organization,
|
|
1804
|
-
tenant_token: null
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
};
|
|
1808
|
-
return transformedState;
|
|
1809
|
-
}
|
|
1810
|
-
});
|
|
1811
|
-
var getConfiguredStore = (options = {}) => {
|
|
1812
|
-
const { preloadedState = {}, ...config } = options;
|
|
1813
|
-
return (0, import_toolkit10.configureStore)({
|
|
1814
|
-
...config,
|
|
1815
|
-
preloadedState,
|
|
1816
|
-
enhancers: (getDefaultEnhancers) => {
|
|
1817
|
-
if (window.mender_environment?.sentry?.isReduxEnabled) {
|
|
1818
|
-
return getDefaultEnhancers().concat(sentryReduxEnhancer);
|
|
1819
|
-
}
|
|
1820
|
-
return getDefaultEnhancers();
|
|
1821
|
-
},
|
|
1822
|
-
reducer: sessionReducer,
|
|
1823
|
-
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
1824
|
-
immutableCheck: {
|
|
1825
|
-
ignoredPaths: ["app.uploadsById"]
|
|
1826
|
-
},
|
|
1827
|
-
serializableCheck: {
|
|
1828
|
-
ignoredActions: [actions6.receiveExternalDeviceIntegrations.name, uploadProgress.name],
|
|
1829
|
-
ignoredActionPaths: ["uploads", /payload\..*$/, "meta.arg.file", "meta.arg.integration.configHint"],
|
|
1830
|
-
ignoredPaths: ["app.uploadsById", "organization.externalDeviceIntegrations"]
|
|
1831
|
-
}
|
|
1832
|
-
}).concat(rejectionLoggerMiddleware)
|
|
1833
|
-
});
|
|
1834
|
-
};
|
|
1835
|
-
var store = getConfiguredStore({
|
|
1836
|
-
preloadedState: {}
|
|
1837
|
-
});
|
|
1838
|
-
var createAppAsyncThunk = import_toolkit10.createAsyncThunk.withTypes();
|
|
21
|
+
const getDeviceAlerts = require_store.createAppAsyncThunk(`${require_monitorSlice_index.sliceName}/getDeviceAlerts`, ({ id, config = {} }, { dispatch }) => {
|
|
22
|
+
const { page = defaultPage, perPage = defaultPerPage, issuedBefore, issuedAfter, sortAscending = false } = config;
|
|
23
|
+
const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : "";
|
|
24
|
+
const issued_before = issuedBefore ? `&issued_before=${issuedBefore}` : "";
|
|
25
|
+
return require_api_general_api.default.get(`${_northern_tech_utils_constants.monitorApiUrlv1}/devices/${id}/alerts?page=${page}&per_page=${perPage}${issued_after}${issued_before}&sort_ascending=${sortAscending}`).catch((err) => require_store.commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch)).then((res) => Promise.all([dispatch(require_monitorSlice_index.actions.receiveDeviceAlerts({
|
|
26
|
+
deviceId: id,
|
|
27
|
+
alerts: sanitizeDeviceAlerts(res.data)
|
|
28
|
+
})), dispatch(require_monitorSlice_index.actions.setAlertListState({ total: Number(res.headers[_northern_tech_utils_constants.headerNames.total]) }))]));
|
|
29
|
+
});
|
|
30
|
+
const getLatestDeviceAlerts = require_store.createAppAsyncThunk(`${require_monitorSlice_index.sliceName}/getLatestDeviceAlerts`, ({ id, config = {} }, { dispatch }) => {
|
|
31
|
+
const { page = defaultPage, perPage = 10 } = config;
|
|
32
|
+
return require_api_general_api.default.get(`${_northern_tech_utils_constants.monitorApiUrlv1}/devices/${id}/alerts/latest?page=${page}&per_page=${perPage}`).catch((err) => require_store.commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch)).then((res) => Promise.resolve(dispatch(require_monitorSlice_index.actions.receiveLatestDeviceAlerts({
|
|
33
|
+
deviceId: id,
|
|
34
|
+
alerts: sanitizeDeviceAlerts(res.data)
|
|
35
|
+
}))));
|
|
36
|
+
});
|
|
37
|
+
const getIssueCountsByType = require_store.createAppAsyncThunk(`${require_monitorSlice_index.sliceName}/getIssueCountsByType`, async ({ type, options = {} }, { dispatch, getState }) => {
|
|
38
|
+
const state = getState();
|
|
39
|
+
const { filters = require_devicesSlice_selectors.getDeviceFilters(state), group, status, ...remainder } = options;
|
|
40
|
+
const { applicableFilters: nonMonitorFilters, filterTerms } = require_utils.convertDeviceListStateToFilters({
|
|
41
|
+
...remainder,
|
|
42
|
+
filters,
|
|
43
|
+
group,
|
|
44
|
+
offlineThreshold: state.app.offlineThreshold,
|
|
45
|
+
selectedIssues: [type],
|
|
46
|
+
status
|
|
47
|
+
});
|
|
48
|
+
const res = await require_api_general_api.default.post(`${_northern_tech_utils_constants.inventoryApiUrlV2}/filters/search`, {
|
|
49
|
+
page: 1,
|
|
50
|
+
per_page: 1,
|
|
51
|
+
filters: filterTerms,
|
|
52
|
+
attributes: [{
|
|
53
|
+
scope: "identity",
|
|
54
|
+
attribute: "status"
|
|
55
|
+
}]
|
|
56
|
+
}).catch((err) => require_store.commonErrorHandler(err, `Retrieving issue counts failed:`, dispatch, require_store.commonErrorFallback));
|
|
57
|
+
const total = nonMonitorFilters.length ? state.monitor.issueCounts.byType[type].total : Number(res.headers[_northern_tech_utils_constants.headerNames.total]);
|
|
58
|
+
const filtered = nonMonitorFilters.length ? Number(res.headers[_northern_tech_utils_constants.headerNames.total]) : total;
|
|
59
|
+
if (total === state.monitor.issueCounts.byType[type].total && filtered === state.monitor.issueCounts.byType[type].filtered) return;
|
|
60
|
+
return dispatch(require_monitorSlice_index.actions.receiveDeviceIssueCounts({
|
|
61
|
+
counts: {
|
|
62
|
+
filtered,
|
|
63
|
+
total
|
|
64
|
+
},
|
|
65
|
+
issueType: type
|
|
66
|
+
}));
|
|
67
|
+
});
|
|
68
|
+
const getDeviceMonitorConfig = require_store.createAppAsyncThunk(`${require_monitorSlice_index.sliceName}/getDeviceMonitorConfig`, (id, { dispatch }) => require_api_general_api.default.get(`${_northern_tech_utils_constants.monitorApiUrlv1}/devices/${id}/config`).catch((err) => require_store.commonErrorHandler(err, `Retrieving device monitor config for device ${id} failed:`, dispatch)).then(({ data }) => Promise.all([dispatch(require_actions.receivedDevice({
|
|
69
|
+
id,
|
|
70
|
+
monitors: data
|
|
71
|
+
}), Promise.resolve(data))])));
|
|
72
|
+
const changeNotificationSetting = require_store.createAppAsyncThunk(`${require_monitorSlice_index.sliceName}/changeNotificationSetting`, ({ enabled, channel = _northern_tech_utils_constants.alertChannels.email }, { dispatch }) => require_api_general_api.default.put(`${_northern_tech_utils_constants.monitorApiUrlv1}/settings/global/channel/alerts/${channel}/status`, { enabled }).catch((err) => require_store.commonErrorHandler(err, `${enabled ? "En" : "Dis"}abling ${channel} alerts failed:`, dispatch)).then(() => Promise.all([dispatch(require_monitorSlice_index.actions.changeAlertChannel({
|
|
73
|
+
channel,
|
|
74
|
+
enabled
|
|
75
|
+
})), dispatch(require_actions.setSnackbar({
|
|
76
|
+
message: `Successfully ${enabled ? "en" : "dis"}abled ${channel} alerts`,
|
|
77
|
+
autoHideDuration: require_constants.TIMEOUTS.fiveSeconds
|
|
78
|
+
}))])));
|
|
79
|
+
//#endregion
|
|
80
|
+
exports.changeNotificationSetting = changeNotificationSetting;
|
|
81
|
+
exports.getDeviceAlerts = getDeviceAlerts;
|
|
82
|
+
exports.getDeviceMonitorConfig = getDeviceMonitorConfig;
|
|
83
|
+
exports.getIssueCountsByType = getIssueCountsByType;
|
|
84
|
+
exports.getLatestDeviceAlerts = getLatestDeviceAlerts;
|
|
1839
85
|
|
|
1840
|
-
// src/monitorSlice/thunks.ts
|
|
1841
|
-
var { page: defaultPage, perPage: defaultPerPage } = import_constants3.DEVICE_LIST_DEFAULTS;
|
|
1842
|
-
var cutoffLength = 75;
|
|
1843
|
-
var ellipsis = "...";
|
|
1844
|
-
var longTextTrimmer = (text) => text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text;
|
|
1845
|
-
var sanitizeDeviceAlerts = (alerts) => alerts.map((alert) => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name || "") }));
|
|
1846
|
-
var getDeviceAlerts = createAppAsyncThunk(`${sliceName}/getDeviceAlerts`, ({ id, config = {} }, { dispatch }) => {
|
|
1847
|
-
const { page = defaultPage, perPage = defaultPerPage, issuedBefore, issuedAfter, sortAscending = false } = config;
|
|
1848
|
-
const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : "";
|
|
1849
|
-
const issued_before = issuedBefore ? `&issued_before=${issuedBefore}` : "";
|
|
1850
|
-
return general_api_default.get(
|
|
1851
|
-
`${import_constants3.monitorApiUrlv1}/devices/${id}/alerts?page=${page}&per_page=${perPage}${issued_after}${issued_before}&sort_ascending=${sortAscending}`
|
|
1852
|
-
).catch((err) => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch)).then(
|
|
1853
|
-
(res) => Promise.all([
|
|
1854
|
-
dispatch(actions.receiveDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) })),
|
|
1855
|
-
dispatch(actions.setAlertListState({ total: Number(res.headers[import_constants3.headerNames.total]) }))
|
|
1856
|
-
])
|
|
1857
|
-
);
|
|
1858
|
-
});
|
|
1859
|
-
var getLatestDeviceAlerts = createAppAsyncThunk(
|
|
1860
|
-
`${sliceName}/getLatestDeviceAlerts`,
|
|
1861
|
-
({ id, config = {} }, { dispatch }) => {
|
|
1862
|
-
const { page = defaultPage, perPage = 10 } = config;
|
|
1863
|
-
return general_api_default.get(`${import_constants3.monitorApiUrlv1}/devices/${id}/alerts/latest?page=${page}&per_page=${perPage}`).catch((err) => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch)).then((res) => Promise.resolve(dispatch(actions.receiveLatestDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) }))));
|
|
1864
|
-
}
|
|
1865
|
-
);
|
|
1866
|
-
var getIssueCountsByType = createAppAsyncThunk(
|
|
1867
|
-
`${sliceName}/getIssueCountsByType`,
|
|
1868
|
-
({ type, options = {} }, { dispatch, getState }) => {
|
|
1869
|
-
const state = getState();
|
|
1870
|
-
const { filters = getDeviceFilters(state), group, status, ...remainder } = options;
|
|
1871
|
-
const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({
|
|
1872
|
-
...remainder,
|
|
1873
|
-
filters,
|
|
1874
|
-
group,
|
|
1875
|
-
offlineThreshold: state.app.offlineThreshold,
|
|
1876
|
-
selectedIssues: [type],
|
|
1877
|
-
status
|
|
1878
|
-
});
|
|
1879
|
-
return general_api_default.post(`${import_constants3.inventoryApiUrlV2}/filters/search`, {
|
|
1880
|
-
page: 1,
|
|
1881
|
-
per_page: 1,
|
|
1882
|
-
filters: filterTerms,
|
|
1883
|
-
attributes: [{ scope: "identity", attribute: "status" }]
|
|
1884
|
-
}).catch((err) => commonErrorHandler(err, `Retrieving issue counts failed:`, dispatch, commonErrorFallback)).then((res) => {
|
|
1885
|
-
const total = nonMonitorFilters.length ? state.monitor.issueCounts.byType[type].total : Number(res.headers[import_constants3.headerNames.total]);
|
|
1886
|
-
const filtered = nonMonitorFilters.length ? Number(res.headers[import_constants3.headerNames.total]) : total;
|
|
1887
|
-
if (total === state.monitor.issueCounts.byType[type].total && filtered === state.monitor.issueCounts.byType[type].filtered) {
|
|
1888
|
-
return Promise.resolve();
|
|
1889
|
-
}
|
|
1890
|
-
return Promise.resolve(dispatch(actions.receiveDeviceIssueCounts({ counts: { filtered, total }, issueType: type })));
|
|
1891
|
-
});
|
|
1892
|
-
}
|
|
1893
|
-
);
|
|
1894
|
-
var getDeviceMonitorConfig = createAppAsyncThunk(
|
|
1895
|
-
`${sliceName}/getDeviceMonitorConfig`,
|
|
1896
|
-
(id, { dispatch }) => general_api_default.get(`${import_constants3.monitorApiUrlv1}/devices/${id}/config`).catch((err) => commonErrorHandler(err, `Retrieving device monitor config for device ${id} failed:`, dispatch)).then(({ data }) => Promise.all([dispatch(actions_default.receivedDevice({ id, monitors: data }), Promise.resolve(data))]))
|
|
1897
|
-
);
|
|
1898
|
-
var changeNotificationSetting = createAppAsyncThunk(
|
|
1899
|
-
`${sliceName}/changeNotificationSetting`,
|
|
1900
|
-
({ enabled, channel = import_constants3.alertChannels.email }, { dispatch }) => general_api_default.put(`${import_constants3.monitorApiUrlv1}/settings/global/channel/alerts/${channel}/status`, { enabled }).catch((err) => commonErrorHandler(err, `${enabled ? "En" : "Dis"}abling ${channel} alerts failed:`, dispatch)).then(
|
|
1901
|
-
() => Promise.all([
|
|
1902
|
-
dispatch(actions.changeAlertChannel({ channel, enabled })),
|
|
1903
|
-
dispatch(
|
|
1904
|
-
actions_default.setSnackbar({ message: `Successfully ${enabled ? "en" : "dis"}abled ${channel} alerts`, autoHideDuration: TIMEOUTS.fiveSeconds })
|
|
1905
|
-
)
|
|
1906
|
-
])
|
|
1907
|
-
)
|
|
1908
|
-
);
|
|
1909
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
1910
|
-
0 && (module.exports = {
|
|
1911
|
-
changeNotificationSetting,
|
|
1912
|
-
getDeviceAlerts,
|
|
1913
|
-
getDeviceMonitorConfig,
|
|
1914
|
-
getIssueCountsByType,
|
|
1915
|
-
getLatestDeviceAlerts
|
|
1916
|
-
});
|
|
1917
86
|
//# sourceMappingURL=thunks.cjs.map
|