@northern.tech/store 0.19.1 → 0.20.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 (151) hide show
  1. package/dist/actions.cjs +3 -0
  2. package/dist/actions.cjs.map +1 -1
  3. package/dist/actions.d.cts +2 -1
  4. package/dist/actions.d.ts +2 -1
  5. package/dist/actions.js +6 -6
  6. package/dist/api/general-api.js +2 -2
  7. package/dist/api/users-api.js +2 -2
  8. package/dist/appSlice/constants.cjs +11 -49
  9. package/dist/appSlice/constants.cjs.map +1 -1
  10. package/dist/appSlice/constants.d.cts +1 -16
  11. package/dist/appSlice/constants.d.ts +1 -16
  12. package/dist/appSlice/constants.js +1 -1
  13. package/dist/appSlice/index.js +2 -2
  14. package/dist/appSlice/mocks.js +2 -2
  15. package/dist/appSlice/thunks.cjs +30 -60
  16. package/dist/appSlice/thunks.cjs.map +1 -1
  17. package/dist/appSlice/thunks.js +17 -17
  18. package/dist/auth.js +2 -2
  19. package/dist/{chunk-QFYYTAYD.js → chunk-3JBVI4UH.js} +9 -9
  20. package/dist/{chunk-QL6FN2JC.js → chunk-4ZYLGBJU.js} +2 -2
  21. package/dist/{chunk-U5TPV5X5.js → chunk-7WIISD2N.js} +17 -14
  22. package/dist/{chunk-U5TPV5X5.js.map → chunk-7WIISD2N.js.map} +1 -1
  23. package/dist/{chunk-FUGCLQ5L.js → chunk-AY7E7VA6.js} +102 -28
  24. package/dist/chunk-AY7E7VA6.js.map +1 -0
  25. package/dist/{chunk-EL672W25.js → chunk-DBBE6D36.js} +12 -50
  26. package/dist/chunk-DBBE6D36.js.map +1 -0
  27. package/dist/{chunk-GBXG2XBY.js → chunk-E657OJL4.js} +6 -6
  28. package/dist/{chunk-MZ5NRW3K.js → chunk-FXKMYYK5.js} +17 -17
  29. package/dist/{chunk-KJHHSYGP.js → chunk-P3N2J3QT.js} +10 -10
  30. package/dist/{chunk-GEQ2QQEE.js → chunk-PL6RIFD5.js} +2 -2
  31. package/dist/{chunk-VCEFZTWS.js → chunk-TIL2S3JA.js} +4 -1
  32. package/dist/chunk-TIL2S3JA.js.map +1 -0
  33. package/dist/{chunk-C3EMLDPU.js → chunk-V6BWOIRC.js} +6 -6
  34. package/dist/{chunk-O7DR57RN.js → chunk-ZGRY42BZ.js} +9 -12
  35. package/dist/{chunk-O7DR57RN.js.map → chunk-ZGRY42BZ.js.map} +1 -1
  36. package/dist/{chunk-3NOV7X4M.js → chunk-ZZQJWNQT.js} +3 -1
  37. package/dist/chunk-ZZQJWNQT.js.map +1 -0
  38. package/dist/commonConstants.js +2 -2
  39. package/dist/commonSelectors.cjs +19 -60
  40. package/dist/commonSelectors.cjs.map +1 -1
  41. package/dist/commonSelectors.js +9 -9
  42. package/dist/constants.cjs +11 -49
  43. package/dist/constants.cjs.map +1 -1
  44. package/dist/constants.js +2 -2
  45. package/dist/deploymentsSlice/constants.js +2 -2
  46. package/dist/deploymentsSlice/index.js +2 -2
  47. package/dist/deploymentsSlice/mocks.js +2 -2
  48. package/dist/deploymentsSlice/selectors.js +2 -2
  49. package/dist/deploymentsSlice/thunks.cjs +30 -60
  50. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  51. package/dist/deploymentsSlice/thunks.js +17 -17
  52. package/dist/devicesSlice/constants.js +2 -2
  53. package/dist/devicesSlice/index.js +2 -2
  54. package/dist/devicesSlice/mocks.js +2 -2
  55. package/dist/devicesSlice/selectors.cjs +8 -11
  56. package/dist/devicesSlice/selectors.cjs.map +1 -1
  57. package/dist/devicesSlice/selectors.js +3 -3
  58. package/dist/devicesSlice/thunks.cjs +32 -60
  59. package/dist/devicesSlice/thunks.cjs.map +1 -1
  60. package/dist/devicesSlice/thunks.d.cts +41 -3
  61. package/dist/devicesSlice/thunks.d.ts +41 -3
  62. package/dist/devicesSlice/thunks.js +19 -17
  63. package/dist/liststatehook.js +2 -2
  64. package/dist/locationutils.js +2 -2
  65. package/dist/monitorSlice/index.js +2 -2
  66. package/dist/monitorSlice/mocks.js +2 -2
  67. package/dist/monitorSlice/thunks.cjs +22 -60
  68. package/dist/monitorSlice/thunks.cjs.map +1 -1
  69. package/dist/monitorSlice/thunks.js +15 -15
  70. package/dist/onboardingSlice/thunks.cjs +30 -60
  71. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  72. package/dist/onboardingSlice/thunks.js +17 -17
  73. package/dist/organizationSlice/constants.js +2 -2
  74. package/dist/organizationSlice/index.cjs +3 -0
  75. package/dist/organizationSlice/index.cjs.map +1 -1
  76. package/dist/organizationSlice/index.d.cts +4 -1
  77. package/dist/organizationSlice/index.d.ts +4 -1
  78. package/dist/organizationSlice/index.js +3 -3
  79. package/dist/organizationSlice/mocks.cjs +175 -0
  80. package/dist/organizationSlice/mocks.cjs.map +1 -1
  81. package/dist/organizationSlice/mocks.d.cts +121 -2
  82. package/dist/organizationSlice/mocks.d.ts +121 -2
  83. package/dist/organizationSlice/mocks.js +88 -3
  84. package/dist/organizationSlice/mocks.js.map +1 -1
  85. package/dist/organizationSlice/selectors.cjs +3 -0
  86. package/dist/organizationSlice/selectors.cjs.map +1 -1
  87. package/dist/organizationSlice/selectors.d.cts +3 -2
  88. package/dist/organizationSlice/selectors.d.ts +3 -2
  89. package/dist/organizationSlice/selectors.js +5 -3
  90. package/dist/organizationSlice/thunks.cjs +113 -75
  91. package/dist/organizationSlice/thunks.cjs.map +1 -1
  92. package/dist/organizationSlice/thunks.d.cts +17 -3
  93. package/dist/organizationSlice/thunks.d.ts +17 -3
  94. package/dist/organizationSlice/thunks.js +23 -19
  95. package/dist/organizationSlice/types.cjs.map +1 -1
  96. package/dist/organizationSlice/types.d.cts +30 -7
  97. package/dist/organizationSlice/types.d.ts +30 -7
  98. package/dist/releasesSlice/index.js +2 -2
  99. package/dist/releasesSlice/mocks.js +2 -2
  100. package/dist/releasesSlice/selectors.cjs.map +1 -1
  101. package/dist/releasesSlice/selectors.js +4 -4
  102. package/dist/releasesSlice/thunks.cjs +22 -60
  103. package/dist/releasesSlice/thunks.cjs.map +1 -1
  104. package/dist/releasesSlice/thunks.js +15 -15
  105. package/dist/selectors.cjs +22 -60
  106. package/dist/selectors.cjs.map +1 -1
  107. package/dist/selectors.d.cts +1 -1
  108. package/dist/selectors.d.ts +1 -1
  109. package/dist/selectors.js +39 -37
  110. package/dist/sockethook.js +2 -2
  111. package/dist/store.cjs +3 -0
  112. package/dist/store.cjs.map +1 -1
  113. package/dist/store.js +7 -7
  114. package/dist/storehooks.cjs +109 -74
  115. package/dist/storehooks.cjs.map +1 -1
  116. package/dist/storehooks.js +24 -22
  117. package/dist/storehooks.js.map +1 -1
  118. package/dist/thunks.cjs +113 -73
  119. package/dist/thunks.cjs.map +1 -1
  120. package/dist/thunks.d.cts +2 -2
  121. package/dist/thunks.d.ts +2 -2
  122. package/dist/thunks.js +23 -17
  123. package/dist/useDeploymentDevice.cjs +30 -60
  124. package/dist/useDeploymentDevice.cjs.map +1 -1
  125. package/dist/useDeploymentDevice.js +19 -19
  126. package/dist/usersSlice/constants.js +2 -2
  127. package/dist/usersSlice/index.js +2 -2
  128. package/dist/usersSlice/mocks.js +2 -2
  129. package/dist/usersSlice/selectors.cjs +11 -49
  130. package/dist/usersSlice/selectors.cjs.map +1 -1
  131. package/dist/usersSlice/selectors.js +4 -4
  132. package/dist/usersSlice/thunks.cjs +30 -60
  133. package/dist/usersSlice/thunks.cjs.map +1 -1
  134. package/dist/usersSlice/thunks.js +17 -17
  135. package/dist/utils.cjs +26 -61
  136. package/dist/utils.cjs.map +1 -1
  137. package/dist/utils.d.cts +1 -3
  138. package/dist/utils.d.ts +1 -3
  139. package/dist/utils.js +3 -3
  140. package/package.json +3 -3
  141. package/dist/chunk-3NOV7X4M.js.map +0 -1
  142. package/dist/chunk-EL672W25.js.map +0 -1
  143. package/dist/chunk-FUGCLQ5L.js.map +0 -1
  144. package/dist/chunk-VCEFZTWS.js.map +0 -1
  145. /package/dist/{chunk-QFYYTAYD.js.map → chunk-3JBVI4UH.js.map} +0 -0
  146. /package/dist/{chunk-QL6FN2JC.js.map → chunk-4ZYLGBJU.js.map} +0 -0
  147. /package/dist/{chunk-GBXG2XBY.js.map → chunk-E657OJL4.js.map} +0 -0
  148. /package/dist/{chunk-MZ5NRW3K.js.map → chunk-FXKMYYK5.js.map} +0 -0
  149. /package/dist/{chunk-KJHHSYGP.js.map → chunk-P3N2J3QT.js.map} +0 -0
  150. /package/dist/{chunk-GEQ2QQEE.js.map → chunk-PL6RIFD5.js.map} +0 -0
  151. /package/dist/{chunk-C3EMLDPU.js.map → chunk-V6BWOIRC.js.map} +0 -0
@@ -50,10 +50,6 @@ var import_constants5 = require("@northern.tech/utils/constants");
50
50
  // src/appSlice/constants.ts
51
51
  var import_icons_material = require("@mui/icons-material");
52
52
  var import_utils = require("@northern.tech/utils");
53
- var startingDeviceCount = {
54
- os: "for first 50 devices",
55
- professional: "for first 250 devices"
56
- };
57
53
  var chartTypes = {
58
54
  bar: { key: "bar", Icon: import_icons_material.BarChart },
59
55
  pie: { key: "pie", Icon: import_icons_material.PieChartOutline }
@@ -70,82 +66,48 @@ var PLANS = {
70
66
  os: {
71
67
  id: "os",
72
68
  name: "Basic",
73
- minimalDeviceCount: { standard: 50, micro: 100 },
74
- offer: true,
75
- price: "$34 / month",
76
- deviceCount: startingDeviceCount.os,
77
- description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan.",
78
- features: ["Access to core features of Mender", "Basic support"]
69
+ description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan."
79
70
  },
80
71
  professional: {
81
72
  id: "professional",
82
73
  name: "Professional",
83
- minimalDeviceCount: { standard: 250, micro: 500 },
84
- offer: true,
85
- price: "$291 / month",
86
- deviceCount: startingDeviceCount.professional,
87
- description: "Everything in Basic, plus enhanced update management and automation features.",
88
- features: ["Advanced OTA features", "Higher priority support"]
74
+ description: "Everything in Basic, plus enhanced update management and automation features."
89
75
  },
90
76
  enterprise: {
91
77
  id: "enterprise",
92
78
  name: "Enterprise",
93
- minimalDeviceCount: { standard: 1e3, micro: 2e3 },
94
- price: "Custom pricing",
95
- deviceCount: "Unlimited devices",
96
- 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.",
97
- features: ["All Mender features", "Advanced security features", "SLA-backed support"]
79
+ 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."
98
80
  }
99
81
  };
100
82
  var ADDONS = {
101
83
  configure: {
102
84
  id: "configure",
103
85
  title: "Configure",
104
- description: "Expand your plan with device configuration features",
86
+ description: "Seamlessly configure applications and devices remotely \u2013 configure each device to its environment.",
105
87
  needs: ["hasDeviceConfig"],
106
- os: {
107
- price: "$11/month",
108
- deviceCount: startingDeviceCount.os
109
- },
110
- professional: {
111
- price: "$65/month",
112
- deviceCount: startingDeviceCount.professional
113
- },
114
88
  eligible: ["os", "professional", "enterprise"]
115
89
  },
116
90
  monitor: {
117
91
  id: "monitor",
118
92
  title: "Monitor",
119
- description: "Expand your plan with device monitoring features",
93
+ description: "Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.",
120
94
  needs: ["hasMonitor"],
121
- os: {
122
- price: "-",
123
- deviceCount: "-"
124
- },
125
- professional: {
126
- price: "$86/month",
127
- deviceCount: startingDeviceCount.professional
128
- },
129
95
  eligible: ["professional", "enterprise"]
130
96
  },
131
97
  troubleshoot: {
132
98
  id: "troubleshoot",
133
99
  title: "Troubleshoot",
134
- description: "Expand your plan with device troubleshooting features",
100
+ description: "Secure, remote access to your devices \u2013 quickly diagnose and fix issues in real time.",
135
101
  needs: ["hasDeviceConnect"],
136
- os: {
137
- price: "$27/month",
138
- deviceCount: startingDeviceCount.os
139
- },
140
- professional: {
141
- price: "$72/month",
142
- deviceCount: startingDeviceCount.professional
143
- },
144
102
  eligible: ["os", "professional", "enterprise"]
145
103
  }
146
104
  };
147
105
  var BENEFITS = {
148
- auditlog: { id: "auditlog", benefit: "trace change across your devices and access troubleshooting session replay", requiredPlan: PLANS.professional.id },
106
+ auditlog: {
107
+ id: "auditlog",
108
+ benefit: "gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays",
109
+ requiredPlan: PLANS.enterprise.id
110
+ },
149
111
  dashboard: { id: "dashboard", benefit: "actionable insights into the devices you are updating with Mender", requiredPlan: PLANS.enterprise.id },
150
112
  deltaGeneration: {
151
113
  id: "deltaGeneration",
@@ -1390,6 +1352,9 @@ var organizationSlice = (0, import_toolkit6.createSlice)({
1390
1352
  setSubscription: (state, action) => {
1391
1353
  state.organization.subscription = { ...state.organization.subscription, ...action.payload };
1392
1354
  },
1355
+ setProducts: (state, action) => {
1356
+ state.products = action.payload;
1357
+ },
1393
1358
  setBillingProfile: (state, action) => {
1394
1359
  state.organization.billing_profile = action.payload;
1395
1360
  },
@@ -1908,17 +1873,14 @@ var getAttributesList = (0, import_toolkit11.createSelector)(
1908
1873
  [getFilteringAttributes, getFilteringAttributesFromConfig],
1909
1874
  ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers3.duplicateFilter)
1910
1875
  );
1911
- var getDeviceLimitStats = (0, import_toolkit11.createSelector)(
1912
- [getDeviceLimits, getAcceptedDevices],
1913
- (limits, accepted) => {
1914
- const { counts } = accepted;
1915
- return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
1916
- type,
1917
- limit,
1918
- total: counts[type] || 0
1919
- }));
1920
- }
1921
- );
1876
+ var getDeviceLimitStats = (0, import_toolkit11.createSelector)([getDeviceLimits, getAcceptedDevices], (limits, accepted) => {
1877
+ const { counts } = accepted;
1878
+ return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
1879
+ type,
1880
+ limit,
1881
+ total: counts[type] || 0
1882
+ }));
1883
+ });
1922
1884
  var getDeviceTypes = (0, import_toolkit11.createSelector)(
1923
1885
  [getAcceptedDevices, getDevicesById],
1924
1886
  ({ deviceIds = [] }, devicesById) => Object.keys(
@@ -2111,18 +2073,21 @@ var mapDeviceAttributes = (attributes = []) => attributes.reduce(
2111
2073
  { inventory: { device_type: [], artifact_name: "" }, identity: {}, monitor: {}, system: {}, tags: {} }
2112
2074
  );
2113
2075
  var isDarkMode = (mode) => mode === DARK_MODE;
2114
- var parseSubscriptionPreview = (lines) => lines.reduce(
2115
- (acc, { addon, amount, product }) => {
2116
- const planId = product.slice("mender_".length);
2117
- if (!addon) {
2118
- acc[planId] = (acc[planId] ?? 0) + amount;
2119
- } else {
2120
- acc.addons[addon] = (acc.addons[addon] ?? 0) + amount;
2121
- }
2122
- return acc;
2123
- },
2124
- { addons: {} }
2125
- );
2076
+ var parseSubscriptionPreview = (lines) => lines.reduce((acc, { addon, amount, product }) => {
2077
+ const tier = product.replace("mender_", "");
2078
+ if (!acc[tier]) {
2079
+ acc[tier] = {
2080
+ amount: 0,
2081
+ addons: {}
2082
+ };
2083
+ }
2084
+ if (!addon) {
2085
+ acc[tier].amount += amount;
2086
+ } else {
2087
+ acc[tier].addons[addon] = (acc[tier].addons[addon] ?? 0) + amount;
2088
+ }
2089
+ return acc;
2090
+ }, {});
2126
2091
 
2127
2092
  // src/releasesSlice/selectors.ts
2128
2093
  var getSelectedReleaseId = (state) => state.releases.selectedRelease;
@@ -3142,11 +3107,18 @@ var addStaticGroup = createAppAsyncThunk(
3142
3107
  )
3143
3108
  ).catch((err) => commonErrorHandler(err, `Group could not be updated:`, dispatch))
3144
3109
  );
3110
+ var removeReportsByGroupName = createAppAsyncThunk(`${sliceName3}/removeReportsByGroupName`, (groupName, { dispatch, getState }) => {
3111
+ if (!groupName) return Promise.resolve();
3112
+ const reports = getDeviceReportsForUser(getState());
3113
+ const filteredReports = reports.filter((report) => report.group !== groupName);
3114
+ dispatch(saveUserSettings({ reports: filteredReports }));
3115
+ });
3145
3116
  var removeStaticGroup = createAppAsyncThunk(
3146
3117
  `${sliceName3}/removeStaticGroup`,
3147
3118
  (groupName, { dispatch }) => general_api_default.delete(`${import_constants5.inventoryApiUrl}/groups/${groupName}`).then(
3148
3119
  () => Promise.all([
3149
3120
  dispatch(actions3.removeGroup(groupName)),
3121
+ dispatch(removeReportsByGroupName(groupName)),
3150
3122
  dispatch(getGroups2()),
3151
3123
  dispatch(setSnackbar3({ message: "Group was removed successfully", autoHideDuration: TIMEOUTS.fiveSeconds }))
3152
3124
  ])
@@ -3212,6 +3184,7 @@ var removeDynamicGroup = createAppAsyncThunk(`${sliceName3}/removeDynamicGroup`,
3212
3184
  return general_api_default.delete(`${import_constants5.inventoryApiUrlV2}/filters/${filterId}`).then(
3213
3185
  () => Promise.all([
3214
3186
  dispatch(actions3.removeGroup(groupName)),
3187
+ dispatch(removeReportsByGroupName(groupName)),
3215
3188
  dispatch(setSnackbar3({ message: "Group was removed successfully", autoHideDuration: TIMEOUTS.fiveSeconds }))
3216
3189
  ])
3217
3190
  );
@@ -4102,6 +4075,63 @@ var cancelRequest = createAppAsyncThunk(`${sliceName6}/cancelRequest`, (reason,
4102
4075
  () => Promise.resolve(dispatch(setSnackbar4({ message: "Deactivation request was sent successfully", autoHideDuration: TIMEOUTS.fiveSeconds })))
4103
4076
  );
4104
4077
  });
4078
+ var getTierId = (tierName) => tierName.replace("mender_", "");
4079
+ var getProductPlans = (products) => products.reduce(
4080
+ (plansById, product) => {
4081
+ const { name, prices } = product;
4082
+ const tierId = getTierId(name);
4083
+ prices.forEach((price) => {
4084
+ const existing = plansById[price.plan] ?? { ...PLANS[price.plan], tierLimitsConstrains: {} };
4085
+ const tierConstraints = price.constraints ? { [tierId]: { min: price.constraints.min, max: price.constraints.max, div: price.constraints.div } } : {};
4086
+ plansById[price.plan] = {
4087
+ ...existing,
4088
+ tierLimitsConstrains: {
4089
+ ...existing.tierLimitsConstrains,
4090
+ ...tierConstraints
4091
+ }
4092
+ };
4093
+ });
4094
+ return plansById;
4095
+ },
4096
+ { enterprise: { ...PLANS.enterprise } }
4097
+ );
4098
+ var getProductAddons = (products) => products.reduce((accu, product) => {
4099
+ const { addons = [] } = product;
4100
+ addons.forEach((addon) => {
4101
+ const { name: addonName = "", prices: addonPrices = [] } = addon;
4102
+ const existingEligible = accu[addonName]?.eligible ?? [];
4103
+ const newEligible = addonPrices.map((p) => p.plan);
4104
+ accu[addonName] = {
4105
+ ...ADDONS[addonName],
4106
+ eligible: [.../* @__PURE__ */ new Set([...existingEligible, ...newEligible, PLANS.enterprise.id])]
4107
+ };
4108
+ });
4109
+ return accu;
4110
+ }, {});
4111
+ var transformProductResponse = (products) => {
4112
+ const tiers = [];
4113
+ const sortedProducts = products.sort((a, b) => a.name.localeCompare(b.name));
4114
+ sortedProducts.forEach((tier) => {
4115
+ const addonsSupported = Object.fromEntries((tier.addons || []).map((addon) => [addon.name, addon.prices?.map((p) => p.plan)]));
4116
+ const allPlans = tier.prices.map((price) => price.plan);
4117
+ const addonsTransposed = allPlans.reduce((acc, plan) => {
4118
+ acc[plan] = Object.entries(addonsSupported).filter(([, addonSupportedPlans]) => addonSupportedPlans.includes(plan)).map(([addon]) => addon);
4119
+ return acc;
4120
+ }, {});
4121
+ const tierId = getTierId(tier.name);
4122
+ tiers.push({
4123
+ id: tierId,
4124
+ title: tierId,
4125
+ stripeProductName: tier.name,
4126
+ limitConstrains: Object.fromEntries(tier.prices.map((p) => [p.plan, p.constraints])),
4127
+ addons: addonsSupported,
4128
+ addonsByPlan: addonsTransposed
4129
+ });
4130
+ });
4131
+ const plans = getProductPlans(products);
4132
+ const addons = getProductAddons(products);
4133
+ return { plans, tiers, addons };
4134
+ };
4105
4135
  var getTargetLocation = (key) => {
4106
4136
  if (devLocations.includes(window.location.hostname)) {
4107
4137
  return "";
@@ -4316,7 +4346,7 @@ var getUserSubscription = createAppAsyncThunk(`${sliceName6}/getUserSubscription
4316
4346
  });
4317
4347
  var getBillingPreview = createAppAsyncThunk(
4318
4348
  `${sliceName6}/getBillingPreview`,
4319
- (order, { dispatch }) => general_api_default.post(`${import_constants5.tenantadmApiUrlv2}/billing/subscription/invoices/preview`, order).catch((err) => commonErrorHandler(err, "There was an error getting your billing information:", dispatch, commonErrorFallback)).then(({ data }) => order.preview_mode === "recurring" ? { ...parseSubscriptionPreview(data.lines), total: data.total } : data)
4349
+ (order, { dispatch }) => general_api_default.post(`${import_constants5.tenantadmApiUrlv2}/billing/subscription/invoices/preview`, order).catch((err) => commonErrorHandler(err, "There was an error getting your billing information:", dispatch, commonErrorFallback)).then(({ data }) => order.preview_mode === "recurring" ? { items: parseSubscriptionPreview(data.lines), total: data.total } : data)
4320
4350
  );
4321
4351
  var getCurrentSubscription = createAppAsyncThunk(
4322
4352
  `${sliceName6}/getCurrentSubscription`,
@@ -4327,6 +4357,10 @@ var getCurrentSubscription = createAppAsyncThunk(
4327
4357
  return commonErrorHandler(err, "There was an error retrieving your current subscription", dispatch, commonErrorFallback);
4328
4358
  })
4329
4359
  );
4360
+ var getProducts = createAppAsyncThunk(
4361
+ `${sliceName6}/getEnabledTiers`,
4362
+ (_, { dispatch }) => general_api_default.get(`${import_constants5.tenantadmApiUrlv2}/billing/products`).catch((err) => commonErrorHandler(err, "There was an error getting Mender products:", dispatch, commonErrorFallback)).then((res) => dispatch(actions6.setProducts(transformProductResponse(res.data))))
4363
+ );
4330
4364
  var requestPlanUpgrade = createAppAsyncThunk(
4331
4365
  `${sliceName6}/requestPlanUpgrade`,
4332
4366
  (order, { dispatch }) => general_api_default.post(`${import_constants5.tenantadmApiUrlv2}/billing/subscription`, order).catch((err) => commonErrorHandler(err, "There was an error sending your request", dispatch, commonErrorFallback)).then(() => Promise.all([setTimeout(() => dispatch(getDeviceLimits2()), TIMEOUTS.threeSeconds), dispatch(getUserOrganization())]))
@@ -5610,7 +5644,8 @@ var useAppInit = (userId) => {
5610
5644
  dispatch(getGroups2()),
5611
5645
  dispatch(getIntegrations()),
5612
5646
  dispatch(getReleases()),
5613
- dispatch(getAllDeviceCounts()).unwrap()
5647
+ dispatch(getAllDeviceCounts()).unwrap(),
5648
+ dispatch(getProducts())
5614
5649
  ];
5615
5650
  if (hasMultitenancy) {
5616
5651
  tasks.push(dispatch(getDeviceLimits2()));