@northern.tech/store 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.cjs +6 -1
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +1 -0
- package/dist/actions.d.ts +1 -0
- package/dist/actions.js +6 -6
- package/dist/api/general-api.js +2 -2
- package/dist/api/users-api.js +2 -2
- package/dist/appSlice/constants.cjs +3 -3
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.d.cts +4 -1
- package/dist/appSlice/constants.d.ts +4 -1
- package/dist/appSlice/constants.js +1 -1
- package/dist/appSlice/index.cjs +6 -1
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.d.cts +3 -0
- package/dist/appSlice/index.d.ts +3 -0
- package/dist/appSlice/index.js +3 -3
- package/dist/appSlice/mocks.cjs +6 -1
- package/dist/appSlice/mocks.cjs.map +1 -1
- package/dist/appSlice/mocks.d.cts +1 -0
- package/dist/appSlice/mocks.d.ts +1 -0
- package/dist/appSlice/mocks.js +3 -3
- package/dist/appSlice/selectors.cjs +3 -0
- package/dist/appSlice/selectors.cjs.map +1 -1
- package/dist/appSlice/selectors.d.cts +2 -1
- package/dist/appSlice/selectors.d.ts +2 -1
- package/dist/appSlice/selectors.js +3 -1
- package/dist/appSlice/thunks.cjs +20 -4
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.js +18 -18
- package/dist/auth.js +2 -2
- package/dist/{chunk-7QKCBSFU.js → chunk-3YJY7KQW.js} +2 -2
- package/dist/{chunk-BYUPW7RA.js → chunk-4BHM6WVX.js} +3 -1
- package/dist/{chunk-BYUPW7RA.js.map → chunk-4BHM6WVX.js.map} +1 -1
- package/dist/{chunk-IUGHRJV2.js → chunk-6WJI4MOP.js} +7 -2
- package/dist/chunk-6WJI4MOP.js.map +1 -0
- package/dist/{chunk-OWWCFJZ5.js → chunk-EL672W25.js} +4 -4
- package/dist/chunk-EL672W25.js.map +1 -0
- package/dist/{chunk-5XUPXMYV.js → chunk-GAADWFQZ.js} +6 -6
- package/dist/{chunk-GGBE6KJV.js → chunk-GEQ2QQEE.js} +2 -2
- package/dist/{chunk-PIFXECFW.js → chunk-M7YH35Y4.js} +7 -7
- package/dist/{chunk-KVZEKHVC.js → chunk-MWJFQYA2.js} +9 -9
- package/dist/{chunk-LX4YRTYY.js → chunk-NJMHH7TJ.js} +14 -14
- package/dist/{chunk-X7NEALMI.js → chunk-O7DR57RN.js} +13 -1
- package/dist/{chunk-X7NEALMI.js.map → chunk-O7DR57RN.js.map} +1 -1
- package/dist/{chunk-GX2TWNLC.js → chunk-U5TPV5X5.js} +8 -8
- package/dist/{chunk-GX2TWNLC.js.map → chunk-U5TPV5X5.js.map} +1 -1
- package/dist/{chunk-5PUF4LA5.js → chunk-VCEFZTWS.js} +1 -1
- package/dist/{chunk-5PUF4LA5.js.map → chunk-VCEFZTWS.js.map} +1 -1
- package/dist/{chunk-ZWLCUOQN.js → chunk-WCJHYB46.js} +6 -6
- package/dist/{chunk-2SAH2AN2.js → chunk-YWL3XLJH.js} +12 -12
- package/dist/chunk-YWL3XLJH.js.map +1 -0
- package/dist/commonConstants.js +2 -2
- package/dist/commonSelectors.cjs +14 -3
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.js +10 -10
- package/dist/constants.cjs +3 -3
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js +2 -2
- package/dist/deploymentsSlice/constants.js +2 -2
- package/dist/deploymentsSlice/index.js +2 -2
- package/dist/deploymentsSlice/mocks.js +2 -2
- package/dist/deploymentsSlice/selectors.js +2 -2
- package/dist/deploymentsSlice/thunks.cjs +20 -4
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.js +18 -18
- package/dist/devicesSlice/constants.js +2 -2
- package/dist/devicesSlice/index.js +2 -2
- package/dist/devicesSlice/mocks.js +2 -2
- package/dist/devicesSlice/selectors.cjs +13 -0
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +62 -1
- package/dist/devicesSlice/selectors.d.ts +62 -1
- package/dist/devicesSlice/selectors.js +5 -3
- package/dist/devicesSlice/thunks.cjs +20 -4
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.js +18 -18
- package/dist/liststatehook.js +2 -2
- package/dist/locationutils.js +2 -2
- package/dist/monitorSlice/index.js +2 -2
- package/dist/monitorSlice/mocks.js +2 -2
- package/dist/monitorSlice/thunks.cjs +20 -4
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.js +16 -16
- package/dist/onboardingSlice/thunks.cjs +20 -4
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.js +18 -18
- package/dist/organizationSlice/constants.js +2 -2
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.js +3 -3
- package/dist/organizationSlice/mocks.cjs.map +1 -1
- package/dist/organizationSlice/mocks.js +3 -3
- package/dist/organizationSlice/selectors.js +2 -2
- package/dist/organizationSlice/thunks.cjs +26 -10
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.js +18 -18
- package/dist/organizationSlice/types.cjs.map +1 -1
- package/dist/releasesSlice/index.js +2 -2
- package/dist/releasesSlice/mocks.js +2 -2
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.js +4 -4
- package/dist/releasesSlice/thunks.cjs +20 -4
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.js +16 -16
- package/dist/selectors.cjs +19 -3
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +2 -2
- package/dist/selectors.d.ts +2 -2
- package/dist/selectors.js +31 -27
- package/dist/sockethook.js +2 -2
- package/dist/store.cjs +6 -1
- package/dist/store.cjs.map +1 -1
- package/dist/store.js +7 -7
- package/dist/storehooks.cjs +30 -11
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +23 -19
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +26 -10
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +18 -18
- package/dist/useDeploymentDevice.cjs +20 -4
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +18 -18
- package/dist/useDeploymentDevice.js.map +1 -1
- package/dist/usersSlice/constants.js +2 -2
- package/dist/usersSlice/index.js +2 -2
- package/dist/usersSlice/mocks.js +2 -2
- package/dist/usersSlice/selectors.cjs +3 -3
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.js +4 -4
- package/dist/usersSlice/thunks.cjs +20 -4
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.js +18 -18
- package/dist/utils.cjs +9 -9
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +3 -3
- package/package.json +2 -1
- package/dist/chunk-2SAH2AN2.js.map +0 -1
- package/dist/chunk-IUGHRJV2.js.map +0 -1
- package/dist/chunk-OWWCFJZ5.js.map +0 -1
- /package/dist/{chunk-7QKCBSFU.js.map → chunk-3YJY7KQW.js.map} +0 -0
- /package/dist/{chunk-5XUPXMYV.js.map → chunk-GAADWFQZ.js.map} +0 -0
- /package/dist/{chunk-GGBE6KJV.js.map → chunk-GEQ2QQEE.js.map} +0 -0
- /package/dist/{chunk-PIFXECFW.js.map → chunk-M7YH35Y4.js.map} +0 -0
- /package/dist/{chunk-KVZEKHVC.js.map → chunk-MWJFQYA2.js.map} +0 -0
- /package/dist/{chunk-LX4YRTYY.js.map → chunk-NJMHH7TJ.js.map} +0 -0
- /package/dist/{chunk-ZWLCUOQN.js.map → chunk-WCJHYB46.js.map} +0 -0
package/dist/appSlice/thunks.js
CHANGED
|
@@ -3,39 +3,39 @@ import {
|
|
|
3
3
|
setFirstLoginAfterSignup,
|
|
4
4
|
setOfflineThreshold,
|
|
5
5
|
setSearchState
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-YWL3XLJH.js";
|
|
7
|
+
import "../chunk-GAADWFQZ.js";
|
|
8
|
+
import "../chunk-WCJHYB46.js";
|
|
9
|
+
import "../chunk-MWJFQYA2.js";
|
|
10
10
|
import "../chunk-Y3DJIMEN.js";
|
|
11
11
|
import "../chunk-5M6EUVNO.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-KJ4BPXMB.js";
|
|
12
|
+
import "../chunk-M7YH35Y4.js";
|
|
14
13
|
import "../chunk-TRKA7XYU.js";
|
|
15
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-KJ4BPXMB.js";
|
|
16
15
|
import "../chunk-PVCHKW35.js";
|
|
16
|
+
import "../chunk-VCEFZTWS.js";
|
|
17
17
|
import "../chunk-CQXDAXQF.js";
|
|
18
18
|
import "../chunk-VODRLEDP.js";
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-6WJI4MOP.js";
|
|
20
20
|
import "../chunk-OLKM53RL.js";
|
|
21
21
|
import "../chunk-FDSMCFV5.js";
|
|
22
22
|
import "../chunk-53W2NRSL.js";
|
|
23
23
|
import "../chunk-NMAXZ3ZY.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-3NOV7X4M.js";
|
|
28
|
-
import "../chunk-YO22XLHI.js";
|
|
24
|
+
import "../chunk-NJMHH7TJ.js";
|
|
25
|
+
import "../chunk-GEQ2QQEE.js";
|
|
26
|
+
import "../chunk-3YJY7KQW.js";
|
|
29
27
|
import "../chunk-JIS4PA3R.js";
|
|
28
|
+
import "../chunk-YO22XLHI.js";
|
|
29
|
+
import "../chunk-3NOV7X4M.js";
|
|
30
30
|
import "../chunk-WR6RQKF5.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-O7DR57RN.js";
|
|
32
|
+
import "../chunk-4BHM6WVX.js";
|
|
33
|
+
import "../chunk-U5TPV5X5.js";
|
|
34
34
|
import "../chunk-WWED74SG.js";
|
|
35
|
+
import "../chunk-ZKAH3APE.js";
|
|
35
36
|
import "../chunk-2DYA3X77.js";
|
|
36
37
|
import "../chunk-FAJ3I2UQ.js";
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-OWWCFJZ5.js";
|
|
38
|
+
import "../chunk-EL672W25.js";
|
|
39
39
|
export {
|
|
40
40
|
getLatestReleaseInfo,
|
|
41
41
|
setFirstLoginAfterSignup,
|
package/dist/auth.js
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
updateMaxAge
|
|
7
7
|
} from "./chunk-FDSMCFV5.js";
|
|
8
8
|
import "./chunk-WWED74SG.js";
|
|
9
|
+
import "./chunk-ZKAH3APE.js";
|
|
9
10
|
import "./chunk-2DYA3X77.js";
|
|
10
11
|
import "./chunk-FAJ3I2UQ.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-OWWCFJZ5.js";
|
|
12
|
+
import "./chunk-EL672W25.js";
|
|
13
13
|
export {
|
|
14
14
|
cleanUp,
|
|
15
15
|
getSessionInfo,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isDarkMode
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U5TPV5X5.js";
|
|
4
4
|
import {
|
|
5
5
|
DEVICE_ONLINE_CUTOFF,
|
|
6
6
|
READ_STATES,
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
getCurrentSession,
|
|
78
78
|
getRolesInitialized
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-3YJY7KQW.js.map
|
|
@@ -16,6 +16,7 @@ var getSentryConfig = (state) => state.app.sentry;
|
|
|
16
16
|
var getCommit = (state) => state.app.commit;
|
|
17
17
|
var getIsFirstLogin = (state) => state.app.firstLoginAfterSignup;
|
|
18
18
|
var getFeedbackProbability = (state) => state.app.feedbackProbability;
|
|
19
|
+
var getAppInitDone = (state) => state.app.appInitDone;
|
|
19
20
|
var getIsUploading = createSelector([getUploads], (uploadsById) => !!Object.keys(uploadsById).length);
|
|
20
21
|
var getSearchedDevices = createSelector([getSearchState], ({ deviceIds }) => deviceIds);
|
|
21
22
|
var getVersionInformation = createSelector(
|
|
@@ -40,9 +41,10 @@ export {
|
|
|
40
41
|
getCommit,
|
|
41
42
|
getIsFirstLogin,
|
|
42
43
|
getFeedbackProbability,
|
|
44
|
+
getAppInitDone,
|
|
43
45
|
getIsUploading,
|
|
44
46
|
getSearchedDevices,
|
|
45
47
|
getVersionInformation,
|
|
46
48
|
getIsPreview
|
|
47
49
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-4BHM6WVX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/appSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { versionCompare } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { RootState } from '../store';\n\nexport const getDocsVersion = (state: RootState) => state.app.docsVersion;\nexport const getFeatures = (state: RootState) => state.app.features;\nexport const getFullVersionInformation = (state: RootState) => state.app.versionInformation;\nexport const getSearchState = (state: RootState) => state.app.searchState;\nexport const getUploads = (state: RootState) => state.app.uploadsById;\nexport const getSnackbar = (state: RootState) => state.app.snackbar;\nexport const getHostAddress = (state: RootState) => state.app.hostAddress;\nexport const getHostedAnnouncement = (state: RootState) => state.app.hostedAnnouncement;\nexport const getRecaptchaKey = (state: RootState) => state.app.recaptchaSiteKey;\nexport const getStripeKey = (state: RootState) => state.app.stripeAPIKey;\nexport const getTrackerCode = (state: RootState) => state.app.trackerCode;\nexport const getSentryConfig = (state: RootState) => state.app.sentry;\nexport const getCommit = (state: RootState) => state.app.commit;\nexport const getIsFirstLogin = (state: RootState) => state.app.firstLoginAfterSignup;\nexport const getFeedbackProbability = (state: RootState) => state.app.feedbackProbability;\n\nexport const getIsUploading = createSelector([getUploads], uploadsById => !!Object.keys(uploadsById).length);\nexport const getSearchedDevices = createSelector([getSearchState], ({ deviceIds }) => deviceIds);\nexport const getVersionInformation = createSelector([getFullVersionInformation, getFeatures], ({ Integration, ...remainder }, { isHosted }) =>\n isHosted && Integration !== 'next' ? remainder : { ...remainder, Integration }\n);\nexport const getIsPreview = createSelector([getFullVersionInformation], ({ Integration }) => versionCompare(Integration, 'next') > -1);\n"],"mappings":";AAaA,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAIxB,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,cAAc,CAAC,UAAqB,MAAM,IAAI;AACpD,IAAM,4BAA4B,CAAC,UAAqB,MAAM,IAAI;AAClE,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,aAAa,CAAC,UAAqB,MAAM,IAAI;AACnD,IAAM,cAAc,CAAC,UAAqB,MAAM,IAAI;AACpD,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,wBAAwB,CAAC,UAAqB,MAAM,IAAI;AAC9D,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,eAAe,CAAC,UAAqB,MAAM,IAAI;AACrD,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,YAAY,CAAC,UAAqB,MAAM,IAAI;AAClD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,yBAAyB,CAAC,UAAqB,MAAM,IAAI;
|
|
1
|
+
{"version":3,"sources":["../src/appSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { versionCompare } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { RootState } from '../store';\n\nexport const getDocsVersion = (state: RootState) => state.app.docsVersion;\nexport const getFeatures = (state: RootState) => state.app.features;\nexport const getFullVersionInformation = (state: RootState) => state.app.versionInformation;\nexport const getSearchState = (state: RootState) => state.app.searchState;\nexport const getUploads = (state: RootState) => state.app.uploadsById;\nexport const getSnackbar = (state: RootState) => state.app.snackbar;\nexport const getHostAddress = (state: RootState) => state.app.hostAddress;\nexport const getHostedAnnouncement = (state: RootState) => state.app.hostedAnnouncement;\nexport const getRecaptchaKey = (state: RootState) => state.app.recaptchaSiteKey;\nexport const getStripeKey = (state: RootState) => state.app.stripeAPIKey;\nexport const getTrackerCode = (state: RootState) => state.app.trackerCode;\nexport const getSentryConfig = (state: RootState) => state.app.sentry;\nexport const getCommit = (state: RootState) => state.app.commit;\nexport const getIsFirstLogin = (state: RootState) => state.app.firstLoginAfterSignup;\nexport const getFeedbackProbability = (state: RootState) => state.app.feedbackProbability;\nexport const getAppInitDone = (state: RootState) => state.app.appInitDone;\n\nexport const getIsUploading = createSelector([getUploads], uploadsById => !!Object.keys(uploadsById).length);\nexport const getSearchedDevices = createSelector([getSearchState], ({ deviceIds }) => deviceIds);\nexport const getVersionInformation = createSelector([getFullVersionInformation, getFeatures], ({ Integration, ...remainder }, { isHosted }) =>\n isHosted && Integration !== 'next' ? remainder : { ...remainder, Integration }\n);\nexport const getIsPreview = createSelector([getFullVersionInformation], ({ Integration }) => versionCompare(Integration, 'next') > -1);\n"],"mappings":";AAaA,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAIxB,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,cAAc,CAAC,UAAqB,MAAM,IAAI;AACpD,IAAM,4BAA4B,CAAC,UAAqB,MAAM,IAAI;AAClE,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,aAAa,CAAC,UAAqB,MAAM,IAAI;AACnD,IAAM,cAAc,CAAC,UAAqB,MAAM,IAAI;AACpD,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,wBAAwB,CAAC,UAAqB,MAAM,IAAI;AAC9D,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,eAAe,CAAC,UAAqB,MAAM,IAAI;AACrD,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AACvD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,YAAY,CAAC,UAAqB,MAAM,IAAI;AAClD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,IAAI;AACxD,IAAM,yBAAyB,CAAC,UAAqB,MAAM,IAAI;AAC/D,IAAM,iBAAiB,CAAC,UAAqB,MAAM,IAAI;AAEvD,IAAM,iBAAiB,eAAe,CAAC,UAAU,GAAG,iBAAe,CAAC,CAAC,OAAO,KAAK,WAAW,EAAE,MAAM;AACpG,IAAM,qBAAqB,eAAe,CAAC,cAAc,GAAG,CAAC,EAAE,UAAU,MAAM,SAAS;AACxF,IAAM,wBAAwB;AAAA,EAAe,CAAC,2BAA2B,WAAW;AAAA,EAAG,CAAC,EAAE,aAAa,GAAG,UAAU,GAAG,EAAE,SAAS,MACvI,YAAY,gBAAgB,SAAS,YAAY,EAAE,GAAG,WAAW,YAAY;AAC/E;AACO,IAAM,eAAe,eAAe,CAAC,yBAAyB,GAAG,CAAC,EAAE,YAAY,MAAM,eAAe,aAAa,MAAM,IAAI,EAAE;","names":[]}
|
|
@@ -11,6 +11,7 @@ var getYesterday = () => {
|
|
|
11
11
|
return today.toISOString();
|
|
12
12
|
};
|
|
13
13
|
var initialState = {
|
|
14
|
+
appInitDone: false,
|
|
14
15
|
cancelSource: void 0,
|
|
15
16
|
commit: "",
|
|
16
17
|
demoArtifactLink: "https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender",
|
|
@@ -33,6 +34,7 @@ var initialState = {
|
|
|
33
34
|
hasFeedbackEnabled: false,
|
|
34
35
|
hasMonitor: false,
|
|
35
36
|
hasMCUEnabled: false,
|
|
37
|
+
hasOldTheme: false,
|
|
36
38
|
hasReporting: false,
|
|
37
39
|
isHosted: true,
|
|
38
40
|
isEnterprise: false
|
|
@@ -137,7 +139,10 @@ var appSlice = createSlice({
|
|
|
137
139
|
...action.payload
|
|
138
140
|
};
|
|
139
141
|
},
|
|
140
|
-
setEnvironmentData: (state, action) => ({ ...state, ...action.payload })
|
|
142
|
+
setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),
|
|
143
|
+
setAppInitDone: (state) => {
|
|
144
|
+
state.appInitDone = true;
|
|
145
|
+
}
|
|
141
146
|
}
|
|
142
147
|
});
|
|
143
148
|
var actions = appSlice.actions;
|
|
@@ -150,4 +155,4 @@ export {
|
|
|
150
155
|
actions,
|
|
151
156
|
appSlice_default
|
|
152
157
|
};
|
|
153
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-6WJI4MOP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n hasOldTheme: false,\n hasReporting: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Client': '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reduc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EAAE,IAAI;AAAA,QACtB,GAAG,MAAM,YAAY,EAAE;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAAA,IACA,eAAe,CAAC,OAAO,WAAkC;AAEvD,YAAM,EAAE,CAAC,OAAO,OAAO,GAAG,SAAS,GAAG,UAAU,IAAI,MAAM;AAC1D,YAAM,cAAc;AAAA,IACtB;AAAA,IACA,uBAAuB,CAAC,OAAO,WAA8C;AAC3E,YAAM,qBAAqB;AAAA,QACzB,GAAG,MAAM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB,CAAC,OAAO,YAAY,EAAE,GAAG,OAAO,GAAG,OAAO,QAAQ;AAAA,IACtE,gBAAgB,WAAS;AACvB,YAAM,cAAc;AAAA,IACtB;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,SAAS;AAChC,IAAO,mBAAQ,SAAS;","names":[]}
|
|
@@ -22,7 +22,7 @@ var PLANS = {
|
|
|
22
22
|
os: {
|
|
23
23
|
id: "os",
|
|
24
24
|
name: "Basic",
|
|
25
|
-
minimalDeviceCount: 50,
|
|
25
|
+
minimalDeviceCount: { standard: 50, micro: 100 },
|
|
26
26
|
offer: true,
|
|
27
27
|
price: "$34 / month",
|
|
28
28
|
deviceCount: startingDeviceCount.os,
|
|
@@ -32,7 +32,7 @@ var PLANS = {
|
|
|
32
32
|
professional: {
|
|
33
33
|
id: "professional",
|
|
34
34
|
name: "Professional",
|
|
35
|
-
minimalDeviceCount: 250,
|
|
35
|
+
minimalDeviceCount: { standard: 250, micro: 500 },
|
|
36
36
|
offer: true,
|
|
37
37
|
price: "$291 / month",
|
|
38
38
|
deviceCount: startingDeviceCount.professional,
|
|
@@ -42,7 +42,7 @@ var PLANS = {
|
|
|
42
42
|
enterprise: {
|
|
43
43
|
id: "enterprise",
|
|
44
44
|
name: "Enterprise",
|
|
45
|
-
minimalDeviceCount: 1e3,
|
|
45
|
+
minimalDeviceCount: { standard: 1e3, micro: 2e3 },
|
|
46
46
|
price: "Custom pricing",
|
|
47
47
|
deviceCount: "Unlimited devices",
|
|
48
48
|
description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote.",
|
|
@@ -150,4 +150,4 @@ export {
|
|
|
150
150
|
DARK_MODE,
|
|
151
151
|
LIGHT_MODE
|
|
152
152
|
};
|
|
153
|
-
//# sourceMappingURL=chunk-
|
|
153
|
+
//# sourceMappingURL=chunk-EL672W25.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nconst startingDeviceCount = {\n os: 'for first 50 devices',\n professional: 'for first 250 devices'\n} as const;\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n deviceCount: string;\n features: string[];\n id: AvailablePlans;\n minimalDeviceCount: { micro: number; standard: number };\n name: string;\n offer?: boolean;\n offerprice?: string;\n price: string;\n price2?: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n minimalDeviceCount: { standard: 50, micro: 100 },\n offer: true,\n price: '$34 / month',\n deviceCount: startingDeviceCount.os,\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.',\n features: ['Access to core features of Mender', 'Basic support']\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n minimalDeviceCount: { standard: 250, micro: 500 },\n offer: true,\n price: '$291 / month',\n deviceCount: startingDeviceCount.professional,\n description: 'Everything in Basic, plus enhanced update management and automation features.',\n features: ['Advanced OTA features', 'Higher priority support']\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n minimalDeviceCount: { standard: 1000, micro: 2000 },\n price: 'Custom pricing',\n deviceCount: 'Unlimited devices',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.',\n features: ['All Mender features', 'Advanced security features', 'SLA-backed support']\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n} & {\n [key in Exclude<AvailablePlans, 'enterprise'>]: {\n deviceCount: string;\n price: string;\n };\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Expand your plan with device configuration features',\n needs: ['hasDeviceConfig'],\n os: {\n price: '$11/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$65/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Expand your plan with device monitoring features',\n needs: ['hasMonitor'],\n os: {\n price: '-',\n deviceCount: '-'\n },\n professional: {\n price: '$86/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Expand your plan with device troubleshooting features',\n needs: ['hasDeviceConnect'],\n os: {\n price: '$27/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$72/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: { id: 'auditlog', benefit: 'trace change across your devices and access troubleshooting session replay', requiredPlan: PLANS.professional.id },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";AAaA,SAAS,YAAY,cAAc,mBAAmB,oBAAoB;AAE1E,SAAS,OAAO,eAAe;AAE/B,IAAM,sBAAsB;AAAA,EAC1B,IAAI;AAAA,EACJ,cAAc;AAChB;AAEO,IAAM,aAAa;AAAA,EACxB,KAAK,EAAE,KAAK,OAAO,MAAM,aAAa;AAAA,EACtC,KAAK,EAAE,KAAK,OAAO,MAAM,aAAa;AACxC;AACO,IAAM,sBAAsB,EAAE,UAAU,IAAI,OAAO,IAAI,WAAW,WAAW,IAAI,KAAK,WAAW,gBAAgB;AACjH,IAAM,oBAAoB;AAC1B,IAAM,iBAAiB,CAAC,EAAE,GAAG,qBAAqB,OAAO,MAAM,WAAW,iBAAiB,MAAM,kBAAkB,CAAC;AAEpH,IAAM,oBAAoB;AAE1B,IAAM,YAAY;AAAA,EACvB,IAAI,EAAE,KAAK,MAAM,OAAO,SAAS,UAAU,mBAAmB;AAAA,EAC9D,IAAI,EAAE,KAAK,MAAM,OAAO,MAAM,UAAU,sBAAsB;AAAA,EAC9D,IAA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AAA,IACJ,SAAS;AAAA,IACT,cAAc,MAAM,WAAW;AAAA,EACjC;AAAA,EACA,mBAAmB,EAAE,IAAI,qBAAqB,SAAS,qDAAqD,cAAc,MAAM,WAAW,GAAG;AAAA,EAC9I,MAAM,EAAE,IAAI,QAAQ,SAAS,sCAAsC,cAAc,MAAM,WAAW,GAAG;AAAA,EACrG,kBAAkB,EAAE,IAAI,oBAAoB,SAAS,gDAAgD,cAAc,MAAM,aAAa,GAAG;AAAA,EACzI,sBAAsB;AAAA,IACpB,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,cAAc,MAAM,aAAa;AAAA,EACnC;AAAA,EACA,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,cAAc,MAAM,aAAa;AAAA,EACnC;AAAA,EAEA,SAAS,EAAE,IAAI,WAAW,SAAS,+BAA+B,cAAc,MAAM,WAAW,GAAG;AACtG;AAEO,IAAM,MAAM;AACZ,IAAM,YAAY;AAElB,IAAM,YAAY;AAClB,IAAM,aAAa;","names":[]}
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
commonErrorFallback,
|
|
3
3
|
commonErrorHandler,
|
|
4
4
|
createAppAsyncThunk
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MWJFQYA2.js";
|
|
6
6
|
import {
|
|
7
7
|
general_api_default
|
|
8
8
|
} from "./chunk-5M6EUVNO.js";
|
|
9
9
|
import {
|
|
10
10
|
actions_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-M7YH35Y4.js";
|
|
12
12
|
import {
|
|
13
13
|
actions,
|
|
14
14
|
sliceName
|
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
} from "./chunk-53W2NRSL.js";
|
|
19
19
|
import {
|
|
20
20
|
getSearchEndpoint
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NJMHH7TJ.js";
|
|
22
22
|
import {
|
|
23
23
|
getReleasesById
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GEQ2QQEE.js";
|
|
25
25
|
import {
|
|
26
26
|
convertDeviceListStateToFilters,
|
|
27
27
|
progress
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-U5TPV5X5.js";
|
|
29
29
|
import {
|
|
30
30
|
DEVICE_LIST_DEFAULTS,
|
|
31
31
|
SORTING_OPTIONS,
|
|
@@ -442,4 +442,4 @@ export {
|
|
|
442
442
|
getDeltaGenerationJobs,
|
|
443
443
|
getDeltaGenerationJobDetails
|
|
444
444
|
};
|
|
445
|
-
//# sourceMappingURL=chunk-
|
|
445
|
+
//# sourceMappingURL=chunk-GAADWFQZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listItemMapper
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U5TPV5X5.js";
|
|
4
4
|
|
|
5
5
|
// src/releasesSlice/selectors.ts
|
|
6
6
|
import { createSelector } from "@reduxjs/toolkit";
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
getDeltaJobById,
|
|
42
42
|
getSelectedJob
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-GEQ2QQEE.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
actions as actions8
|
|
3
|
-
} from "./chunk-KJ4BPXMB.js";
|
|
4
1
|
import {
|
|
5
2
|
actions as actions7
|
|
6
3
|
} from "./chunk-TRKA7XYU.js";
|
|
7
4
|
import {
|
|
8
|
-
actions as
|
|
9
|
-
} from "./chunk-
|
|
5
|
+
actions as actions8
|
|
6
|
+
} from "./chunk-KJ4BPXMB.js";
|
|
10
7
|
import {
|
|
11
8
|
actions as actions4
|
|
12
9
|
} from "./chunk-PVCHKW35.js";
|
|
10
|
+
import {
|
|
11
|
+
actions as actions6
|
|
12
|
+
} from "./chunk-VCEFZTWS.js";
|
|
13
13
|
import {
|
|
14
14
|
actions as actions5
|
|
15
15
|
} from "./chunk-CQXDAXQF.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-VODRLEDP.js";
|
|
19
19
|
import {
|
|
20
20
|
actions
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-6WJI4MOP.js";
|
|
22
22
|
import {
|
|
23
23
|
actions as actions2
|
|
24
24
|
} from "./chunk-OLKM53RL.js";
|
|
@@ -38,4 +38,4 @@ var actions_default = {
|
|
|
38
38
|
export {
|
|
39
39
|
actions_default
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-M7YH35Y4.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
actions_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M7YH35Y4.js";
|
|
4
|
+
import {
|
|
5
|
+
releasesSlice_default
|
|
6
|
+
} from "./chunk-TRKA7XYU.js";
|
|
4
7
|
import {
|
|
5
8
|
actions as actions2,
|
|
6
9
|
usersSlice_default
|
|
7
10
|
} from "./chunk-KJ4BPXMB.js";
|
|
8
11
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
monitorSlice_default
|
|
13
|
+
} from "./chunk-PVCHKW35.js";
|
|
11
14
|
import {
|
|
12
15
|
actions,
|
|
13
16
|
organizationSlice_default
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import {
|
|
16
|
-
monitorSlice_default
|
|
17
|
-
} from "./chunk-PVCHKW35.js";
|
|
17
|
+
} from "./chunk-VCEFZTWS.js";
|
|
18
18
|
import {
|
|
19
19
|
onboardingSlice_default
|
|
20
20
|
} from "./chunk-CQXDAXQF.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-VODRLEDP.js";
|
|
24
24
|
import {
|
|
25
25
|
appSlice_default
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6WJI4MOP.js";
|
|
27
27
|
import {
|
|
28
28
|
deploymentsSlice_default
|
|
29
29
|
} from "./chunk-OLKM53RL.js";
|
|
@@ -139,4 +139,4 @@ export {
|
|
|
139
139
|
useAppDispatch,
|
|
140
140
|
createAppAsyncThunk
|
|
141
141
|
};
|
|
142
|
-
//# sourceMappingURL=chunk-
|
|
142
|
+
//# sourceMappingURL=chunk-MWJFQYA2.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getReleasesById
|
|
3
|
+
} from "./chunk-GEQ2QQEE.js";
|
|
1
4
|
import {
|
|
2
5
|
getCurrentUser,
|
|
3
6
|
getGlobalSettings,
|
|
4
7
|
getRolesById,
|
|
5
8
|
getRolesList,
|
|
6
9
|
getUserSettings
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3YJY7KQW.js";
|
|
8
11
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
getOnboarding
|
|
13
|
+
} from "./chunk-JIS4PA3R.js";
|
|
14
|
+
import {
|
|
15
|
+
getIssueCountsByType
|
|
16
|
+
} from "./chunk-YO22XLHI.js";
|
|
11
17
|
import {
|
|
12
18
|
getAuditLogEntry,
|
|
13
19
|
getIsServiceProvider,
|
|
14
20
|
getOrganization
|
|
15
21
|
} from "./chunk-3NOV7X4M.js";
|
|
16
|
-
import {
|
|
17
|
-
getIssueCountsByType
|
|
18
|
-
} from "./chunk-YO22XLHI.js";
|
|
19
|
-
import {
|
|
20
|
-
getOnboarding
|
|
21
|
-
} from "./chunk-JIS4PA3R.js";
|
|
22
22
|
import {
|
|
23
23
|
getDeploymentsById,
|
|
24
24
|
getDeploymentsSelectionState,
|
|
@@ -30,15 +30,15 @@ import {
|
|
|
30
30
|
getFilteringAttributes,
|
|
31
31
|
getGroupsById,
|
|
32
32
|
getListedDevices
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-O7DR57RN.js";
|
|
34
34
|
import {
|
|
35
35
|
getFeatures,
|
|
36
36
|
getSearchedDevices
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-4BHM6WVX.js";
|
|
38
38
|
import {
|
|
39
39
|
listItemMapper,
|
|
40
40
|
mapUserRolesToUiPermissions
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-U5TPV5X5.js";
|
|
42
42
|
import {
|
|
43
43
|
ALL_DEVICES,
|
|
44
44
|
ATTRIBUTE_SCOPES,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
ADDONS,
|
|
60
60
|
PLANS,
|
|
61
61
|
defaultReports
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-EL672W25.js";
|
|
63
63
|
|
|
64
64
|
// src/commonSelectors.ts
|
|
65
65
|
import { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from "@northern.tech/utils/helpers";
|
|
@@ -289,4 +289,4 @@ export {
|
|
|
289
289
|
getAuditlogDevice,
|
|
290
290
|
getRelevantRoles
|
|
291
291
|
};
|
|
292
|
-
//# sourceMappingURL=chunk-
|
|
292
|
+
//# sourceMappingURL=chunk-NJMHH7TJ.js.map
|
|
@@ -106,6 +106,17 @@ var getAttributesList = createSelector(
|
|
|
106
106
|
[getFilteringAttributes, getFilteringAttributesFromConfig],
|
|
107
107
|
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)
|
|
108
108
|
);
|
|
109
|
+
var getDeviceLimitStats = createSelector(
|
|
110
|
+
[getDeviceLimits, getAcceptedDevices],
|
|
111
|
+
(limits, accepted) => {
|
|
112
|
+
const { counts } = accepted;
|
|
113
|
+
return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
|
|
114
|
+
type,
|
|
115
|
+
limit,
|
|
116
|
+
total: counts[type] || 0
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
);
|
|
109
120
|
var getDeviceTypes = createSelector(
|
|
110
121
|
[getAcceptedDevices, getDevicesById],
|
|
111
122
|
({ deviceIds = [] }, devicesById) => Object.keys(
|
|
@@ -145,6 +156,7 @@ export {
|
|
|
145
156
|
getGroupData,
|
|
146
157
|
getGroups,
|
|
147
158
|
getAttributesList,
|
|
159
|
+
getDeviceLimitStats,
|
|
148
160
|
getDeviceTypes
|
|
149
161
|
};
|
|
150
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-O7DR57RN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/devicesSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { duplicateFilter } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { DeviceFilter, DeviceGroup } from '.';\nimport type { DeviceAuthState } from '../constants';\nimport { DEVICE_STATES, UNGROUPED_GROUP } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getAcceptedDevices = (state: RootState) => state.devices.byStatus.accepted;\nexport const getDevicesByStatus = (state: RootState) => state.devices.byStatus;\nexport const getDevicesById = (state: RootState) => state.devices.byId;\nexport const getDeviceReports = (state: RootState) => state.devices.reports;\nexport const getGroupsById = (state: RootState) => state.devices.groups.byId;\nexport const getSelectedGroup = (state: RootState) => state.devices.groups.selectedGroup;\n\nexport const getDeviceListState = (state: RootState) => state.devices.deviceList;\nexport const getListedDevices = (state: RootState) => state.devices.deviceList.deviceIds;\nexport const getFilteringAttributes = (state: RootState) => state.devices.filteringAttributes;\nexport const getDeviceFilters = (state: RootState) => state.devices.filters || [];\nconst getFilteringAttributesFromConfig = (state: RootState) => state.devices.filteringAttributesConfig.attributes;\nexport const getSortedFilteringAttributes = createSelector([getFilteringAttributes], filteringAttributes => ({\n ...filteringAttributes,\n identityAttributes: [...filteringAttributes.identityAttributes, 'id']\n}));\nexport const getDeviceLimits = (state: RootState) => state.devices.limits;\nconst getFilteringAttributesLimit = (state: RootState) => state.devices.filteringAttributesLimit;\n\nexport const getDeviceIdentityAttributes = createSelector(\n [getFilteringAttributes, getFilteringAttributesLimit],\n ({ identityAttributes }, filteringAttributesLimit) => {\n // limit the selection of the available attribute to AVAILABLE_ATTRIBUTE_LIMIT\n const attributes = identityAttributes.slice(0, filteringAttributesLimit);\n return attributes.reduce(\n (accu, value) => {\n accu.push({ value, label: value, scope: 'identity' });\n return accu;\n },\n [\n { value: 'name', label: 'Name', scope: 'tags' },\n { value: 'id', label: 'Device ID', scope: 'identity' }\n ]\n );\n }\n);\n\nexport const getDeviceCountsByStatus = createSelector([getDevicesByStatus], byStatus =>\n Object.values(DEVICE_STATES).reduce<Record<DeviceAuthState, number>>(\n (accu, deviceState) => {\n const { counts } = byStatus[deviceState];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { total, ...tieredCounts } = counts;\n const count = Object.values(tieredCounts).reduce((accu, countPerTier) => accu + countPerTier, 0);\n accu[deviceState] = count;\n accu.total = accu.total + count;\n return accu;\n },\n { total: 0 }\n )\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getDeviceCountsByStatus, getGroupsById, getSelectedGroup],\n ({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {\n let groupCount = acceptedDeviceTotal;\n let groupFilters: DeviceFilter[] = [];\n if (selectedGroup && groupsById[selectedGroup]) {\n groupCount = groupsById[selectedGroup].total || 0;\n groupFilters = groupsById[selectedGroup].filters || [];\n }\n return { groupCount, selectedGroup, groupFilters };\n }\n);\n\nexport const getCombinedLimit = createSelector(\n [getDeviceLimits],\n deviceLimits => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0) // limit might be -1 for unlimited devices\n);\n\nexport const getLimitMaxed = createSelector(\n [getDeviceCountsByStatus, getCombinedLimit],\n ({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices\n);\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const getGroupsByIdWithoutUngrouped = createSelector([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);\n\nexport const getGroupData = createSelector([getGroupsByIdWithoutUngrouped], groups => {\n const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : undefined;\n const hasDynamicGroups = Object.values(groups).some(group => !!group.id);\n return { createdGroup, hasDynamicGroups, groups };\n});\n\ntype SelectorGroup = DeviceGroup & { groupId: string };\ntype SelectorGroups = { dynamic: SelectorGroup[]; static: SelectorGroup[]; ungrouped: SelectorGroup[] };\n\nexport const getGroups = createSelector([getGroupsById], groupsById => {\n const groupNames = Object.keys(groupsById).sort();\n const groupedGroups = Object.entries(groupsById)\n .sort((a, b) => a[0].localeCompare(b[0]))\n .reduce<SelectorGroups>(\n (accu, [groupname, group]) => {\n const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;\n const groupItem = { ...group, groupId: name, name: groupname };\n if ((group.filters ?? []).length > 0) {\n if (groupname !== UNGROUPED_GROUP.id) {\n accu.dynamic.push(groupItem);\n } else {\n accu.ungrouped.push(groupItem);\n }\n } else {\n accu.static.push(groupItem);\n }\n return accu;\n },\n { dynamic: [], static: [], ungrouped: [] }\n );\n return { groupNames, ...groupedGroups };\n});\nexport const getAttributesList = createSelector(\n [getFilteringAttributes, getFilteringAttributesFromConfig],\n ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) =>\n [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)\n);\n\nexport const getDeviceTypes = createSelector([getAcceptedDevices, getDevicesById], ({ deviceIds = [] }, devicesById) =>\n Object.keys(\n deviceIds.slice(0, 200).reduce((accu, item) => {\n const { device_type: deviceTypes = [] } = devicesById[item] ? devicesById[item].attributes : {};\n accu = deviceTypes.reduce((deviceTypeAccu, deviceType) => {\n if (deviceType.length > 1) {\n deviceTypeAccu[deviceType] = deviceTypeAccu[deviceType] ? deviceTypeAccu[deviceType] + 1 : 1;\n }\n return deviceTypeAccu;\n }, accu);\n return accu;\n }, {})\n )\n);\n"],"mappings":";;;;;;AAaA,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAOxB,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ,SAAS;AACxE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,iBAAiB,CAAC,UAAqB,MAAM,QAAQ;AAC3D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ;AAC7D,IAAM,gBAAgB,CAAC,UAAqB,MAAM,QAAQ,OAAO;AACjE,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,OAAO;AAEpE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,WAAW;AACxE,IAAM,yBAAyB,CAAC,UAAqB,MAAM,QAAQ;AACnE,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,WAAW,CAAC;AAChF,IAAM,mCAAmC,CAAC,UAAqB,MAAM,QAAQ,0BAA0B;AAChG,IAAM,+BAA+B,eAAe,CAAC,sBAAsB,GAAG,0BAAwB;AAAA,EAC3G,GAAG;AAAA,EACH,oBAAoB,CAAC,GAAG,oBAAoB,oBAAoB,IAAI;AACtE,EAAE;AACK,IAAM,kBAAkB,CAAC,UAAqB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lice/selectors.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { duplicateFilter } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { DeviceFilter, DeviceGroup } from '.';\nimport type { DeviceAuthState } from '../constants';\nimport { DEVICE_STATES, UNGROUPED_GROUP } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getAcceptedDevices = (state: RootState) => state.devices.byStatus.accepted;\nexport const getDevicesByStatus = (state: RootState) => state.devices.byStatus;\nexport const getDevicesById = (state: RootState) => state.devices.byId;\nexport const getDeviceReports = (state: RootState) => state.devices.reports;\nexport const getGroupsById = (state: RootState) => state.devices.groups.byId;\nexport const getSelectedGroup = (state: RootState) => state.devices.groups.selectedGroup;\n\nexport const getDeviceListState = (state: RootState) => state.devices.deviceList;\nexport const getListedDevices = (state: RootState) => state.devices.deviceList.deviceIds;\nexport const getFilteringAttributes = (state: RootState) => state.devices.filteringAttributes;\nexport const getDeviceFilters = (state: RootState) => state.devices.filters || [];\nconst getFilteringAttributesFromConfig = (state: RootState) => state.devices.filteringAttributesConfig.attributes;\nexport const getSortedFilteringAttributes = createSelector([getFilteringAttributes], filteringAttributes => ({\n ...filteringAttributes,\n identityAttributes: [...filteringAttributes.identityAttributes, 'id']\n}));\nexport const getDeviceLimits = (state: RootState) => state.devices.limits;\nconst getFilteringAttributesLimit = (state: RootState) => state.devices.filteringAttributesLimit;\n\nexport const getDeviceIdentityAttributes = createSelector(\n [getFilteringAttributes, getFilteringAttributesLimit],\n ({ identityAttributes }, filteringAttributesLimit) => {\n // limit the selection of the available attribute to AVAILABLE_ATTRIBUTE_LIMIT\n const attributes = identityAttributes.slice(0, filteringAttributesLimit);\n return attributes.reduce(\n (accu, value) => {\n accu.push({ value, label: value, scope: 'identity' });\n return accu;\n },\n [\n { value: 'name', label: 'Name', scope: 'tags' },\n { value: 'id', label: 'Device ID', scope: 'identity' }\n ]\n );\n }\n);\n\nexport const getDeviceCountsByStatus = createSelector([getDevicesByStatus], byStatus =>\n Object.values(DEVICE_STATES).reduce<Record<DeviceAuthState, number>>(\n (accu, deviceState) => {\n const { counts } = byStatus[deviceState];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { total, ...tieredCounts } = counts;\n const count = Object.values(tieredCounts).reduce((accu, countPerTier) => accu + countPerTier, 0);\n accu[deviceState] = count;\n accu.total = accu.total + count;\n return accu;\n },\n { total: 0 }\n )\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getDeviceCountsByStatus, getGroupsById, getSelectedGroup],\n ({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {\n let groupCount = acceptedDeviceTotal;\n let groupFilters: DeviceFilter[] = [];\n if (selectedGroup && groupsById[selectedGroup]) {\n groupCount = groupsById[selectedGroup].total || 0;\n groupFilters = groupsById[selectedGroup].filters || [];\n }\n return { groupCount, selectedGroup, groupFilters };\n }\n);\n\nexport const getCombinedLimit = createSelector(\n [getDeviceLimits],\n deviceLimits => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0) // limit might be -1 for unlimited devices\n);\n\nexport const getLimitMaxed = createSelector(\n [getDeviceCountsByStatus, getCombinedLimit],\n ({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices\n);\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const getGroupsByIdWithoutUngrouped = createSelector([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);\n\nexport const getGroupData = createSelector([getGroupsByIdWithoutUngrouped], groups => {\n const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : undefined;\n const hasDynamicGroups = Object.values(groups).some(group => !!group.id);\n return { createdGroup, hasDynamicGroups, groups };\n});\n\ntype SelectorGroup = DeviceGroup & { groupId: string };\ntype SelectorGroups = { dynamic: SelectorGroup[]; static: SelectorGroup[]; ungrouped: SelectorGroup[] };\n\nexport const getGroups = createSelector([getGroupsById], groupsById => {\n const groupNames = Object.keys(groupsById).sort();\n const groupedGroups = Object.entries(groupsById)\n .sort((a, b) => a[0].localeCompare(b[0]))\n .reduce<SelectorGroups>(\n (accu, [groupname, group]) => {\n const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;\n const groupItem = { ...group, groupId: name, name: groupname };\n if ((group.filters ?? []).length > 0) {\n if (groupname !== UNGROUPED_GROUP.id) {\n accu.dynamic.push(groupItem);\n } else {\n accu.ungrouped.push(groupItem);\n }\n } else {\n accu.static.push(groupItem);\n }\n return accu;\n },\n { dynamic: [], static: [], ungrouped: [] }\n );\n return { groupNames, ...groupedGroups };\n});\nexport const getAttributesList = createSelector(\n [getFilteringAttributes, getFilteringAttributesFromConfig],\n ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) =>\n [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)\n);\nexport const getDeviceLimitStats = createSelector(\n [getDeviceLimits, getAcceptedDevices],\n (limits, accepted) => {\n const { counts } = accepted;\n return Object.entries(limits)\n .filter(([, limit]) => limit !== 0)\n .map(([type, limit]) => ({\n type,\n limit,\n total: counts[type] || 0\n }));\n }\n);\n\nexport const getDeviceTypes = createSelector([getAcceptedDevices, getDevicesById], ({ deviceIds = [] }, devicesById) =>\n Object.keys(\n deviceIds.slice(0, 200).reduce((accu, item) => {\n const { device_type: deviceTypes = [] } = devicesById[item] ? devicesById[item].attributes : {};\n accu = deviceTypes.reduce((deviceTypeAccu, deviceType) => {\n if (deviceType.length > 1) {\n deviceTypeAccu[deviceType] = deviceTypeAccu[deviceType] ? deviceTypeAccu[deviceType] + 1 : 1;\n }\n return deviceTypeAccu;\n }, accu);\n return accu;\n }, {})\n )\n);\n"],"mappings":";;;;;;AAaA,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAOxB,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ,SAAS;AACxE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,iBAAiB,CAAC,UAAqB,MAAM,QAAQ;AAC3D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ;AAC7D,IAAM,gBAAgB,CAAC,UAAqB,MAAM,QAAQ,OAAO;AACjE,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,OAAO;AAEpE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,WAAW;AACxE,IAAM,yBAAyB,CAAC,UAAqB,MAAM,QAAQ;AACnE,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,WAAW,CAAC;AAChF,IAAM,mCAAmC,CAAC,UAAqB,MAAM,QAAQ,0BAA0B;AAChG,IAAM,+BAA+B,eAAe,CAAC,sBAAsB,GAAG,0BAAwB;AAAA,EAC3G,GAAG;AAAA,EACH,oBAAoB,CAAC,GAAG,oBAAoB,oBAAoB,IAAI;AACtE,EAAE;AACK,IAAM,kBAAkB,CAAC,UAAqB,MAAM,QAAQ;AACnE,IAAM,8BAA8B,CAAC,UAAqB,MAAM,QAAQ;AAEjE,IAAM,8BAA8B;AAAA,EACzC,CAAC,wBAAwB,2BAA2B;AAAA,EACpD,CAAC,EAAE,mBAAmB,GAAG,6BAA6B;AAEpD,UAAM,aAAa,mBAAmB,MAAM,GAAG,wBAAwB;AACvE,WAAO,WAAW;AAAA,MAChB,CAAC,MAAM,U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T,GAAG,CAAC,CAAC;AAAA,EACP;AACF;","names":["accu"]}
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-2DYA3X77.js";
|
|
17
17
|
import {
|
|
18
18
|
DARK_MODE
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-EL672W25.js";
|
|
20
20
|
|
|
21
21
|
// src/utils.ts
|
|
22
22
|
import { duplicateFilter, yes } from "@northern.tech/utils/helpers";
|
|
@@ -199,16 +199,16 @@ var mapDeviceAttributes = (attributes = []) => attributes.reduce(
|
|
|
199
199
|
);
|
|
200
200
|
var isDarkMode = (mode) => mode === DARK_MODE;
|
|
201
201
|
var parseSubscriptionPreview = (lines) => lines.reduce(
|
|
202
|
-
(acc, { addon, amount }) => {
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
acc
|
|
202
|
+
(acc, { addon, amount, product }) => {
|
|
203
|
+
const planId = product.slice("mender_".length);
|
|
204
|
+
if (!addon) {
|
|
205
|
+
acc[planId] = (acc[planId] ?? 0) + amount;
|
|
206
206
|
} else {
|
|
207
|
-
acc.addons[
|
|
207
|
+
acc.addons[addon] = (acc.addons[addon] ?? 0) + amount;
|
|
208
208
|
}
|
|
209
209
|
return acc;
|
|
210
210
|
},
|
|
211
|
-
{
|
|
211
|
+
{ addons: {} }
|
|
212
212
|
);
|
|
213
213
|
|
|
214
214
|
export {
|
|
@@ -233,4 +233,4 @@ export {
|
|
|
233
233
|
isDarkMode,
|
|
234
234
|
parseSubscriptionPreview
|
|
235
235
|
};
|
|
236
|
-
//# sourceMappingURL=chunk-
|
|
236
|
+
//# sourceMappingURL=chunk-U5TPV5X5.js.map
|