@northern.tech/store 0.8.0 → 0.10.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.
Files changed (141) hide show
  1. package/dist/actions.cjs +7 -3
  2. package/dist/actions.cjs.map +1 -1
  3. package/dist/actions.d.cts +1 -1
  4. package/dist/actions.d.ts +1 -1
  5. package/dist/actions.js +5 -5
  6. package/dist/api/general-api.js +1 -1
  7. package/dist/api/users-api.js +1 -1
  8. package/dist/appSlice/constants.cjs +2 -1
  9. package/dist/appSlice/constants.cjs.map +1 -1
  10. package/dist/appSlice/constants.js +1 -1
  11. package/dist/appSlice/index.js +1 -1
  12. package/dist/appSlice/mocks.js +1 -1
  13. package/dist/appSlice/thunks.cjs +18 -8
  14. package/dist/appSlice/thunks.cjs.map +1 -1
  15. package/dist/appSlice/thunks.js +16 -16
  16. package/dist/auth.js +1 -1
  17. package/dist/{chunk-DJXS3LMY.js → chunk-2KT4PX3H.js} +10 -10
  18. package/dist/{chunk-RJKAD2TK.js → chunk-2S4DM4MI.js} +17 -17
  19. package/dist/{chunk-Z5TDXPYZ.js → chunk-7QKCBSFU.js} +2 -2
  20. package/dist/{chunk-IY3OCILF.js → chunk-DIBKFSC7.js} +25 -25
  21. package/dist/chunk-DIBKFSC7.js.map +1 -0
  22. package/dist/{chunk-H5YHKATI.js → chunk-GGBE6KJV.js} +2 -2
  23. package/dist/{chunk-2TYNHR66.js → chunk-GX2TWNLC.js} +2 -2
  24. package/dist/{chunk-IURSNZM7.js → chunk-J5KNRQFA.js} +6 -6
  25. package/dist/{chunk-N3XU7WJM.js → chunk-OWWCFJZ5.js} +3 -2
  26. package/dist/chunk-OWWCFJZ5.js.map +1 -0
  27. package/dist/{chunk-KQ6AGXRK.js → chunk-REZWSU22.js} +8 -4
  28. package/dist/chunk-REZWSU22.js.map +1 -0
  29. package/dist/{chunk-UVYRVFZX.js → chunk-SE22RKCE.js} +11 -5
  30. package/dist/chunk-SE22RKCE.js.map +1 -0
  31. package/dist/{chunk-FCHMFLKB.js → chunk-YYA5MPLL.js} +8 -8
  32. package/dist/{chunk-EF4FYV4X.js → chunk-ZK2CPOZO.js} +6 -6
  33. package/dist/commonConstants.js +1 -1
  34. package/dist/commonSelectors.cjs +9 -3
  35. package/dist/commonSelectors.cjs.map +1 -1
  36. package/dist/commonSelectors.js +8 -8
  37. package/dist/constants.cjs +2 -1
  38. package/dist/constants.cjs.map +1 -1
  39. package/dist/constants.js +1 -1
  40. package/dist/deploymentsSlice/constants.js +1 -1
  41. package/dist/deploymentsSlice/index.js +1 -1
  42. package/dist/deploymentsSlice/mocks.js +1 -1
  43. package/dist/deploymentsSlice/selectors.js +1 -1
  44. package/dist/deploymentsSlice/thunks.cjs +18 -8
  45. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  46. package/dist/deploymentsSlice/thunks.js +16 -16
  47. package/dist/devicesSlice/constants.js +1 -1
  48. package/dist/devicesSlice/index.cjs +7 -3
  49. package/dist/devicesSlice/index.cjs.map +1 -1
  50. package/dist/devicesSlice/index.d.cts +4 -4
  51. package/dist/devicesSlice/index.d.ts +4 -4
  52. package/dist/devicesSlice/index.js +2 -2
  53. package/dist/devicesSlice/mocks.cjs +8 -4
  54. package/dist/devicesSlice/mocks.cjs.map +1 -1
  55. package/dist/devicesSlice/mocks.d.cts +5 -1
  56. package/dist/devicesSlice/mocks.d.ts +5 -1
  57. package/dist/devicesSlice/mocks.js +3 -3
  58. package/dist/devicesSlice/mocks.js.map +1 -1
  59. package/dist/devicesSlice/selectors.cjs +12 -5
  60. package/dist/devicesSlice/selectors.cjs.map +1 -1
  61. package/dist/devicesSlice/selectors.d.cts +310 -3
  62. package/dist/devicesSlice/selectors.d.ts +310 -3
  63. package/dist/devicesSlice/selectors.js +6 -4
  64. package/dist/devicesSlice/thunks.cjs +20 -10
  65. package/dist/devicesSlice/thunks.cjs.map +1 -1
  66. package/dist/devicesSlice/thunks.d.cts +5 -5
  67. package/dist/devicesSlice/thunks.d.ts +5 -5
  68. package/dist/devicesSlice/thunks.js +18 -18
  69. package/dist/liststatehook.js +1 -1
  70. package/dist/locationutils.js +1 -1
  71. package/dist/monitorSlice/index.js +1 -1
  72. package/dist/monitorSlice/mocks.js +1 -1
  73. package/dist/monitorSlice/thunks.cjs +16 -6
  74. package/dist/monitorSlice/thunks.cjs.map +1 -1
  75. package/dist/monitorSlice/thunks.js +14 -14
  76. package/dist/onboardingSlice/thunks.cjs +18 -8
  77. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  78. package/dist/onboardingSlice/thunks.js +16 -16
  79. package/dist/organizationSlice/constants.js +1 -1
  80. package/dist/organizationSlice/index.js +1 -1
  81. package/dist/organizationSlice/mocks.js +1 -1
  82. package/dist/organizationSlice/selectors.js +1 -1
  83. package/dist/organizationSlice/thunks.cjs +20 -10
  84. package/dist/organizationSlice/thunks.cjs.map +1 -1
  85. package/dist/organizationSlice/thunks.d.cts +3 -3
  86. package/dist/organizationSlice/thunks.d.ts +3 -3
  87. package/dist/organizationSlice/thunks.js +16 -16
  88. package/dist/releasesSlice/index.js +1 -1
  89. package/dist/releasesSlice/mocks.js +1 -1
  90. package/dist/releasesSlice/selectors.js +3 -3
  91. package/dist/releasesSlice/thunks.cjs +16 -6
  92. package/dist/releasesSlice/thunks.cjs.map +1 -1
  93. package/dist/releasesSlice/thunks.js +14 -14
  94. package/dist/selectors.cjs +13 -5
  95. package/dist/selectors.cjs.map +1 -1
  96. package/dist/selectors.d.cts +1 -1
  97. package/dist/selectors.d.ts +1 -1
  98. package/dist/selectors.js +26 -24
  99. package/dist/sockethook.cjs.map +1 -1
  100. package/dist/sockethook.js +1 -1
  101. package/dist/sockethook.js.map +1 -1
  102. package/dist/store.cjs +7 -3
  103. package/dist/store.cjs.map +1 -1
  104. package/dist/store.js +6 -6
  105. package/dist/storehooks.cjs +29 -16
  106. package/dist/storehooks.cjs.map +1 -1
  107. package/dist/storehooks.js +27 -24
  108. package/dist/storehooks.js.map +1 -1
  109. package/dist/thunks.cjs +22 -12
  110. package/dist/thunks.cjs.map +1 -1
  111. package/dist/thunks.d.cts +1 -1
  112. package/dist/thunks.d.ts +1 -1
  113. package/dist/thunks.js +18 -18
  114. package/dist/useDeploymentDevice.cjs +18 -8
  115. package/dist/useDeploymentDevice.cjs.map +1 -1
  116. package/dist/useDeploymentDevice.js +17 -17
  117. package/dist/usersSlice/constants.js +1 -1
  118. package/dist/usersSlice/index.js +1 -1
  119. package/dist/usersSlice/mocks.js +1 -1
  120. package/dist/usersSlice/selectors.cjs +1 -0
  121. package/dist/usersSlice/selectors.cjs.map +1 -1
  122. package/dist/usersSlice/selectors.js +3 -3
  123. package/dist/usersSlice/thunks.cjs +18 -8
  124. package/dist/usersSlice/thunks.cjs.map +1 -1
  125. package/dist/usersSlice/thunks.js +16 -16
  126. package/dist/utils.cjs +1 -0
  127. package/dist/utils.cjs.map +1 -1
  128. package/dist/utils.js +2 -2
  129. package/package.json +7 -7
  130. package/dist/chunk-IY3OCILF.js.map +0 -1
  131. package/dist/chunk-KQ6AGXRK.js.map +0 -1
  132. package/dist/chunk-N3XU7WJM.js.map +0 -1
  133. package/dist/chunk-UVYRVFZX.js.map +0 -1
  134. /package/dist/{chunk-DJXS3LMY.js.map → chunk-2KT4PX3H.js.map} +0 -0
  135. /package/dist/{chunk-RJKAD2TK.js.map → chunk-2S4DM4MI.js.map} +0 -0
  136. /package/dist/{chunk-Z5TDXPYZ.js.map → chunk-7QKCBSFU.js.map} +0 -0
  137. /package/dist/{chunk-H5YHKATI.js.map → chunk-GGBE6KJV.js.map} +0 -0
  138. /package/dist/{chunk-2TYNHR66.js.map → chunk-GX2TWNLC.js.map} +0 -0
  139. /package/dist/{chunk-IURSNZM7.js.map → chunk-J5KNRQFA.js.map} +0 -0
  140. /package/dist/{chunk-FCHMFLKB.js.map → chunk-YYA5MPLL.js.map} +0 -0
  141. /package/dist/{chunk-EF4FYV4X.js.map → chunk-ZK2CPOZO.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listItemMapper
3
- } from "./chunk-2TYNHR66.js";
3
+ } from "./chunk-GX2TWNLC.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-H5YHKATI.js.map
44
+ //# sourceMappingURL=chunk-GGBE6KJV.js.map
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-2DYA3X77.js";
17
17
  import {
18
18
  DARK_MODE
19
- } from "./chunk-N3XU7WJM.js";
19
+ } from "./chunk-OWWCFJZ5.js";
20
20
 
21
21
  // src/utils.ts
22
22
  import { duplicateFilter, yes } from "@northern.tech/utils/helpers";
@@ -233,4 +233,4 @@ export {
233
233
  isDarkMode,
234
234
  parseSubscriptionPreview
235
235
  };
236
- //# sourceMappingURL=chunk-2TYNHR66.js.map
236
+ //# sourceMappingURL=chunk-GX2TWNLC.js.map
@@ -2,26 +2,26 @@ import {
2
2
  commonErrorFallback,
3
3
  commonErrorHandler,
4
4
  createAppAsyncThunk
5
- } from "./chunk-DJXS3LMY.js";
5
+ } from "./chunk-2KT4PX3H.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-FCHMFLKB.js";
11
+ } from "./chunk-YYA5MPLL.js";
12
12
  import {
13
13
  actions,
14
14
  sliceName
15
15
  } from "./chunk-HLX5L3IM.js";
16
16
  import {
17
17
  getSearchEndpoint
18
- } from "./chunk-RJKAD2TK.js";
18
+ } from "./chunk-2S4DM4MI.js";
19
19
  import {
20
20
  getDeviceFilters
21
- } from "./chunk-UVYRVFZX.js";
21
+ } from "./chunk-SE22RKCE.js";
22
22
  import {
23
23
  convertDeviceListStateToFilters
24
- } from "./chunk-2TYNHR66.js";
24
+ } from "./chunk-GX2TWNLC.js";
25
25
  import {
26
26
  DEVICE_LIST_DEFAULTS,
27
27
  TIMEOUTS,
@@ -107,4 +107,4 @@ export {
107
107
  getDeviceMonitorConfig,
108
108
  changeNotificationSetting
109
109
  };
110
- //# sourceMappingURL=chunk-IURSNZM7.js.map
110
+ //# sourceMappingURL=chunk-J5KNRQFA.js.map
@@ -1,5 +1,6 @@
1
1
  // src/appSlice/constants.ts
2
2
  import { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from "@mui/icons-material";
3
+ import { yes as yesUtil } from "@northern.tech/utils";
3
4
  var startingDeviceCount = {
4
5
  os: "for first 50 devices",
5
6
  professional: "for first 250 devices"
@@ -129,7 +130,7 @@ var BENEFITS = {
129
130
  },
130
131
  default: { id: "default", benefit: "gain access to this feature", requiredPlan: PLANS.enterprise.id }
131
132
  };
132
- var yes = () => true;
133
+ var yes = yesUtil;
133
134
  var canAccess = yes;
134
135
  var DARK_MODE = "dark";
135
136
  var LIGHT_MODE = "light";
@@ -149,4 +150,4 @@ export {
149
150
  DARK_MODE,
150
151
  LIGHT_MODE
151
152
  };
152
- //# sourceMappingURL=chunk-N3XU7WJM.js.map
153
+ //# sourceMappingURL=chunk-OWWCFJZ5.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: 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: 50,\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: 250,\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: 1000,\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,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,EAClI,eAAe,EAAE,IAAI,iBAAiB,SAAS,mDAAmD,cAAc,MAAM,WAAW,GAAG;AAAA,EACpI,eAAe,EAAE,IAAI,iBAAiB,SAAS,mEAAmE,cAAc,MAAM,aAAa,GAAG;AAAA,EACtJ,SAAS,EAAE,IAAI,WAAW,SAAS,gEAAgE,eAAe,MAAM,aAAa,GAAG;AAAA,EACxI,mBAAmB;AAAA,IACjB,IAAI;AAAA,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":[]}
@@ -57,7 +57,11 @@ var initialState = {
57
57
  // { items: [{ key: "someKey", count: 42 }], otherCount: 123, total: <otherCount + itemsCount> }
58
58
  ],
59
59
  total: 0,
60
- limit: 0,
60
+ limits: {
61
+ standard: 0,
62
+ micro: 0,
63
+ system: 0
64
+ },
61
65
  groups: {
62
66
  byId: {
63
67
  // groupName: { deviceIds: [], total: 0, filters: [] },
@@ -163,8 +167,8 @@ var devicesSlice = createSlice({
163
167
  const { count, status } = action.payload;
164
168
  state.byStatus[status].total = count;
165
169
  },
166
- setDeviceLimit: (state, action) => {
167
- state.limit = action.payload;
170
+ setDeviceLimits: (state, action) => {
171
+ state.limits = action.payload;
168
172
  },
169
173
  receivedDevice: (state, action) => {
170
174
  state.byId[action.payload.id] = {
@@ -193,4 +197,4 @@ export {
193
197
  actions,
194
198
  devicesSlice_default
195
199
  };
196
- //# sourceMappingURL=chunk-KQ6AGXRK.js.map
200
+ //# sourceMappingURL=chunk-REZWSU22.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/devicesSlice/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 {\n Device as BackendDeviceAuth,\n ConnectionState,\n DeviceConfiguration,\n DeviceState,\n DeviceTierLimits,\n MonitorConfiguration,\n SortCriteria,\n Status\n} from '@northern.tech/types/MenderTypes';\n// @ts-nocheck\nimport { deepCompare, duplicateFilter } from '@northern.tech/utils/helpers';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { ALL_DEVICE_STATES, DeviceIssueOptionKey, FilterOperator, SortOptions } from '../constants';\nimport { DEVICE_LIST_DEFAULTS, DEVICE_STATES, SORTING_OPTIONS } from '../constants';\nimport type { DeviceDeployment } from '../deploymentsSlice';\nimport type { DeviceAuthState } from './constants';\n\nexport const sliceName = 'devices';\nexport type DeviceSelectedAttribute = { attribute: string; scope: string };\nexport type DeviceListState = {\n detailsTab: string;\n deviceIds: string[];\n isLoading: boolean;\n open?: boolean;\n page: number;\n perPage: number;\n refreshTrigger: boolean;\n selectedAttributes: DeviceSelectedAttribute[];\n selectedId?: string;\n selectedIssues: DeviceIssueOptionKey[];\n selection: number[];\n setOnly?: boolean;\n sort: SortOptions & Partial<SortCriteria>;\n state?: DeviceAuthState | typeof ALL_DEVICE_STATES;\n total: number;\n};\ntype DeviceReport = {\n items: { count: number; key: string }[];\n otherCount: number;\n total: number;\n};\nexport type DeviceGroup = { deviceIds?: string[]; filters?: DeviceFilter[]; id?: string; total?: number };\nexport type InventoryAttributes = {\n [key: string]: string | string[];\n artifact_name: string;\n device_type: string[];\n};\n\n// based on the api docs the Record values might be even: \"Supported types: number, string, array of numbers, array of strings\" - but I guess \"string\" or \"string | sting[]\" should be good enough\ntype UiDeviceAttributes = {\n attributes: InventoryAttributes;\n identity?: Record<string, string>;\n monitor?: Record<string, string>;\n system: Record<string, string>;\n tags?: Record<string, string>;\n};\n\nexport type Device = BackendDeviceAuth &\n UiDeviceAttributes & {\n check_in_time_exact?: string;\n check_in_time_rounded?: string;\n config?: DeviceConfiguration;\n connect_status?: ConnectionState['status'];\n connect_updated_ts?: string;\n deploymentsCount?: number;\n deviceDeployments?: DeviceDeployment;\n etag?: string;\n gatewayIds?: string[];\n group?: string;\n id: string;\n isNew?: boolean;\n isOffline?: boolean;\n monitors?: MonitorConfiguration[];\n status: Status;\n twinsByIntegration?: Record<string, DeviceState & { twinError?: string }>;\n };\nexport type DeviceFilter = {\n key: string;\n operator: FilterOperator;\n scope: string;\n value: string | string[];\n};\ntype FilteringAttributes = {\n identityAttributes: string[];\n inventoryAttributes: string[];\n systemAttributes: string[];\n tagAttributes: string[];\n};\ntype FilteringAttributesConfig = {\n attributes: Record<string, string[]>;\n count: number;\n limit: number;\n};\nexport type DeviceStatus = DeviceAuthState | 'active' | 'inactive';\n\nexport type DeviceGroups = {\n byId: Record<string, DeviceGroup>;\n selectedGroup?: string;\n};\nexport type DeviceSliceType = {\n byId: Record<string, Device>;\n byStatus: Record<DeviceStatus, { deviceIds: string[]; total: number }>;\n deviceList: DeviceListState;\n filteringAttributes: FilteringAttributes;\n filteringAttributesConfig: FilteringAttributesConfig;\n filteringAttributesLimit: number;\n filters: DeviceFilter[];\n groups: DeviceGroups;\n limits: DeviceTierLimits;\n reports: DeviceReport[];\n total: number;\n};\nexport const initialState: DeviceSliceType = {\n byId: {\n // [deviceId]: {\n // ...,\n // twinsByIntegration: { [external.provider.id]: twinData }\n // }\n },\n byStatus: {\n [DEVICE_STATES.accepted]: { deviceIds: [], total: 0 },\n active: { deviceIds: [], total: 0 },\n inactive: { deviceIds: [], total: 0 },\n [DEVICE_STATES.pending]: { deviceIds: [], total: 0 },\n [DEVICE_STATES.preauth]: { deviceIds: [], total: 0 },\n [DEVICE_STATES.rejected]: { deviceIds: [], total: 0 }\n },\n deviceList: {\n deviceIds: [],\n ...DEVICE_LIST_DEFAULTS,\n selectedAttributes: [],\n selectedIssues: [],\n selection: [],\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n },\n state: DEVICE_STATES.accepted,\n total: 0,\n refreshTrigger: false,\n isLoading: false,\n detailsTab: '',\n open: false\n },\n filters: [\n // { key: 'device_type', value: 'raspberry', operator: '$eq', scope: 'inventory' }\n ],\n filteringAttributes: { identityAttributes: [], inventoryAttributes: [], systemAttributes: [], tagAttributes: [] },\n filteringAttributesLimit: 10,\n filteringAttributesConfig: {\n attributes: {\n // inventory: ['some_attribute']\n },\n count: 0,\n limit: 100\n },\n reports: [\n // { items: [{ key: \"someKey\", count: 42 }], otherCount: 123, total: <otherCount + itemsCount> }\n ],\n total: 0,\n limits: {\n standard: 0,\n micro: 0,\n system: 0\n },\n groups: {\n byId: {\n // groupName: { deviceIds: [], total: 0, filters: [] },\n // dynamo: { deviceIds: [], total: 3, filters: [{ a: 1 }] }\n },\n selectedGroup: undefined\n }\n};\n\nexport const devicesSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receivedGroups: (state, action: PayloadAction<Record<string, DeviceGroup>>) => {\n state.groups.byId = action.payload;\n },\n addToGroup: (state, action: PayloadAction<{ deviceIds: string[]; group: string }>) => {\n const { group, deviceIds } = action.payload;\n const maybeExistingGroup = {\n filters: [],\n deviceIds: [],\n ...state.groups.byId[group]\n };\n state.groups.byId[group] = {\n ...maybeExistingGroup,\n deviceIds: [...maybeExistingGroup.deviceIds, ...deviceIds].filter(duplicateFilter),\n total: (maybeExistingGroup.total || 0) + 1\n };\n },\n removeFromGroup: (state, action: PayloadAction<{ deviceIds: string[]; group: string }>) => {\n const { group, deviceIds: removedIds } = action.payload;\n const { deviceIds = [], total = 0, ...maybeExistingGroup } = state.groups.byId[group] || {};\n const changedGroup = {\n ...maybeExistingGroup,\n deviceIds: deviceIds.filter(id => !removedIds.includes(id)),\n total: Math.max(total - removedIds.length, 0)\n };\n if (changedGroup.total || changedGroup.deviceIds.length) {\n state.groups.byId[group] = changedGroup;\n return;\n } else if (state.groups.selectedGroup === group) {\n state.groups.selectedGroup = undefined;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [group]: removal, ...remainingById } = state.groups.byId;\n state.groups.byId = remainingById;\n },\n addGroup: (state, action: PayloadAction<{ group: DeviceGroup; groupName: string }>) => {\n const { groupName, group } = action.payload;\n state.groups.byId[groupName] = {\n ...state.groups.byId[groupName],\n ...group\n };\n },\n selectGroup: (state, { payload: group }: PayloadAction<string | undefined>) => {\n state.deviceList.deviceIds =\n group && state.groups.byId[group] && state.groups.byId[group].deviceIds && state.groups.byId[group].deviceIds.length > 0\n ? state.groups.byId[group].deviceIds\n : [];\n state.groups.selectedGroup = group;\n },\n removeGroup: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: removal, ...remainingById } = state.groups.byId;\n state.groups.byId = remainingById;\n state.groups.selectedGroup = state.groups.selectedGroup === action.payload ? undefined : state.groups.selectedGroup;\n },\n setDeviceListState: (state, action: PayloadAction<Partial<DeviceListState>>) => {\n state.deviceList = {\n ...state.deviceList,\n ...action.payload,\n sort: {\n ...state.deviceList.sort,\n ...action.payload.sort\n }\n };\n },\n setFilterAttributes: (state, action: PayloadAction<FilteringAttributes>) => {\n state.filteringAttributes = action.payload;\n },\n setFilterablesConfig: (state, action: PayloadAction<FilteringAttributesConfig>) => {\n state.filteringAttributesConfig = action.payload;\n },\n receivedDevices: (state, action: PayloadAction<Record<string, Device>>) => {\n state.byId = {\n ...state.byId,\n ...action.payload\n };\n },\n setDeviceFilters: (state, action: PayloadAction<DeviceFilter[]>) => {\n if (deepCompare(action.payload, state.filters)) {\n return;\n }\n state.filters = action.payload.filter(filter => filter.key && filter.operator && filter.scope && typeof filter.value !== 'undefined');\n },\n setInactiveDevices: (state, action: PayloadAction<{ activeDeviceTotal: number; inactiveDeviceTotal: number }>) => {\n const { activeDeviceTotal, inactiveDeviceTotal } = action.payload;\n state.byStatus.active.total = activeDeviceTotal;\n state.byStatus.inactive.total = inactiveDeviceTotal;\n },\n setDeviceReports: (state, action: PayloadAction<DeviceReport[]>) => {\n state.reports = action.payload;\n },\n setDevicesByStatus: (state, action: PayloadAction<{ deviceIds: string[]; forceUpdate?: boolean; status: DeviceStatus; total: number }>) => {\n const { forceUpdate, status, total, deviceIds } = action.payload;\n state.byStatus[status] = total || forceUpdate ? { deviceIds, total } : state.byStatus[status];\n },\n setDevicesCountByStatus: (state, action: PayloadAction<{ count: number; status: DeviceStatus }>) => {\n const { count, status } = action.payload;\n state.byStatus[status].total = count;\n },\n setDeviceLimits: (state, action: PayloadAction<DeviceTierLimits>) => {\n state.limits = action.payload;\n },\n receivedDevice: (state, action: PayloadAction<{ id: string } & Partial<Device>>) => {\n state.byId[action.payload.id] = {\n ...state.byId[action.payload.id],\n ...action.payload\n };\n },\n maybeUpdateDevicesByStatus: (state, action: PayloadAction<{ authId?: string; deviceId: string }>) => {\n const { deviceId, authId } = action.payload;\n const device = state.byId[deviceId];\n const hasMultipleAuthSets = authId && device.auth_sets ? device.auth_sets.filter(authset => authset.id !== authId).length > 0 : false;\n if (!hasMultipleAuthSets && (Object.values(DEVICE_STATES) as string[]).includes(device.status)) {\n const deviceIds = state.byStatus[device.status].deviceIds.filter(id => id !== deviceId);\n state.byStatus[device.status] = { deviceIds, total: Math.max(0, state.byStatus[device.status].total - 1) };\n }\n }\n }\n});\n\nexport const actions = devicesSlice.actions;\nexport default devicesSlice.reducer;\n"],"mappings":";;;;;;;AAwBA,SAAS,aAAa,uBAAuB;AAE7C,SAAS,mBAAmB;AAOrB,IAAM,YAAY;AA+FlB,IAAM,eAAgC;AAAA,EAC3C,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,EAKN;AAAA,EACA,UAAU;AAAA,IACR,CAAC,cAAc,QAAQ,GAAG,EAAE,WAAW,CAAC,GAAG,OAAO,EAAE;AAAA,IACpD,QAAQ,EAAE,WAAW,CAAC,GAAG,OAAO,EAAE;AAAA,IAClC,UAAU,EAAE,WAAW,CAAC,GAAG,OAAO,EAAE;AAAA,IACpC,CAAC,cAAc,OAAO,GAAG,EAAE,WAAW,CAAC,GAAG,OAAO,EAAE;AAAA,IACnD,CAAC,cAAc,OAAO,GAAG,EAAE,WAAW,CAAC,GAAG,OAAO,EAAE;AAAA,IACnD,CAAC,cAAc,QAAQ,GAAG,EAAE,WAAW,CAAC,GAAG,OAAO,EAAE;AAAA,EACtD;AAAA,EACA,YAAY;AAAA,IACV,WAAW,CAAC;AAAA,IACZ,GAAG;AAAA,IACH,oBAAoB,CAAC;AAAA,IACrB,gBAAgB,CAAC;AAAA,IACjB,WAAW,CAAC;AAAA,IACZ,MAAM;AAAA,MACJ,WAAW,gBAAgB;AAAA;AAAA;AAAA,IAG7B;AAAA,IACA,OAAO,cAAc;AAAA,IACrB,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,MAAM;AAAA,EACR;AAAA,EACA,SAAS;AAAA;AAAA,EAET;AAAA,EACA,qBAAqB,EAAE,oBAAoB,CAAC,GAAG,qBAAqB,CAAC,GAAG,kBAAkB,CAAC,GAAG,eAAe,CAAC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AG,MAAM,KAAK,OAAO,QAAQ,EAAE;AAAA,QAC/B,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,4BAA4B,CAAC,OAAO,WAAiE;AACnG,YAAM,EAAE,UAAU,OAAO,IAAI,OAAO;AACpC,YAAM,SAAS,MAAM,KAAK,QAAQ;AAClC,YAAM,sBAAsB,UAAU,OAAO,YAAY,OAAO,UAAU,OAAO,aAAW,QAAQ,OAAO,MAAM,EAAE,SAAS,IAAI;AAChI,UAAI,CAAC,uBAAwB,OAAO,OAAO,aAAa,EAAe,SAAS,OAAO,MAAM,GAAG;AAC9F,cAAM,YAAY,MAAM,SAAS,OAAO,MAAM,EAAE,UAAU,OAAO,QAAM,OAAO,QAAQ;AACtF,cAAM,SAAS,OAAO,MAAM,IAAI,EAAE,WAAW,OAAO,KAAK,IAAI,GAAG,MAAM,SAAS,OAAO,MAAM,EAAE,QAAQ,CAAC,EAAE;AAAA,MAC3G;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,aAAa;AACpC,IAAO,uBAAQ,aAAa;","names":[]}
@@ -21,7 +21,7 @@ var getSortedFilteringAttributes = createSelector([getFilteringAttributes], (fil
21
21
  ...filteringAttributes,
22
22
  identityAttributes: [...filteringAttributes.identityAttributes, "id"]
23
23
  }));
24
- var getDeviceLimit = (state) => state.devices.limit;
24
+ var getDeviceLimits = (state) => state.devices.limits;
25
25
  var getFilteringAttributesLimit = (state) => state.devices.filteringAttributesLimit;
26
26
  var getDeviceIdentityAttributes = createSelector(
27
27
  [getFilteringAttributes, getFilteringAttributesLimit],
@@ -59,9 +59,14 @@ var getSelectedGroupInfo = createSelector(
59
59
  return { groupCount, selectedGroup, groupFilters };
60
60
  }
61
61
  );
62
+ var getCombinedLimit = createSelector(
63
+ [getDeviceLimits],
64
+ (deviceLimits) => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0)
65
+ // limit might be -1 for unlimited devices
66
+ );
62
67
  var getLimitMaxed = createSelector(
63
- [getAcceptedDevices, getDeviceLimit],
64
- ({ total: acceptedDevices = 0 }, deviceLimit) => Boolean(deviceLimit && deviceLimit <= acceptedDevices)
68
+ [getAcceptedDevices, getCombinedLimit],
69
+ ({ total: acceptedDevices = 0 }, combinedLimit) => combinedLimit <= acceptedDevices
65
70
  );
66
71
  var getGroupsByIdWithoutUngrouped = createSelector([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
67
72
  var getGroupData = createSelector([getGroupsByIdWithoutUngrouped], (groups) => {
@@ -122,11 +127,12 @@ export {
122
127
  getFilteringAttributes,
123
128
  getDeviceFilters,
124
129
  getSortedFilteringAttributes,
125
- getDeviceLimit,
130
+ getDeviceLimits,
126
131
  getDeviceIdentityAttributes,
127
132
  getDeviceCountsByStatus,
128
133
  getDeviceById,
129
134
  getSelectedGroupInfo,
135
+ getCombinedLimit,
130
136
  getLimitMaxed,
131
137
  getGroupsByIdWithoutUngrouped,
132
138
  getGroupData,
@@ -134,4 +140,4 @@ export {
134
140
  getAttributesList,
135
141
  getDeviceTypes
136
142
  };
137
- //# sourceMappingURL=chunk-UVYRVFZX.js.map
143
+ //# sourceMappingURL=chunk-SE22RKCE.js.map
@@ -0,0 +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 { 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((accu, state) => {\n accu[state] = byStatus[state].total || 0;\n return accu;\n }, {})\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getAcceptedDevices, getGroupsById, getSelectedGroup],\n ({ total: 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 [getAcceptedDevices, getCombinedLimit],\n ({ total: acceptedDevices = 0 }, 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;AAMxB,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,+B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.js";
8
+ actions as actions6
9
+ } from "./chunk-QOFVCPRW.js";
10
10
  import {
11
11
  actions as actions4
12
12
  } from "./chunk-HLX5L3IM.js";
13
- import {
14
- actions as actions6
15
- } from "./chunk-QOFVCPRW.js";
16
13
  import {
17
14
  actions as actions5
18
15
  } from "./chunk-VANBSJS5.js";
16
+ import {
17
+ actions as actions3
18
+ } from "./chunk-REZWSU22.js";
19
19
  import {
20
20
  actions
21
21
  } from "./chunk-OFGCC3GM.js";
22
22
  import {
23
- actions as actions3
24
- } from "./chunk-KQ6AGXRK.js";
23
+ actions as actions2
24
+ } from "./chunk-C2LGE3P6.js";
25
25
 
26
26
  // src/actions.ts
27
27
  var actions_default = {
@@ -38,4 +38,4 @@ var actions_default = {
38
38
  export {
39
39
  actions_default
40
40
  };
41
- //# sourceMappingURL=chunk-FCHMFLKB.js.map
41
+ //# sourceMappingURL=chunk-YYA5MPLL.js.map
@@ -2,13 +2,13 @@ import {
2
2
  commonErrorFallback,
3
3
  commonErrorHandler,
4
4
  createAppAsyncThunk
5
- } from "./chunk-DJXS3LMY.js";
5
+ } from "./chunk-2KT4PX3H.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-FCHMFLKB.js";
11
+ } from "./chunk-YYA5MPLL.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-RJKAD2TK.js";
21
+ } from "./chunk-2S4DM4MI.js";
22
22
  import {
23
23
  getReleasesById
24
- } from "./chunk-H5YHKATI.js";
24
+ } from "./chunk-GGBE6KJV.js";
25
25
  import {
26
26
  convertDeviceListStateToFilters,
27
27
  progress
28
- } from "./chunk-2TYNHR66.js";
28
+ } from "./chunk-GX2TWNLC.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-EF4FYV4X.js.map
445
+ //# sourceMappingURL=chunk-ZK2CPOZO.js.map
@@ -14,7 +14,7 @@ import {
14
14
  import "./chunk-2DYA3X77.js";
15
15
  import "./chunk-FAJ3I2UQ.js";
16
16
  import "./chunk-ZKAH3APE.js";
17
- import "./chunk-N3XU7WJM.js";
17
+ import "./chunk-OWWCFJZ5.js";
18
18
  export {
19
19
  DEVICE_LIST_MAXIMUM_LENGTH,
20
20
  DEVICE_ONLINE_CUTOFF,
@@ -45,6 +45,7 @@ var import_toolkit7 = require("@reduxjs/toolkit");
45
45
 
46
46
  // src/appSlice/constants.ts
47
47
  var import_icons_material = require("@mui/icons-material");
48
+ var import_utils = require("@northern.tech/utils");
48
49
  var startingDeviceCount = {
49
50
  os: "for first 50 devices",
50
51
  professional: "for first 250 devices"
@@ -762,7 +763,7 @@ var getSortedFilteringAttributes = (0, import_toolkit3.createSelector)([getFilte
762
763
  ...filteringAttributes,
763
764
  identityAttributes: [...filteringAttributes.identityAttributes, "id"]
764
765
  }));
765
- var getDeviceLimit = (state) => state.devices.limit;
766
+ var getDeviceLimits = (state) => state.devices.limits;
766
767
  var getFilteringAttributesLimit = (state) => state.devices.filteringAttributesLimit;
767
768
  var getDeviceIdentityAttributes = (0, import_toolkit3.createSelector)(
768
769
  [getFilteringAttributes, getFilteringAttributesLimit],
@@ -800,9 +801,14 @@ var getSelectedGroupInfo = (0, import_toolkit3.createSelector)(
800
801
  return { groupCount, selectedGroup, groupFilters };
801
802
  }
802
803
  );
804
+ var getCombinedLimit = (0, import_toolkit3.createSelector)(
805
+ [getDeviceLimits],
806
+ (deviceLimits) => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0)
807
+ // limit might be -1 for unlimited devices
808
+ );
803
809
  var getLimitMaxed = (0, import_toolkit3.createSelector)(
804
- [getAcceptedDevices, getDeviceLimit],
805
- ({ total: acceptedDevices = 0 }, deviceLimit) => Boolean(deviceLimit && deviceLimit <= acceptedDevices)
810
+ [getAcceptedDevices, getCombinedLimit],
811
+ ({ total: acceptedDevices = 0 }, combinedLimit) => combinedLimit <= acceptedDevices
806
812
  );
807
813
  var getGroupsByIdWithoutUngrouped = (0, import_toolkit3.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
808
814
  var getGroupData = (0, import_toolkit3.createSelector)([getGroupsByIdWithoutUngrouped], (groups) => {