@northern.tech/store 0.47.0 → 0.49.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 (202) hide show
  1. package/dist/actions.d.cts +7 -6
  2. package/dist/actions.d.ts +7 -6
  3. package/dist/appSlice/constants.cjs +12 -2
  4. package/dist/appSlice/index.d.cts +1 -1
  5. package/dist/appSlice/index.d.ts +1 -1
  6. package/dist/appSlice/index.js +1 -1
  7. package/dist/appSlice/mocks.d.cts +1 -1
  8. package/dist/appSlice/mocks.d.ts +1 -1
  9. package/dist/appSlice/selectors.d.cts +1 -1
  10. package/dist/appSlice/selectors.d.ts +1 -1
  11. package/dist/appSlice/thunks.d.cts +2 -2
  12. package/dist/appSlice/thunks.d.ts +2 -2
  13. package/dist/appSlice/thunks.js +1 -2
  14. package/dist/auth.cjs +1 -1
  15. package/dist/auth.d.cts +1 -1
  16. package/dist/auth.d.ts +1 -1
  17. package/dist/auth.js +1 -1
  18. package/dist/commonConstants.cjs +13 -3
  19. package/dist/commonConstants.d.cts +1 -1
  20. package/dist/commonConstants.d.ts +1 -1
  21. package/dist/commonConstants.js +1 -2
  22. package/dist/commonSelectors.cjs +1 -1
  23. package/dist/commonSelectors.d.cts +12 -11
  24. package/dist/commonSelectors.d.ts +12 -11
  25. package/dist/commonSelectors.js +1 -1
  26. package/dist/{constants-CCkKh9KM.d.ts → constants-BtVu36ou.d.ts} +3 -3
  27. package/dist/{constants-OZiiFKiA.d.ts → constants-Cr68z0iM.d.cts} +9 -10
  28. package/dist/{constants-OZiiFKiA.d.cts → constants-Cr68z0iM.d.ts} +9 -10
  29. package/dist/{constants-DsOnY5o5.cjs → constants-DKF0kxhY.cjs} +12 -13
  30. package/dist/{constants-DsOnY5o5.cjs.map → constants-DKF0kxhY.cjs.map} +1 -1
  31. package/dist/{constants-B3NH1IQi.d.ts → constants-DOnQ-UzD.d.cts} +2 -3
  32. package/dist/{constants-B3NH1IQi.d.cts → constants-DOnQ-UzD.d.ts} +2 -3
  33. package/dist/{constants-CUwYPOYK.d.cts → constants-DsJM7i1a.d.cts} +3 -3
  34. package/dist/{constants-DjiC_FnZ.js → constants-TPYvZDsI.js} +14 -15
  35. package/dist/{constants-DjiC_FnZ.js.map → constants-TPYvZDsI.js.map} +1 -1
  36. package/dist/constants.cjs +313 -52
  37. package/dist/constants.d.cts +4 -4
  38. package/dist/constants.d.ts +4 -4
  39. package/dist/constants.js +3 -3
  40. package/dist/deploymentsSlice/constants.cjs +1 -1
  41. package/dist/deploymentsSlice/constants.js +1 -2
  42. package/dist/deploymentsSlice/index.cjs +1 -1
  43. package/dist/deploymentsSlice/index.js +1 -1
  44. package/dist/deploymentsSlice/selectors.cjs +1 -1
  45. package/dist/deploymentsSlice/selectors.js +1 -1
  46. package/dist/deploymentsSlice/thunks.d.cts +5 -4
  47. package/dist/deploymentsSlice/thunks.d.ts +5 -4
  48. package/dist/deploymentsSlice/thunks.js +1 -2
  49. package/dist/devicesSlice/constants.cjs +1 -1
  50. package/dist/devicesSlice/constants.d.cts +1 -1
  51. package/dist/devicesSlice/constants.d.ts +1 -1
  52. package/dist/devicesSlice/constants.js +1 -2
  53. package/dist/devicesSlice/index.d.cts +1 -1
  54. package/dist/devicesSlice/index.d.ts +1 -1
  55. package/dist/devicesSlice/index.js +1 -1
  56. package/dist/devicesSlice/mocks.js +1 -1
  57. package/dist/devicesSlice/selectors.cjs +1 -1
  58. package/dist/devicesSlice/selectors.d.cts +1 -1
  59. package/dist/devicesSlice/selectors.d.ts +1 -1
  60. package/dist/devicesSlice/selectors.js +1 -1
  61. package/dist/devicesSlice/thunks.d.cts +5 -4
  62. package/dist/devicesSlice/thunks.d.ts +5 -4
  63. package/dist/devicesSlice/thunks.js +1 -2
  64. package/dist/{index-7jVuB4tG.d.cts → index-3mpuzSLi.d.cts} +2 -2
  65. package/dist/{index-BcrZxKLw.d.cts → index-BP392nKV.d.cts} +2 -2
  66. package/dist/{index-DOPRnlaC.d.ts → index-Bc7Ugak_.d.ts} +2 -2
  67. package/dist/{index-BWtIaimn.d.cts → index-BnWRWRyV.d.cts} +2 -2
  68. package/dist/{index-o_m7WKiR.d.ts → index-CVsuKFks.d.ts} +2 -2
  69. package/dist/{index-C2za83Qs.d.ts → index-Cai4oXpN.d.ts} +2 -2
  70. package/dist/{index-CaNZaXie.d.cts → index-CwjRezv2.d.cts} +2 -2
  71. package/dist/{index-DNYeo7wc.d.cts → index-D0DMxU8O.d.cts} +2 -2
  72. package/dist/{index-CzQRHJ6f.d.cts → index-DTeKxs80.d.cts} +6 -3
  73. package/dist/{index-CvMpbsOo.d.ts → index-TS08J8mY.d.ts} +6 -3
  74. package/dist/{index-C1vNDCYR.d.ts → index-oFn9qHWB.d.ts} +2 -2
  75. package/dist/{index-CThE5Gfh.d.ts → index-sw1Baeui.d.ts} +2 -2
  76. package/dist/liststatehook.d.cts +1 -0
  77. package/dist/liststatehook.d.ts +1 -0
  78. package/dist/locationutils.cjs +1 -1
  79. package/dist/locationutils.d.cts +4 -3
  80. package/dist/locationutils.d.ts +4 -3
  81. package/dist/locationutils.js +1 -1
  82. package/dist/mockState.d.cts +2 -1
  83. package/dist/mockState.d.ts +2 -1
  84. package/dist/monitorSlice/constants.d.cts +1 -1
  85. package/dist/monitorSlice/constants.d.ts +1 -1
  86. package/dist/monitorSlice/index.d.cts +1 -1
  87. package/dist/monitorSlice/index.d.ts +1 -1
  88. package/dist/monitorSlice/index.js +1 -1
  89. package/dist/monitorSlice/mocks.d.cts +1 -1
  90. package/dist/monitorSlice/mocks.d.ts +1 -1
  91. package/dist/monitorSlice/mocks.js +1 -1
  92. package/dist/monitorSlice/selectors.d.cts +1 -1
  93. package/dist/monitorSlice/selectors.d.ts +1 -1
  94. package/dist/monitorSlice/thunks.d.cts +5 -4
  95. package/dist/monitorSlice/thunks.d.ts +5 -4
  96. package/dist/monitorSlice/thunks.js +1 -1
  97. package/dist/onboardingSlice/mocks.cjs.map +1 -1
  98. package/dist/onboardingSlice/thunks.d.cts +3 -3
  99. package/dist/onboardingSlice/thunks.d.ts +3 -3
  100. package/dist/onboardingSlice/thunks.js +1 -2
  101. package/dist/organizationSlice/constants.cjs +1 -1
  102. package/dist/organizationSlice/constants.d.cts +1 -1
  103. package/dist/organizationSlice/constants.d.ts +1 -1
  104. package/dist/organizationSlice/constants.js +1 -2
  105. package/dist/organizationSlice/index.cjs +4 -1
  106. package/dist/organizationSlice/index.cjs.map +1 -1
  107. package/dist/organizationSlice/index.d.cts +1 -1
  108. package/dist/organizationSlice/index.d.ts +1 -1
  109. package/dist/organizationSlice/index.js +4 -1
  110. package/dist/organizationSlice/index.js.map +1 -1
  111. package/dist/organizationSlice/mocks.d.cts +4 -2
  112. package/dist/organizationSlice/mocks.d.ts +4 -2
  113. package/dist/organizationSlice/mocks.js +1 -1
  114. package/dist/organizationSlice/selectors.cjs +3 -1
  115. package/dist/organizationSlice/selectors.cjs.map +1 -1
  116. package/dist/organizationSlice/selectors.d.cts +2 -2
  117. package/dist/organizationSlice/selectors.d.ts +2 -2
  118. package/dist/organizationSlice/selectors.js +3 -2
  119. package/dist/organizationSlice/selectors.js.map +1 -1
  120. package/dist/organizationSlice/thunks.cjs +1 -0
  121. package/dist/organizationSlice/thunks.d.cts +19 -5
  122. package/dist/organizationSlice/thunks.d.ts +19 -5
  123. package/dist/organizationSlice/thunks.js +1 -2
  124. package/dist/organizationSlice/types.d.cts +1 -1
  125. package/dist/organizationSlice/types.d.ts +1 -1
  126. package/dist/releasesSlice/constants.cjs +0 -2
  127. package/dist/releasesSlice/constants.cjs.map +1 -1
  128. package/dist/releasesSlice/constants.d.cts +2 -2
  129. package/dist/releasesSlice/constants.d.ts +2 -2
  130. package/dist/releasesSlice/constants.js +1 -2
  131. package/dist/releasesSlice/constants.js.map +1 -1
  132. package/dist/releasesSlice/index.d.cts +1 -1
  133. package/dist/releasesSlice/index.d.ts +1 -1
  134. package/dist/releasesSlice/index.js +1 -1
  135. package/dist/releasesSlice/mocks.js +1 -1
  136. package/dist/releasesSlice/selectors.d.cts +1 -1
  137. package/dist/releasesSlice/selectors.d.ts +1 -1
  138. package/dist/releasesSlice/thunks.cjs +2 -2
  139. package/dist/releasesSlice/thunks.cjs.map +1 -1
  140. package/dist/releasesSlice/thunks.d.cts +5 -4
  141. package/dist/releasesSlice/thunks.d.ts +5 -4
  142. package/dist/releasesSlice/thunks.js +2 -2
  143. package/dist/releasesSlice/thunks.js.map +1 -1
  144. package/dist/{selectors-XzNyGFJI.d.cts → selectors-BA53-rNP.d.cts} +2 -2
  145. package/dist/{selectors-Ba9LUr_0.d.ts → selectors-BBt6fdWs.d.ts} +2 -2
  146. package/dist/{selectors-1394DVvN.d.ts → selectors-C1JTUBEz.d.ts} +2 -2
  147. package/dist/{selectors-DDsFLtxz.d.cts → selectors-CCrzjz8P.d.cts} +2 -2
  148. package/dist/{selectors-aLOjKkxN.d.cts → selectors-CYBOWy-Q.d.cts} +2 -2
  149. package/dist/{selectors-jusUdUdc.d.cts → selectors-D1x4Lqo_.d.cts} +2 -2
  150. package/dist/{selectors-LhR8TyWU.d.cts → selectors-DSV8VB7p.d.cts} +5 -8
  151. package/dist/{selectors-DeqP_VLU.d.cts → selectors-DhAje0Fw.d.cts} +2 -2
  152. package/dist/{selectors-DFSv4A_m.d.ts → selectors-DljXYHm2.d.ts} +5 -8
  153. package/dist/{selectors-DQKg681M.d.ts → selectors-DtvvhDLv.d.ts} +2 -2
  154. package/dist/{selectors-CAo0fzIZ.d.ts → selectors-Dv3oN6m9.d.ts} +2 -2
  155. package/dist/{selectors-vk0GUGHf.d.ts → selectors-GKTELLR6.d.ts} +2 -2
  156. package/dist/selectors.cjs +1 -0
  157. package/dist/selectors.d.cts +7 -7
  158. package/dist/selectors.d.ts +7 -7
  159. package/dist/selectors.js +2 -2
  160. package/dist/sockethook.cjs +2 -2
  161. package/dist/sockethook.cjs.map +1 -1
  162. package/dist/sockethook.d.cts +1 -0
  163. package/dist/sockethook.d.ts +1 -0
  164. package/dist/sockethook.js +2 -2
  165. package/dist/sockethook.js.map +1 -1
  166. package/dist/{store-v5V-bbB_.d.ts → store-CROmfENq.d.ts} +9 -9
  167. package/dist/{store-CCvk8X-k.d.cts → store-xuKpT-o4.d.cts} +9 -9
  168. package/dist/store.cjs +1 -1
  169. package/dist/store.d.cts +1 -1
  170. package/dist/store.d.ts +1 -1
  171. package/dist/store.js +1 -1
  172. package/dist/thunks.cjs +15 -6
  173. package/dist/thunks.cjs.map +1 -1
  174. package/dist/thunks.d.cts +2 -2
  175. package/dist/thunks.d.ts +2 -2
  176. package/dist/thunks.js +15 -7
  177. package/dist/thunks.js.map +1 -1
  178. package/dist/{types-B2gphGj8.d.ts → types-DQtRiyGK.d.ts} +3 -3
  179. package/dist/{types-CLASWtVP.d.cts → types-DXm-HM-j.d.cts} +3 -3
  180. package/dist/usersSlice/constants.cjs +1 -1
  181. package/dist/usersSlice/constants.js +1 -2
  182. package/dist/usersSlice/index.cjs +1 -1
  183. package/dist/usersSlice/index.d.cts +1 -1
  184. package/dist/usersSlice/index.d.ts +1 -1
  185. package/dist/usersSlice/index.js +1 -1
  186. package/dist/usersSlice/mocks.d.cts +1 -1
  187. package/dist/usersSlice/mocks.d.ts +1 -1
  188. package/dist/usersSlice/mocks.js +1 -1
  189. package/dist/usersSlice/selectors.cjs +1 -1
  190. package/dist/usersSlice/selectors.d.cts +1 -1
  191. package/dist/usersSlice/selectors.d.ts +1 -1
  192. package/dist/usersSlice/selectors.js +1 -1
  193. package/dist/usersSlice/thunks.d.cts +5 -4
  194. package/dist/usersSlice/thunks.d.ts +5 -4
  195. package/dist/usersSlice/thunks.js +1 -2
  196. package/dist/utils.cjs +9 -10
  197. package/dist/utils.cjs.map +1 -1
  198. package/dist/utils.d.cts +1 -1
  199. package/dist/utils.d.ts +1 -1
  200. package/dist/utils.js +3 -9
  201. package/dist/utils.js.map +1 -1
  202. package/package.json +2 -2
@@ -1,10 +1,10 @@
1
- import { _ as getStripeKey, a as getFeatures, b as getVersionInformation, c as getHostedAnnouncement, d as getIsUploading, f as getRecaptchaKey, g as getSnackbar, h as getSentryConfig, i as getDocsVersion, l as getIsFirstLogin, m as getSearchedDevices, n as getAppInitDone, o as getFeedbackProbability, p as getSearchState, r as getCommit, s as getHostAddress, t as AppState, u as getIsPreview, v as getTrackerCode, y as getUploads } from "./selectors-XzNyGFJI.cjs";
1
+ import { _ as getStripeKey, a as getFeatures, b as getVersionInformation, c as getHostedAnnouncement, d as getIsUploading, f as getRecaptchaKey, g as getSnackbar, h as getSentryConfig, i as getDocsVersion, l as getIsFirstLogin, m as getSearchedDevices, n as getAppInitDone, o as getFeedbackProbability, p as getSearchState, r as getCommit, s as getHostAddress, t as AppState, u as getIsPreview, v as getTrackerCode, y as getUploads } from "./selectors-BA53-rNP.cjs";
2
2
  import { a as getDeploymentsByStatus, c as getRecentDeployments, i as getDeploymentsById, l as getSelectedDeploymentDeviceIds, n as DeploymentsState, o as getDeploymentsSelectionState, r as getDeploymentById, s as getMappedDeploymentSelection, t as DEPLOYMENT_CUTOFF } from "./selectors-CH-yXu-7.cjs";
3
- import { C as getListedDevices, D as getTestDeviceCount, E as getSortedFilteringAttributes, O as getTestDeviceLimit, S as getLimitMaxed, T as getSelectedGroupInfo, _ as getFilteringAttributes, a as getDeviceById, b as getGroupsById, c as getDeviceIdentityAttributes, d as getDeviceListState, f as getDeviceReports, g as getEnabledTiers, h as getDevicesByStatus, i as getCombinedLimit, l as getDeviceLimitStats, m as getDevicesById, n as getAcceptedDevices, o as getDeviceCountsByStatus, p as getDeviceTypes, r as getAttributesList, s as getDeviceFilters, t as DevicesState, u as getDeviceLimits, v as getGroupData, w as getSelectedGroup, x as getGroupsByIdWithoutUngrouped, y as getGroups } from "./selectors-DDsFLtxz.cjs";
4
- import { n as getIssueCountsByType, t as MonitorState } from "./selectors-aLOjKkxN.cjs";
3
+ import { C as getListedDevices, D as getTestDeviceCount, E as getSortedFilteringAttributes, O as getTestDeviceLimit, S as getLimitMaxed, T as getSelectedGroupInfo, _ as getFilteringAttributes, a as getDeviceById, b as getGroupsById, c as getDeviceIdentityAttributes, d as getDeviceListState, f as getDeviceReports, g as getEnabledTiers, h as getDevicesByStatus, i as getCombinedLimit, l as getDeviceLimitStats, m as getDevicesById, n as getAcceptedDevices, o as getDeviceCountsByStatus, p as getDeviceTypes, r as getAttributesList, s as getDeviceFilters, t as DevicesState, u as getDeviceLimits, v as getGroupData, w as getSelectedGroup, x as getGroupsByIdWithoutUngrouped, y as getGroups } from "./selectors-CCrzjz8P.cjs";
4
+ import { n as getIssueCountsByType, t as MonitorState } from "./selectors-CYBOWy-Q.cjs";
5
5
  import { n as getOnboarding, t as OnboardingState } from "./selectors-CQYkG1VI.cjs";
6
- import { S as getWebhooks, _ as getTenantListWithLimits, a as getAuditlogState, b as getWebhookEvents, c as getDeviceTwinIntegrations, d as getIsServiceProvider, f as getOrganization, g as getSubscription, h as getSsoConfig, i as getAuditLogSelectionState, l as getDisabledTiers, m as getSpLimits, n as getAuditLog, o as getBillingProfile, p as getProducts, r as getAuditLogEntry, s as getCard, t as OrganizationState, u as getExternalIntegrations, v as getTenantsList, x as getWebhookEventsTotal, y as getWebhookEventInfo } from "./selectors-LhR8TyWU.cjs";
7
- import { C as getSelectedReleases, D as getSoftwareTags, E as getSoftwareListState, O as getSoftwareTagsById, S as getSelectedRelease, T as getSoftwareList, _ as getReleasesById, a as getDeltaJobsListState, b as getSelectedManifest, c as getHasSoftware, d as getManifestsById, f as getManifestsList, g as getReleaseTagsById, h as getReleaseTags, i as getDeltaJobsById, k as getUpdateTypes, l as getManifestTags, m as getReleaseListState, n as getActiveTab, o as getHasManifests, p as getManifestsListState, r as getDeltaJobById, s as getHasReleases, t as ReleasesState, u as getManifestTagsById, v as getReleasesList, w as getSoftwareById, x as getSelectedManifests, y as getSelectedJob } from "./selectors-DeqP_VLU.cjs";
8
- import { _ as getTooltipsState, a as getGlobalSettingsInitialized, b as getUsersById, c as getIsDarkMode, d as getRolesById, f as getRolesInitialized, g as getTooltipsById, h as getSelectedDeviceAttribute, i as getGlobalSettings, l as getOfflineThresholdSettings, m as getSecurityAlertDismissedTimestamp, n as getCurrentSession, o as getHas2FA, p as getRolesList, r as getCurrentUser, s as getIdAttribute, t as UsersState, u as getReadAllHelptips, v as getUserSettings, x as getUsersList, y as getUserSettingsInitialized } from "./selectors-jusUdUdc.cjs";
6
+ import { C as getWebhooks, S as getWebhookEventsTotal, _ as getSubscription, a as getAuditlogState, b as getWebhookEventInfo, c as getDeviceTwinIntegrations, d as getIsServiceProvider, f as getOrganization, g as getSsoEndpoint, h as getSsoConfig, i as getAuditLogSelectionState, l as getDisabledTiers, m as getSpLimits, n as getAuditLog, o as getBillingProfile, p as getProducts, r as getAuditLogEntry, s as getCard, t as OrganizationState, u as getExternalIntegrations, v as getTenantListWithLimits, x as getWebhookEvents, y as getTenantsList } from "./selectors-DSV8VB7p.cjs";
7
+ import { C as getSelectedReleases, D as getSoftwareTags, E as getSoftwareListState, O as getSoftwareTagsById, S as getSelectedRelease, T as getSoftwareList, _ as getReleasesById, a as getDeltaJobsListState, b as getSelectedManifest, c as getHasSoftware, d as getManifestsById, f as getManifestsList, g as getReleaseTagsById, h as getReleaseTags, i as getDeltaJobsById, k as getUpdateTypes, l as getManifestTags, m as getReleaseListState, n as getActiveTab, o as getHasManifests, p as getManifestsListState, r as getDeltaJobById, s as getHasReleases, t as ReleasesState, u as getManifestTagsById, v as getReleasesList, w as getSoftwareById, x as getSelectedManifests, y as getSelectedJob } from "./selectors-DhAje0Fw.cjs";
8
+ import { _ as getTooltipsState, a as getGlobalSettingsInitialized, b as getUsersById, c as getIsDarkMode, d as getRolesById, f as getRolesInitialized, g as getTooltipsById, h as getSelectedDeviceAttribute, i as getGlobalSettings, l as getOfflineThresholdSettings, m as getSecurityAlertDismissedTimestamp, n as getCurrentSession, o as getHas2FA, p as getRolesList, r as getCurrentUser, s as getIdAttribute, t as UsersState, u as getReadAllHelptips, v as getUserSettings, x as getUsersList, y as getUserSettingsInitialized } from "./selectors-D1x4Lqo_.cjs";
9
9
  import { getAuditlogDevice, getAvailableIssueOptionsByType, getDemoDeviceAddress, getDeploymentRelease, getDeviceConfigDeployment, getDeviceReportsForUser, getFilterAttributes, getGroupNames, getIsEnterprise, getMappedDevicesList, getOnboardingState, getRelevantRoles, getSelectedDeploymentData, getShowSecurityAlert, getTenantCapabilities, getUserCapabilities, getUserRoles } from "./commonSelectors.cjs";
10
- export { AppState, DEPLOYMENT_CUTOFF, DeploymentsState, DevicesState, MonitorState, OnboardingState, OrganizationState, ReleasesState, UsersState, getAcceptedDevices, getActiveTab, getAppInitDone, getAttributesList, getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogDevice, getAuditlogState, getAvailableIssueOptionsByType, getBillingProfile, getCard, getCombinedLimit, getCommit, getCurrentSession, getCurrentUser, getDeltaJobById, getDeltaJobsById, getDeltaJobsListState, getDemoDeviceAddress, getDeploymentById, getDeploymentRelease, getDeploymentsById, getDeploymentsByStatus, getDeploymentsSelectionState, getDeviceById, getDeviceConfigDeployment, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceReportsForUser, getDeviceTwinIntegrations, getDeviceTypes, getDevicesById, getDevicesByStatus, getDisabledTiers, getDocsVersion, getEnabledTiers, getExternalIntegrations, getFeatures, getFeedbackProbability, getFilterAttributes, getFilteringAttributes, getGlobalSettings, getGlobalSettingsInitialized, getGroupData, getGroupNames, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getHas2FA, getHasManifests, getHasReleases, getHasSoftware, getHostAddress, getHostedAnnouncement, getIdAttribute, getIsDarkMode, getIsEnterprise, getIsFirstLogin, getIsPreview, getIsServiceProvider, getIsUploading, getIssueCountsByType, getLimitMaxed, getListedDevices, getManifestTags, getManifestTagsById, getManifestsById, getManifestsList, getManifestsListState, getMappedDeploymentSelection, getMappedDevicesList, getOfflineThresholdSettings, getOnboarding, getOnboardingState, getOrganization, getProducts, getReadAllHelptips, getRecaptchaKey, getRecentDeployments, getReleaseListState, getReleaseTags, getReleaseTagsById, getReleasesById, getReleasesList, getRelevantRoles, getRolesById, getRolesInitialized, getRolesList, getSearchState, getSearchedDevices, getSecurityAlertDismissedTimestamp, getSelectedDeploymentData, getSelectedDeploymentDeviceIds, getSelectedDeviceAttribute, getSelectedGroup, getSelectedGroupInfo, getSelectedJob, getSelectedManifest, getSelectedManifests, getSelectedRelease, getSelectedReleases, getSentryConfig, getShowSecurityAlert, getSnackbar, getSoftwareById, getSoftwareList, getSoftwareListState, getSoftwareTags, getSoftwareTagsById, getSortedFilteringAttributes, getSpLimits, getSsoConfig, getStripeKey, getSubscription, getTenantCapabilities, getTenantListWithLimits, getTenantsList, getTestDeviceCount, getTestDeviceLimit, getTooltipsById, getTooltipsState, getTrackerCode, getUpdateTypes, getUploads, getUserCapabilities, getUserRoles, getUserSettings, getUserSettingsInitialized, getUsersById, getUsersList, getVersionInformation, getWebhookEventInfo, getWebhookEvents, getWebhookEventsTotal, getWebhooks };
10
+ export { AppState, DEPLOYMENT_CUTOFF, DeploymentsState, DevicesState, MonitorState, OnboardingState, OrganizationState, ReleasesState, UsersState, getAcceptedDevices, getActiveTab, getAppInitDone, getAttributesList, getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogDevice, getAuditlogState, getAvailableIssueOptionsByType, getBillingProfile, getCard, getCombinedLimit, getCommit, getCurrentSession, getCurrentUser, getDeltaJobById, getDeltaJobsById, getDeltaJobsListState, getDemoDeviceAddress, getDeploymentById, getDeploymentRelease, getDeploymentsById, getDeploymentsByStatus, getDeploymentsSelectionState, getDeviceById, getDeviceConfigDeployment, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceReportsForUser, getDeviceTwinIntegrations, getDeviceTypes, getDevicesById, getDevicesByStatus, getDisabledTiers, getDocsVersion, getEnabledTiers, getExternalIntegrations, getFeatures, getFeedbackProbability, getFilterAttributes, getFilteringAttributes, getGlobalSettings, getGlobalSettingsInitialized, getGroupData, getGroupNames, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getHas2FA, getHasManifests, getHasReleases, getHasSoftware, getHostAddress, getHostedAnnouncement, getIdAttribute, getIsDarkMode, getIsEnterprise, getIsFirstLogin, getIsPreview, getIsServiceProvider, getIsUploading, getIssueCountsByType, getLimitMaxed, getListedDevices, getManifestTags, getManifestTagsById, getManifestsById, getManifestsList, getManifestsListState, getMappedDeploymentSelection, getMappedDevicesList, getOfflineThresholdSettings, getOnboarding, getOnboardingState, getOrganization, getProducts, getReadAllHelptips, getRecaptchaKey, getRecentDeployments, getReleaseListState, getReleaseTags, getReleaseTagsById, getReleasesById, getReleasesList, getRelevantRoles, getRolesById, getRolesInitialized, getRolesList, getSearchState, getSearchedDevices, getSecurityAlertDismissedTimestamp, getSelectedDeploymentData, getSelectedDeploymentDeviceIds, getSelectedDeviceAttribute, getSelectedGroup, getSelectedGroupInfo, getSelectedJob, getSelectedManifest, getSelectedManifests, getSelectedRelease, getSelectedReleases, getSentryConfig, getShowSecurityAlert, getSnackbar, getSoftwareById, getSoftwareList, getSoftwareListState, getSoftwareTags, getSoftwareTagsById, getSortedFilteringAttributes, getSpLimits, getSsoConfig, getSsoEndpoint, getStripeKey, getSubscription, getTenantCapabilities, getTenantListWithLimits, getTenantsList, getTestDeviceCount, getTestDeviceLimit, getTooltipsById, getTooltipsState, getTrackerCode, getUpdateTypes, getUploads, getUserCapabilities, getUserRoles, getUserSettings, getUserSettingsInitialized, getUsersById, getUsersList, getVersionInformation, getWebhookEventInfo, getWebhookEvents, getWebhookEventsTotal, getWebhooks };
@@ -1,10 +1,10 @@
1
- import { _ as getStripeKey, a as getFeatures, b as getVersionInformation, c as getHostedAnnouncement, d as getIsUploading, f as getRecaptchaKey, g as getSnackbar, h as getSentryConfig, i as getDocsVersion, l as getIsFirstLogin, m as getSearchedDevices, n as getAppInitDone, o as getFeedbackProbability, p as getSearchState, r as getCommit, s as getHostAddress, t as AppState, u as getIsPreview, v as getTrackerCode, y as getUploads } from "./selectors-CAo0fzIZ.js";
1
+ import { _ as getStripeKey, a as getFeatures, b as getVersionInformation, c as getHostedAnnouncement, d as getIsUploading, f as getRecaptchaKey, g as getSnackbar, h as getSentryConfig, i as getDocsVersion, l as getIsFirstLogin, m as getSearchedDevices, n as getAppInitDone, o as getFeedbackProbability, p as getSearchState, r as getCommit, s as getHostAddress, t as AppState, u as getIsPreview, v as getTrackerCode, y as getUploads } from "./selectors-Dv3oN6m9.js";
2
2
  import { a as getDeploymentsByStatus, c as getRecentDeployments, i as getDeploymentsById, l as getSelectedDeploymentDeviceIds, n as DeploymentsState, o as getDeploymentsSelectionState, r as getDeploymentById, s as getMappedDeploymentSelection, t as DEPLOYMENT_CUTOFF } from "./selectors-D9t4It2i.js";
3
- import { C as getListedDevices, D as getTestDeviceCount, E as getSortedFilteringAttributes, O as getTestDeviceLimit, S as getLimitMaxed, T as getSelectedGroupInfo, _ as getFilteringAttributes, a as getDeviceById, b as getGroupsById, c as getDeviceIdentityAttributes, d as getDeviceListState, f as getDeviceReports, g as getEnabledTiers, h as getDevicesByStatus, i as getCombinedLimit, l as getDeviceLimitStats, m as getDevicesById, n as getAcceptedDevices, o as getDeviceCountsByStatus, p as getDeviceTypes, r as getAttributesList, s as getDeviceFilters, t as DevicesState, u as getDeviceLimits, v as getGroupData, w as getSelectedGroup, x as getGroupsByIdWithoutUngrouped, y as getGroups } from "./selectors-1394DVvN.js";
4
- import { n as getIssueCountsByType, t as MonitorState } from "./selectors-vk0GUGHf.js";
3
+ import { C as getListedDevices, D as getTestDeviceCount, E as getSortedFilteringAttributes, O as getTestDeviceLimit, S as getLimitMaxed, T as getSelectedGroupInfo, _ as getFilteringAttributes, a as getDeviceById, b as getGroupsById, c as getDeviceIdentityAttributes, d as getDeviceListState, f as getDeviceReports, g as getEnabledTiers, h as getDevicesByStatus, i as getCombinedLimit, l as getDeviceLimitStats, m as getDevicesById, n as getAcceptedDevices, o as getDeviceCountsByStatus, p as getDeviceTypes, r as getAttributesList, s as getDeviceFilters, t as DevicesState, u as getDeviceLimits, v as getGroupData, w as getSelectedGroup, x as getGroupsByIdWithoutUngrouped, y as getGroups } from "./selectors-C1JTUBEz.js";
4
+ import { n as getIssueCountsByType, t as MonitorState } from "./selectors-GKTELLR6.js";
5
5
  import { n as getOnboarding, t as OnboardingState } from "./selectors-elCimAHX.js";
6
- import { S as getWebhooks, _ as getTenantListWithLimits, a as getAuditlogState, b as getWebhookEvents, c as getDeviceTwinIntegrations, d as getIsServiceProvider, f as getOrganization, g as getSubscription, h as getSsoConfig, i as getAuditLogSelectionState, l as getDisabledTiers, m as getSpLimits, n as getAuditLog, o as getBillingProfile, p as getProducts, r as getAuditLogEntry, s as getCard, t as OrganizationState, u as getExternalIntegrations, v as getTenantsList, x as getWebhookEventsTotal, y as getWebhookEventInfo } from "./selectors-DFSv4A_m.js";
7
- import { C as getSelectedReleases, D as getSoftwareTags, E as getSoftwareListState, O as getSoftwareTagsById, S as getSelectedRelease, T as getSoftwareList, _ as getReleasesById, a as getDeltaJobsListState, b as getSelectedManifest, c as getHasSoftware, d as getManifestsById, f as getManifestsList, g as getReleaseTagsById, h as getReleaseTags, i as getDeltaJobsById, k as getUpdateTypes, l as getManifestTags, m as getReleaseListState, n as getActiveTab, o as getHasManifests, p as getManifestsListState, r as getDeltaJobById, s as getHasReleases, t as ReleasesState, u as getManifestTagsById, v as getReleasesList, w as getSoftwareById, x as getSelectedManifests, y as getSelectedJob } from "./selectors-Ba9LUr_0.js";
8
- import { _ as getTooltipsState, a as getGlobalSettingsInitialized, b as getUsersById, c as getIsDarkMode, d as getRolesById, f as getRolesInitialized, g as getTooltipsById, h as getSelectedDeviceAttribute, i as getGlobalSettings, l as getOfflineThresholdSettings, m as getSecurityAlertDismissedTimestamp, n as getCurrentSession, o as getHas2FA, p as getRolesList, r as getCurrentUser, s as getIdAttribute, t as UsersState, u as getReadAllHelptips, v as getUserSettings, x as getUsersList, y as getUserSettingsInitialized } from "./selectors-DQKg681M.js";
6
+ import { C as getWebhooks, S as getWebhookEventsTotal, _ as getSubscription, a as getAuditlogState, b as getWebhookEventInfo, c as getDeviceTwinIntegrations, d as getIsServiceProvider, f as getOrganization, g as getSsoEndpoint, h as getSsoConfig, i as getAuditLogSelectionState, l as getDisabledTiers, m as getSpLimits, n as getAuditLog, o as getBillingProfile, p as getProducts, r as getAuditLogEntry, s as getCard, t as OrganizationState, u as getExternalIntegrations, v as getTenantListWithLimits, x as getWebhookEvents, y as getTenantsList } from "./selectors-DljXYHm2.js";
7
+ import { C as getSelectedReleases, D as getSoftwareTags, E as getSoftwareListState, O as getSoftwareTagsById, S as getSelectedRelease, T as getSoftwareList, _ as getReleasesById, a as getDeltaJobsListState, b as getSelectedManifest, c as getHasSoftware, d as getManifestsById, f as getManifestsList, g as getReleaseTagsById, h as getReleaseTags, i as getDeltaJobsById, k as getUpdateTypes, l as getManifestTags, m as getReleaseListState, n as getActiveTab, o as getHasManifests, p as getManifestsListState, r as getDeltaJobById, s as getHasReleases, t as ReleasesState, u as getManifestTagsById, v as getReleasesList, w as getSoftwareById, x as getSelectedManifests, y as getSelectedJob } from "./selectors-BBt6fdWs.js";
8
+ import { _ as getTooltipsState, a as getGlobalSettingsInitialized, b as getUsersById, c as getIsDarkMode, d as getRolesById, f as getRolesInitialized, g as getTooltipsById, h as getSelectedDeviceAttribute, i as getGlobalSettings, l as getOfflineThresholdSettings, m as getSecurityAlertDismissedTimestamp, n as getCurrentSession, o as getHas2FA, p as getRolesList, r as getCurrentUser, s as getIdAttribute, t as UsersState, u as getReadAllHelptips, v as getUserSettings, x as getUsersList, y as getUserSettingsInitialized } from "./selectors-DtvvhDLv.js";
9
9
  import { getAuditlogDevice, getAvailableIssueOptionsByType, getDemoDeviceAddress, getDeploymentRelease, getDeviceConfigDeployment, getDeviceReportsForUser, getFilterAttributes, getGroupNames, getIsEnterprise, getMappedDevicesList, getOnboardingState, getRelevantRoles, getSelectedDeploymentData, getShowSecurityAlert, getTenantCapabilities, getUserCapabilities, getUserRoles } from "./commonSelectors.js";
10
- export { AppState, DEPLOYMENT_CUTOFF, DeploymentsState, DevicesState, MonitorState, OnboardingState, OrganizationState, ReleasesState, UsersState, getAcceptedDevices, getActiveTab, getAppInitDone, getAttributesList, getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogDevice, getAuditlogState, getAvailableIssueOptionsByType, getBillingProfile, getCard, getCombinedLimit, getCommit, getCurrentSession, getCurrentUser, getDeltaJobById, getDeltaJobsById, getDeltaJobsListState, getDemoDeviceAddress, getDeploymentById, getDeploymentRelease, getDeploymentsById, getDeploymentsByStatus, getDeploymentsSelectionState, getDeviceById, getDeviceConfigDeployment, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceReportsForUser, getDeviceTwinIntegrations, getDeviceTypes, getDevicesById, getDevicesByStatus, getDisabledTiers, getDocsVersion, getEnabledTiers, getExternalIntegrations, getFeatures, getFeedbackProbability, getFilterAttributes, getFilteringAttributes, getGlobalSettings, getGlobalSettingsInitialized, getGroupData, getGroupNames, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getHas2FA, getHasManifests, getHasReleases, getHasSoftware, getHostAddress, getHostedAnnouncement, getIdAttribute, getIsDarkMode, getIsEnterprise, getIsFirstLogin, getIsPreview, getIsServiceProvider, getIsUploading, getIssueCountsByType, getLimitMaxed, getListedDevices, getManifestTags, getManifestTagsById, getManifestsById, getManifestsList, getManifestsListState, getMappedDeploymentSelection, getMappedDevicesList, getOfflineThresholdSettings, getOnboarding, getOnboardingState, getOrganization, getProducts, getReadAllHelptips, getRecaptchaKey, getRecentDeployments, getReleaseListState, getReleaseTags, getReleaseTagsById, getReleasesById, getReleasesList, getRelevantRoles, getRolesById, getRolesInitialized, getRolesList, getSearchState, getSearchedDevices, getSecurityAlertDismissedTimestamp, getSelectedDeploymentData, getSelectedDeploymentDeviceIds, getSelectedDeviceAttribute, getSelectedGroup, getSelectedGroupInfo, getSelectedJob, getSelectedManifest, getSelectedManifests, getSelectedRelease, getSelectedReleases, getSentryConfig, getShowSecurityAlert, getSnackbar, getSoftwareById, getSoftwareList, getSoftwareListState, getSoftwareTags, getSoftwareTagsById, getSortedFilteringAttributes, getSpLimits, getSsoConfig, getStripeKey, getSubscription, getTenantCapabilities, getTenantListWithLimits, getTenantsList, getTestDeviceCount, getTestDeviceLimit, getTooltipsById, getTooltipsState, getTrackerCode, getUpdateTypes, getUploads, getUserCapabilities, getUserRoles, getUserSettings, getUserSettingsInitialized, getUsersById, getUsersList, getVersionInformation, getWebhookEventInfo, getWebhookEvents, getWebhookEventsTotal, getWebhooks };
10
+ export { AppState, DEPLOYMENT_CUTOFF, DeploymentsState, DevicesState, MonitorState, OnboardingState, OrganizationState, ReleasesState, UsersState, getAcceptedDevices, getActiveTab, getAppInitDone, getAttributesList, getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogDevice, getAuditlogState, getAvailableIssueOptionsByType, getBillingProfile, getCard, getCombinedLimit, getCommit, getCurrentSession, getCurrentUser, getDeltaJobById, getDeltaJobsById, getDeltaJobsListState, getDemoDeviceAddress, getDeploymentById, getDeploymentRelease, getDeploymentsById, getDeploymentsByStatus, getDeploymentsSelectionState, getDeviceById, getDeviceConfigDeployment, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceReportsForUser, getDeviceTwinIntegrations, getDeviceTypes, getDevicesById, getDevicesByStatus, getDisabledTiers, getDocsVersion, getEnabledTiers, getExternalIntegrations, getFeatures, getFeedbackProbability, getFilterAttributes, getFilteringAttributes, getGlobalSettings, getGlobalSettingsInitialized, getGroupData, getGroupNames, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getHas2FA, getHasManifests, getHasReleases, getHasSoftware, getHostAddress, getHostedAnnouncement, getIdAttribute, getIsDarkMode, getIsEnterprise, getIsFirstLogin, getIsPreview, getIsServiceProvider, getIsUploading, getIssueCountsByType, getLimitMaxed, getListedDevices, getManifestTags, getManifestTagsById, getManifestsById, getManifestsList, getManifestsListState, getMappedDeploymentSelection, getMappedDevicesList, getOfflineThresholdSettings, getOnboarding, getOnboardingState, getOrganization, getProducts, getReadAllHelptips, getRecaptchaKey, getRecentDeployments, getReleaseListState, getReleaseTags, getReleaseTagsById, getReleasesById, getReleasesList, getRelevantRoles, getRolesById, getRolesInitialized, getRolesList, getSearchState, getSearchedDevices, getSecurityAlertDismissedTimestamp, getSelectedDeploymentData, getSelectedDeploymentDeviceIds, getSelectedDeviceAttribute, getSelectedGroup, getSelectedGroupInfo, getSelectedJob, getSelectedManifest, getSelectedManifests, getSelectedRelease, getSelectedReleases, getSentryConfig, getShowSecurityAlert, getSnackbar, getSoftwareById, getSoftwareList, getSoftwareListState, getSoftwareTags, getSoftwareTagsById, getSortedFilteringAttributes, getSpLimits, getSsoConfig, getSsoEndpoint, getStripeKey, getSubscription, getTenantCapabilities, getTenantListWithLimits, getTenantsList, getTestDeviceCount, getTestDeviceLimit, getTooltipsById, getTooltipsState, getTrackerCode, getUpdateTypes, getUploads, getUserCapabilities, getUserRoles, getUserSettings, getUserSettingsInitialized, getUsersById, getUsersList, getVersionInformation, getWebhookEventInfo, getWebhookEvents, getWebhookEventsTotal, getWebhooks };
package/dist/selectors.js CHANGED
@@ -3,8 +3,8 @@ import { DEPLOYMENT_CUTOFF, getDeploymentById, getDeploymentsById, getDeployment
3
3
  import { getAcceptedDevices, getAttributesList, getCombinedLimit, getDeviceById, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceTypes, getDevicesById, getDevicesByStatus, getEnabledTiers, getFilteringAttributes, getGroupData, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getLimitMaxed, getListedDevices, getSelectedGroup, getSelectedGroupInfo, getSortedFilteringAttributes, getTestDeviceCount, getTestDeviceLimit } from "./devicesSlice/selectors.js";
4
4
  import { getIssueCountsByType } from "./monitorSlice/selectors.js";
5
5
  import { getOnboarding } from "./onboardingSlice/selectors.js";
6
- import { getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogState, getBillingProfile, getCard, getDeviceTwinIntegrations, getDisabledTiers, getExternalIntegrations, getIsServiceProvider, getOrganization, getProducts, getSpLimits, getSsoConfig, getSubscription, getTenantListWithLimits, getTenantsList, getWebhookEventInfo, getWebhookEvents, getWebhookEventsTotal, getWebhooks } from "./organizationSlice/selectors.js";
6
+ import { getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogState, getBillingProfile, getCard, getDeviceTwinIntegrations, getDisabledTiers, getExternalIntegrations, getIsServiceProvider, getOrganization, getProducts, getSpLimits, getSsoConfig, getSsoEndpoint, getSubscription, getTenantListWithLimits, getTenantsList, getWebhookEventInfo, getWebhookEvents, getWebhookEventsTotal, getWebhooks } from "./organizationSlice/selectors.js";
7
7
  import { getActiveTab, getDeltaJobById, getDeltaJobsById, getDeltaJobsListState, getHasManifests, getHasReleases, getHasSoftware, getManifestTags, getManifestTagsById, getManifestsById, getManifestsList, getManifestsListState, getReleaseListState, getReleaseTags, getReleaseTagsById, getReleasesById, getReleasesList, getSelectedJob, getSelectedManifest, getSelectedManifests, getSelectedRelease, getSelectedReleases, getSoftwareById, getSoftwareList, getSoftwareListState, getSoftwareTags, getSoftwareTagsById, getUpdateTypes } from "./releasesSlice/selectors.js";
8
8
  import { getCurrentSession, getCurrentUser, getGlobalSettings, getGlobalSettingsInitialized, getHas2FA, getIdAttribute, getIsDarkMode, getOfflineThresholdSettings, getReadAllHelptips, getRolesById, getRolesInitialized, getRolesList, getSecurityAlertDismissedTimestamp, getSelectedDeviceAttribute, getTooltipsById, getTooltipsState, getUserSettings, getUserSettingsInitialized, getUsersById, getUsersList } from "./usersSlice/selectors.js";
9
9
  import { getAuditlogDevice, getAvailableIssueOptionsByType, getDemoDeviceAddress, getDeploymentRelease, getDeviceConfigDeployment, getDeviceReportsForUser, getFilterAttributes, getGroupNames, getIsEnterprise, getMappedDevicesList, getOnboardingState, getRelevantRoles, getSelectedDeploymentData, getShowSecurityAlert, getTenantCapabilities, getUserCapabilities, getUserRoles } from "./commonSelectors.js";
10
- export { DEPLOYMENT_CUTOFF, getAcceptedDevices, getActiveTab, getAppInitDone, getAttributesList, getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogDevice, getAuditlogState, getAvailableIssueOptionsByType, getBillingProfile, getCard, getCombinedLimit, getCommit, getCurrentSession, getCurrentUser, getDeltaJobById, getDeltaJobsById, getDeltaJobsListState, getDemoDeviceAddress, getDeploymentById, getDeploymentRelease, getDeploymentsById, getDeploymentsByStatus, getDeploymentsSelectionState, getDeviceById, getDeviceConfigDeployment, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceReportsForUser, getDeviceTwinIntegrations, getDeviceTypes, getDevicesById, getDevicesByStatus, getDisabledTiers, getDocsVersion, getEnabledTiers, getExternalIntegrations, getFeatures, getFeedbackProbability, getFilterAttributes, getFilteringAttributes, getGlobalSettings, getGlobalSettingsInitialized, getGroupData, getGroupNames, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getHas2FA, getHasManifests, getHasReleases, getHasSoftware, getHostAddress, getHostedAnnouncement, getIdAttribute, getIsDarkMode, getIsEnterprise, getIsFirstLogin, getIsPreview, getIsServiceProvider, getIsUploading, getIssueCountsByType, getLimitMaxed, getListedDevices, getManifestTags, getManifestTagsById, getManifestsById, getManifestsList, getManifestsListState, getMappedDeploymentSelection, getMappedDevicesList, getOfflineThresholdSettings, getOnboarding, getOnboardingState, getOrganization, getProducts, getReadAllHelptips, getRecaptchaKey, getRecentDeployments, getReleaseListState, getReleaseTags, getReleaseTagsById, getReleasesById, getReleasesList, getRelevantRoles, getRolesById, getRolesInitialized, getRolesList, getSearchState, getSearchedDevices, getSecurityAlertDismissedTimestamp, getSelectedDeploymentData, getSelectedDeploymentDeviceIds, getSelectedDeviceAttribute, getSelectedGroup, getSelectedGroupInfo, getSelectedJob, getSelectedManifest, getSelectedManifests, getSelectedRelease, getSelectedReleases, getSentryConfig, getShowSecurityAlert, getSnackbar, getSoftwareById, getSoftwareList, getSoftwareListState, getSoftwareTags, getSoftwareTagsById, getSortedFilteringAttributes, getSpLimits, getSsoConfig, getStripeKey, getSubscription, getTenantCapabilities, getTenantListWithLimits, getTenantsList, getTestDeviceCount, getTestDeviceLimit, getTooltipsById, getTooltipsState, getTrackerCode, getUpdateTypes, getUploads, getUserCapabilities, getUserRoles, getUserSettings, getUserSettingsInitialized, getUsersById, getUsersList, getVersionInformation, getWebhookEventInfo, getWebhookEvents, getWebhookEventsTotal, getWebhooks };
10
+ export { DEPLOYMENT_CUTOFF, getAcceptedDevices, getActiveTab, getAppInitDone, getAttributesList, getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogDevice, getAuditlogState, getAvailableIssueOptionsByType, getBillingProfile, getCard, getCombinedLimit, getCommit, getCurrentSession, getCurrentUser, getDeltaJobById, getDeltaJobsById, getDeltaJobsListState, getDemoDeviceAddress, getDeploymentById, getDeploymentRelease, getDeploymentsById, getDeploymentsByStatus, getDeploymentsSelectionState, getDeviceById, getDeviceConfigDeployment, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceReportsForUser, getDeviceTwinIntegrations, getDeviceTypes, getDevicesById, getDevicesByStatus, getDisabledTiers, getDocsVersion, getEnabledTiers, getExternalIntegrations, getFeatures, getFeedbackProbability, getFilterAttributes, getFilteringAttributes, getGlobalSettings, getGlobalSettingsInitialized, getGroupData, getGroupNames, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getHas2FA, getHasManifests, getHasReleases, getHasSoftware, getHostAddress, getHostedAnnouncement, getIdAttribute, getIsDarkMode, getIsEnterprise, getIsFirstLogin, getIsPreview, getIsServiceProvider, getIsUploading, getIssueCountsByType, getLimitMaxed, getListedDevices, getManifestTags, getManifestTagsById, getManifestsById, getManifestsList, getManifestsListState, getMappedDeploymentSelection, getMappedDevicesList, getOfflineThresholdSettings, getOnboarding, getOnboardingState, getOrganization, getProducts, getReadAllHelptips, getRecaptchaKey, getRecentDeployments, getReleaseListState, getReleaseTags, getReleaseTagsById, getReleasesById, getReleasesList, getRelevantRoles, getRolesById, getRolesInitialized, getRolesList, getSearchState, getSearchedDevices, getSecurityAlertDismissedTimestamp, getSelectedDeploymentData, getSelectedDeploymentDeviceIds, getSelectedDeviceAttribute, getSelectedGroup, getSelectedGroupInfo, getSelectedJob, getSelectedManifest, getSelectedManifests, getSelectedRelease, getSelectedReleases, getSentryConfig, getShowSecurityAlert, getSnackbar, getSoftwareById, getSoftwareList, getSoftwareListState, getSoftwareTags, getSoftwareTagsById, getSortedFilteringAttributes, getSpLimits, getSsoConfig, getSsoEndpoint, getStripeKey, getSubscription, getTenantCapabilities, getTenantListWithLimits, getTenantsList, getTestDeviceCount, getTestDeviceLimit, getTooltipsById, getTooltipsState, getTrackerCode, getUpdateTypes, getUploads, getUserCapabilities, getUserRoles, getUserSettings, getUserSettingsInitialized, getUsersById, getUsersList, getVersionInformation, getWebhookEventInfo, getWebhookEvents, getWebhookEventsTotal, getWebhooks };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
3
- const require_constants = require("./constants-DsOnY5o5.cjs");
3
+ const require_constants = require("./constants-DKF0kxhY.cjs");
4
4
  let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
5
5
  let _northern_tech_utils_helpers = require("@northern.tech/utils/helpers");
6
6
  let universal_cookie = require("universal-cookie");
@@ -32,6 +32,7 @@ const useSession = ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify,
32
32
  socketRef.current.send(encodedData);
33
33
  }, []);
34
34
  const close = (0, react.useCallback)(() => {
35
+ clearTimeout(healthcheckTimeout.current);
35
36
  if (!socketRef.current || socketRef.current?.readyState !== WebSocket.OPEN) return;
36
37
  sendMessage({
37
38
  typ: require_constants.DEVICE_MESSAGE_TYPES.Stop,
@@ -81,7 +82,6 @@ const useSession = ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify,
81
82
  const onSocketError = (0, react.useCallback)((error) => {
82
83
  onNotify(`WebSocket error: ${error.message || "Unknown error"}`);
83
84
  close();
84
- clearTimeout(healthcheckTimeout.current);
85
85
  }, [close, onNotify]);
86
86
  const onSocketOpen = (0, react.useCallback)(() => {
87
87
  sendMessage({
@@ -1 +1 @@
1
- {"version":3,"file":"sockethook.cjs","names":["Cookies","Packr","useState","useRef","useCallback","MessageProtocols","MessageTypes","blobToString","byteArrayToString","TIMEOUTS","apiUrl"],"sources":["../src/sockethook.ts"],"sourcesContent":["// Copyright 2022 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 { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { TIMEOUTS } from '@northern.tech/utils/constants';\nimport { blobToString, byteArrayToString } from '@northern.tech/utils/helpers';\nimport { Packr } from 'msgpackr';\nimport Cookies from 'universal-cookie';\n\nimport { DEVICE_MESSAGE_PROTOCOLS as MessageProtocols, DEVICE_MESSAGE_TYPES as MessageTypes, apiUrl } from './constants';\n\nconst cookies = new Cookies();\n\n// plain maps + omitted undefined fields keep the wire format compatible with the deviceconnect backend\nconst MessagePack = new Packr({ skipValues: [undefined], useRecords: false });\n\ntype UseSessionProps = {\n onClose: (event: CloseEvent) => void;\n onHealthCheckFailed: () => void;\n onMessageReceived: (body: Uint8Array) => void;\n onNotify: (message: string) => void;\n onOpen: (isOpen: boolean) => void;\n token: string;\n};\n\ntype MessageProps = {\n body?: Uint8Array;\n props: Record<string, string | number>;\n typ: string;\n};\n\ntype SessionWebSocket = WebSocket & { sessionId?: string };\n\ntype UseSessionReturn = [\n connect: (deviceId: string) => void,\n sendMessage: (message: MessageProps) => void,\n close: () => void,\n readyState: number,\n sessionId: string | undefined\n];\n\nexport const useSession = ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify, onOpen, token }: UseSessionProps): UseSessionReturn => {\n const [sessionId, setSessionId] = useState<string | undefined>();\n const healthcheckTimeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const socketRef = useRef<SessionWebSocket | undefined>(undefined);\n const sendMessage = useCallback(({ typ, body, props }: MessageProps): void => {\n if (!socketRef.current) {\n return;\n }\n const proto_header = { proto: MessageProtocols.Shell, typ, sid: socketRef.current.sessionId, props };\n const encodedData = MessagePack.pack({ hdr: proto_header, body });\n socketRef.current.send(encodedData);\n }, []);\n\n const close = useCallback((): void => {\n if (!socketRef.current || socketRef.current?.readyState !== WebSocket.OPEN) {\n return;\n }\n sendMessage({ typ: MessageTypes.Stop, props: {} });\n socketRef.current.close();\n setSessionId(undefined);\n }, [sendMessage]);\n\n const healthcheckFailed = useCallback((): void => {\n onHealthCheckFailed();\n close();\n }, [close, onHealthCheckFailed]);\n\n const onSocketMessage = useCallback(\n (event: MessageEvent): Promise<void> =>\n blobToString(event.data).then((data: unknown) => {\n const {\n hdr: { props = {} as Record<string, string | number>, proto, sid, typ },\n body\n } = MessagePack.unpack(new Uint8Array(data as ArrayBuffer)) as {\n body: Uint8Array;\n hdr: { props: Record<string, string | number>; proto: number; sid: string; typ: string };\n };\n if (proto !== MessageProtocols.Shell) {\n return;\n }\n switch (typ) {\n case MessageTypes.New: {\n if (props.status == WebSocket.CLOSING) {\n onNotify(`Error: ${byteArrayToString(body as unknown as Buffer)}`);\n setSessionId(undefined);\n return close();\n } else {\n clearTimeout(healthcheckTimeout.current);\n healthcheckTimeout.current = setTimeout(healthcheckFailed, 65 * TIMEOUTS.oneSecond);\n if (socketRef.current) {\n socketRef.current.sessionId = sid;\n }\n return setSessionId(sid);\n }\n }\n case MessageTypes.Shell:\n return onMessageReceived(body);\n case MessageTypes.Stop:\n return close();\n case MessageTypes.Ping: {\n if (healthcheckTimeout.current) {\n clearTimeout(healthcheckTimeout.current);\n }\n sendMessage({ typ: MessageTypes.Pong, props: {} });\n const timeout = parseInt(props.timeout as string);\n if (timeout > 0) {\n healthcheckTimeout.current = setTimeout(healthcheckFailed, timeout * TIMEOUTS.oneSecond);\n }\n return;\n }\n default:\n break;\n }\n }),\n [close, healthcheckFailed, onMessageReceived, onNotify, sendMessage]\n );\n\n const onSocketError = useCallback(\n (error: Event): void => {\n onNotify(`WebSocket error: ${(error as ErrorEvent).message || 'Unknown error'}`);\n close();\n clearTimeout(healthcheckTimeout.current);\n },\n [close, onNotify]\n );\n\n const onSocketOpen = useCallback((): void => {\n sendMessage({ typ: MessageTypes.New, props: {} });\n onOpen(true);\n }, [onOpen, sendMessage]);\n\n const onSocketClose = useCallback(\n (e: CloseEvent): void => {\n console.log('closing');\n onClose(e);\n close();\n },\n [close, onClose]\n );\n\n const connect = useCallback(\n (deviceId: string): void => {\n const uri = `wss://${window.location.host}${apiUrl.v1}/deviceconnect/devices/${deviceId}/connect`;\n setSessionId(undefined);\n cookies.set('JWT', token, { path: '/', secure: true, sameSite: 'strict', maxAge: 5 });\n try {\n socketRef.current = new WebSocket(uri);\n } catch (error) {\n console.log(error);\n }\n },\n [token]\n );\n\n useEffect(() => {\n const currentSocket = socketRef.current;\n if (!currentSocket) {\n return;\n }\n\n currentSocket.addEventListener('close', onSocketClose);\n currentSocket.addEventListener('error', onSocketError);\n currentSocket.addEventListener('message', onSocketMessage);\n currentSocket.addEventListener('open', onSocketOpen);\n\n return () => {\n currentSocket.removeEventListener('close', onSocketClose);\n currentSocket.removeEventListener('error', onSocketError);\n currentSocket.removeEventListener('message', onSocketMessage);\n currentSocket.removeEventListener('open', onSocketOpen);\n };\n // eslint-disable-next-line react-hooks/refs\n }, [onSocketClose, onSocketError, onSocketMessage, onSocketOpen, socketRef.current?.readyState]);\n\n // eslint-disable-next-line react-hooks/refs\n return [connect, sendMessage, close, socketRef.current?.readyState ?? WebSocket.CLOSED, sessionId];\n};\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,UAAU,IAAIA,iBAAAA,QAAQ;AAG5B,MAAM,cAAc,IAAIC,SAAAA,MAAM;CAAE,YAAY,CAAC,KAAA,CAAS;CAAG,YAAY;AAAM,CAAC;AA2B5E,MAAa,cAAc,EAAE,SAAS,qBAAqB,mBAAmB,UAAU,QAAQ,YAA+C;CAC7I,MAAM,CAAC,WAAW,iBAAA,GAAgBC,MAAAA,SAAAA,CAA6B;CAC/D,MAAM,sBAAA,GAAqBC,MAAAA,OAAAA,CAAkD,KAAA,CAAS;CACtF,MAAM,aAAA,GAAYA,MAAAA,OAAAA,CAAqC,KAAA,CAAS;CAChE,MAAM,eAAA,GAAcC,MAAAA,YAAAA,EAAa,EAAE,KAAK,MAAM,YAAgC;EAC5E,IAAI,CAAC,UAAU,SACb;EAEF,MAAM,eAAe;GAAE,OAAOC,kBAAAA,yBAAiB;GAAO;GAAK,KAAK,UAAU,QAAQ;GAAW;EAAM;EACnG,MAAM,cAAc,YAAY,KAAK;GAAE,KAAK;GAAc;EAAK,CAAC;EAChE,UAAU,QAAQ,KAAK,WAAW;CACpC,GAAG,CAAC,CAAC;CAEL,MAAM,SAAA,GAAQD,MAAAA,YAAAA,OAAwB;EACpC,IAAI,CAAC,UAAU,WAAW,UAAU,SAAS,eAAe,UAAU,MACpE;EAEF,YAAY;GAAE,KAAKE,kBAAAA,qBAAa;GAAM,OAAO,CAAC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oBAAoB,WAAW,eAAe;GAC5D,cAAc,oBAAoB,QAAQ,YAAY;EACxD;CAEF,GAAG;EAAC;EAAe;EAAe;EAAiB;EAAc,UAAU,SAAS;CAAU,CAAC;CAG/F,OAAO;EAAC;EAAS;EAAa;EAAO,UAAU,SAAS,cAAc,UAAU;EAAQ;CAAS;AACnG"}
1
+ {"version":3,"file":"sockethook.cjs","names":["Cookies","Packr","useState","useRef","useCallback","MessageProtocols","MessageTypes","blobToString","byteArrayToString","TIMEOUTS","apiUrl"],"sources":["../src/sockethook.ts"],"sourcesContent":["// Copyright 2022 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 { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { TIMEOUTS } from '@northern.tech/utils/constants';\nimport { blobToString, byteArrayToString } from '@northern.tech/utils/helpers';\nimport { Packr } from 'msgpackr';\nimport Cookies from 'universal-cookie';\n\nimport { DEVICE_MESSAGE_PROTOCOLS as MessageProtocols, DEVICE_MESSAGE_TYPES as MessageTypes, apiUrl } from './constants';\n\nconst cookies = new Cookies();\n\n// plain maps + omitted undefined fields keep the wire format compatible with the deviceconnect backend\nconst MessagePack = new Packr({ skipValues: [undefined], useRecords: false });\n\ntype UseSessionProps = {\n onClose: (event: CloseEvent) => void;\n onHealthCheckFailed: () => void;\n onMessageReceived: (body: Uint8Array) => void;\n onNotify: (message: string) => void;\n onOpen: (isOpen: boolean) => void;\n token: string;\n};\n\ntype MessageProps = {\n body?: Uint8Array;\n props: Record<string, string | number>;\n typ: string;\n};\n\ntype SessionWebSocket = WebSocket & { sessionId?: string };\n\ntype UseSessionReturn = [\n connect: (deviceId: string) => void,\n sendMessage: (message: MessageProps) => void,\n close: () => void,\n readyState: number,\n sessionId: string | undefined\n];\n\nexport const useSession = ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify, onOpen, token }: UseSessionProps): UseSessionReturn => {\n const [sessionId, setSessionId] = useState<string | undefined>();\n const healthcheckTimeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const socketRef = useRef<SessionWebSocket | undefined>(undefined);\n const sendMessage = useCallback(({ typ, body, props }: MessageProps): void => {\n if (!socketRef.current) {\n return;\n }\n const proto_header = { proto: MessageProtocols.Shell, typ, sid: socketRef.current.sessionId, props };\n const encodedData = MessagePack.pack({ hdr: proto_header, body });\n socketRef.current.send(encodedData);\n }, []);\n\n const close = useCallback((): void => {\n clearTimeout(healthcheckTimeout.current);\n if (!socketRef.current || socketRef.current?.readyState !== WebSocket.OPEN) {\n return;\n }\n sendMessage({ typ: MessageTypes.Stop, props: {} });\n socketRef.current.close();\n setSessionId(undefined);\n }, [sendMessage]);\n\n const healthcheckFailed = useCallback((): void => {\n onHealthCheckFailed();\n close();\n }, [close, onHealthCheckFailed]);\n\n const onSocketMessage = useCallback(\n (event: MessageEvent): Promise<void> =>\n blobToString(event.data).then((data: unknown) => {\n const {\n hdr: { props = {} as Record<string, string | number>, proto, sid, typ },\n body\n } = MessagePack.unpack(new Uint8Array(data as ArrayBuffer)) as {\n body: Uint8Array;\n hdr: { props: Record<string, string | number>; proto: number; sid: string; typ: string };\n };\n if (proto !== MessageProtocols.Shell) {\n return;\n }\n switch (typ) {\n case MessageTypes.New: {\n if (props.status == WebSocket.CLOSING) {\n onNotify(`Error: ${byteArrayToString(body as unknown as Buffer)}`);\n setSessionId(undefined);\n return close();\n } else {\n clearTimeout(healthcheckTimeout.current);\n healthcheckTimeout.current = setTimeout(healthcheckFailed, 65 * TIMEOUTS.oneSecond);\n if (socketRef.current) {\n socketRef.current.sessionId = sid;\n }\n return setSessionId(sid);\n }\n }\n case MessageTypes.Shell:\n return onMessageReceived(body);\n case MessageTypes.Stop:\n return close();\n case MessageTypes.Ping: {\n if (healthcheckTimeout.current) {\n clearTimeout(healthcheckTimeout.current);\n }\n sendMessage({ typ: MessageTypes.Pong, props: {} });\n const timeout = parseInt(props.timeout as string);\n if (timeout > 0) {\n healthcheckTimeout.current = setTimeout(healthcheckFailed, timeout * TIMEOUTS.oneSecond);\n }\n return;\n }\n default:\n break;\n }\n }),\n [close, healthcheckFailed, onMessageReceived, onNotify, sendMessage]\n );\n\n const onSocketError = useCallback(\n (error: Event): void => {\n onNotify(`WebSocket error: ${(error as ErrorEvent).message || 'Unknown error'}`);\n close();\n },\n [close, onNotify]\n );\n\n const onSocketOpen = useCallback((): void => {\n sendMessage({ typ: MessageTypes.New, props: {} });\n onOpen(true);\n }, [onOpen, sendMessage]);\n\n const onSocketClose = useCallback(\n (e: CloseEvent): void => {\n console.log('closing');\n onClose(e);\n close();\n },\n [close, onClose]\n );\n\n const connect = useCallback(\n (deviceId: string): void => {\n const uri = `wss://${window.location.host}${apiUrl.v1}/deviceconnect/devices/${deviceId}/connect`;\n setSessionId(undefined);\n cookies.set('JWT', token, { path: '/', secure: true, sameSite: 'strict', maxAge: 5 });\n try {\n socketRef.current = new WebSocket(uri);\n } catch (error) {\n console.log(error);\n }\n },\n [token]\n );\n\n useEffect(() => {\n const currentSocket = socketRef.current;\n if (!currentSocket) {\n return;\n }\n\n currentSocket.addEventListener('close', onSocketClose);\n currentSocket.addEventListener('error', onSocketError);\n currentSocket.addEventListener('message', onSocketMessage);\n currentSocket.addEventListener('open', onSocketOpen);\n\n return () => {\n currentSocket.removeEventListener('close', onSocketClose);\n currentSocket.removeEventListener('error', onSocketError);\n currentSocket.removeEventListener('message', onSocketMessage);\n currentSocket.removeEventListener('open', onSocketOpen);\n };\n // eslint-disable-next-line react-hooks/refs\n }, [onSocketClose, onSocketError, onSocketMessage, onSocketOpen, socketRef.current?.readyState]);\n\n // eslint-disable-next-line react-hooks/refs\n return [connect, sendMess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AE,KAAKE,kBAAAA,qBAAa;GAAK,OAAO,CAAC;EAAE,CAAC;EAChD,OAAO,IAAI;CACb,GAAG,CAAC,QAAQ,WAAW,CAAC;CAExB,MAAM,iBAAA,GAAgBF,MAAAA,YAAAA,EACnB,MAAwB;EACvB,QAAQ,IAAI,SAAS;EACrB,QAAQ,CAAC;EACT,MAAM;CACR,GACA,CAAC,OAAO,OAAO,CACjB;CAEA,MAAM,WAAA,GAAUA,MAAAA,YAAAA,EACb,aAA2B;EAC1B,MAAM,MAAM,SAAS,OAAO,SAAS,OAAOM,+BAAAA,OAAO,GAAG,yBAAyB,SAAS;EACxF,aAAa,KAAA,CAAS;EACtB,QAAQ,IAAI,OAAO,OAAO;GAAE,MAAM;GAAK,QAAQ;GAAM,UAAU;GAAU,QAAQ;EAAE,CAAC;EACpF,IAAI;GACF,UAAU,UAAU,IAAI,UAAU,GAAG;EACvC,SAAS,OAAO;GACd,QAAQ,IAAI,KAAK;EACnB;CACF,GACA,CAAC,KAAK,CACR;CAEA,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,MAAM,gBAAgB,UAAU;EAChC,IAAI,CAAC,eACH;EAGF,cAAc,iBAAiB,SAAS,aAAa;EACrD,cAAc,iBAAiB,SAAS,aAAa;EACrD,cAAc,iBAAiB,WAAW,eAAe;EACzD,cAAc,iBAAiB,QAAQ,YAAY;EAEnD,aAAa;GACX,cAAc,oBAAoB,SAAS,aAAa;GACxD,cAAc,oBAAoB,SAAS,aAAa;GACxD,cAAc,oBAAoB,WAAW,eAAe;GAC5D,cAAc,oBAAoB,QAAQ,YAAY;EACxD;CAEF,GAAG;EAAC;EAAe;EAAe;EAAiB;EAAc,UAAU,SAAS;CAAU,CAAC;CAG/F,OAAO;EAAC;EAAS;EAAa;EAAO,UAAU,SAAS,cAAc,UAAU;EAAQ;CAAS;AACnG"}
@@ -15,4 +15,5 @@ type MessageProps = {
15
15
  type UseSessionReturn = [connect: (deviceId: string) => void, sendMessage: (message: MessageProps) => void, close: () => void, readyState: number, sessionId: string | undefined];
16
16
  export declare const useSession: ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify, onOpen, token }: UseSessionProps) => UseSessionReturn;
17
17
  //#endregion
18
+ export {};
18
19
  //# sourceMappingURL=sockethook.d.cts.map
@@ -15,4 +15,5 @@ type MessageProps = {
15
15
  type UseSessionReturn = [connect: (deviceId: string) => void, sendMessage: (message: MessageProps) => void, close: () => void, readyState: number, sessionId: string | undefined];
16
16
  export declare const useSession: ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify, onOpen, token }: UseSessionProps) => UseSessionReturn;
17
17
  //#endregion
18
+ export {};
18
19
  //# sourceMappingURL=sockethook.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dt as DEVICE_MESSAGE_TYPES, h as apiUrl, ut as DEVICE_MESSAGE_PROTOCOLS } from "./constants-DjiC_FnZ.js";
1
+ import { ft as DEVICE_MESSAGE_PROTOCOLS, h as apiUrl, pt as DEVICE_MESSAGE_TYPES } from "./constants-TPYvZDsI.js";
2
2
  import { TIMEOUTS } from "@northern.tech/utils/constants";
3
3
  import { blobToString, byteArrayToString } from "@northern.tech/utils/helpers";
4
4
  import Cookies from "universal-cookie";
@@ -29,6 +29,7 @@ const useSession = ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify,
29
29
  socketRef.current.send(encodedData);
30
30
  }, []);
31
31
  const close = useCallback(() => {
32
+ clearTimeout(healthcheckTimeout.current);
32
33
  if (!socketRef.current || socketRef.current?.readyState !== WebSocket.OPEN) return;
33
34
  sendMessage({
34
35
  typ: DEVICE_MESSAGE_TYPES.Stop,
@@ -78,7 +79,6 @@ const useSession = ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify,
78
79
  const onSocketError = useCallback((error) => {
79
80
  onNotify(`WebSocket error: ${error.message || "Unknown error"}`);
80
81
  close();
81
- clearTimeout(healthcheckTimeout.current);
82
82
  }, [close, onNotify]);
83
83
  const onSocketOpen = useCallback(() => {
84
84
  sendMessage({
@@ -1 +1 @@
1
- {"version":3,"file":"sockethook.js","names":["MessageProtocols","MessageTypes"],"sources":["../src/sockethook.ts"],"sourcesContent":["// Copyright 2022 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 { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { TIMEOUTS } from '@northern.tech/utils/constants';\nimport { blobToString, byteArrayToString } from '@northern.tech/utils/helpers';\nimport { Packr } from 'msgpackr';\nimport Cookies from 'universal-cookie';\n\nimport { DEVICE_MESSAGE_PROTOCOLS as MessageProtocols, DEVICE_MESSAGE_TYPES as MessageTypes, apiUrl } from './constants';\n\nconst cookies = new Cookies();\n\n// plain maps + omitted undefined fields keep the wire format compatible with the deviceconnect backend\nconst MessagePack = new Packr({ skipValues: [undefined], useRecords: false });\n\ntype UseSessionProps = {\n onClose: (event: CloseEvent) => void;\n onHealthCheckFailed: () => void;\n onMessageReceived: (body: Uint8Array) => void;\n onNotify: (message: string) => void;\n onOpen: (isOpen: boolean) => void;\n token: string;\n};\n\ntype MessageProps = {\n body?: Uint8Array;\n props: Record<string, string | number>;\n typ: string;\n};\n\ntype SessionWebSocket = WebSocket & { sessionId?: string };\n\ntype UseSessionReturn = [\n connect: (deviceId: string) => void,\n sendMessage: (message: MessageProps) => void,\n close: () => void,\n readyState: number,\n sessionId: string | undefined\n];\n\nexport const useSession = ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify, onOpen, token }: UseSessionProps): UseSessionReturn => {\n const [sessionId, setSessionId] = useState<string | undefined>();\n const healthcheckTimeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const socketRef = useRef<SessionWebSocket | undefined>(undefined);\n const sendMessage = useCallback(({ typ, body, props }: MessageProps): void => {\n if (!socketRef.current) {\n return;\n }\n const proto_header = { proto: MessageProtocols.Shell, typ, sid: socketRef.current.sessionId, props };\n const encodedData = MessagePack.pack({ hdr: proto_header, body });\n socketRef.current.send(encodedData);\n }, []);\n\n const close = useCallback((): void => {\n if (!socketRef.current || socketRef.current?.readyState !== WebSocket.OPEN) {\n return;\n }\n sendMessage({ typ: MessageTypes.Stop, props: {} });\n socketRef.current.close();\n setSessionId(undefined);\n }, [sendMessage]);\n\n const healthcheckFailed = useCallback((): void => {\n onHealthCheckFailed();\n close();\n }, [close, onHealthCheckFailed]);\n\n const onSocketMessage = useCallback(\n (event: MessageEvent): Promise<void> =>\n blobToString(event.data).then((data: unknown) => {\n const {\n hdr: { props = {} as Record<string, string | number>, proto, sid, typ },\n body\n } = MessagePack.unpack(new Uint8Array(data as ArrayBuffer)) as {\n body: Uint8Array;\n hdr: { props: Record<string, string | number>; proto: number; sid: string; typ: string };\n };\n if (proto !== MessageProtocols.Shell) {\n return;\n }\n switch (typ) {\n case MessageTypes.New: {\n if (props.status == WebSocket.CLOSING) {\n onNotify(`Error: ${byteArrayToString(body as unknown as Buffer)}`);\n setSessionId(undefined);\n return close();\n } else {\n clearTimeout(healthcheckTimeout.current);\n healthcheckTimeout.current = setTimeout(healthcheckFailed, 65 * TIMEOUTS.oneSecond);\n if (socketRef.current) {\n socketRef.current.sessionId = sid;\n }\n return setSessionId(sid);\n }\n }\n case MessageTypes.Shell:\n return onMessageReceived(body);\n case MessageTypes.Stop:\n return close();\n case MessageTypes.Ping: {\n if (healthcheckTimeout.current) {\n clearTimeout(healthcheckTimeout.current);\n }\n sendMessage({ typ: MessageTypes.Pong, props: {} });\n const timeout = parseInt(props.timeout as string);\n if (timeout > 0) {\n healthcheckTimeout.current = setTimeout(healthcheckFailed, timeout * TIMEOUTS.oneSecond);\n }\n return;\n }\n default:\n break;\n }\n }),\n [close, healthcheckFailed, onMessageReceived, onNotify, sendMessage]\n );\n\n const onSocketError = useCallback(\n (error: Event): void => {\n onNotify(`WebSocket error: ${(error as ErrorEvent).message || 'Unknown error'}`);\n close();\n clearTimeout(healthcheckTimeout.current);\n },\n [close, onNotify]\n );\n\n const onSocketOpen = useCallback((): void => {\n sendMessage({ typ: MessageTypes.New, props: {} });\n onOpen(true);\n }, [onOpen, sendMessage]);\n\n const onSocketClose = useCallback(\n (e: CloseEvent): void => {\n console.log('closing');\n onClose(e);\n close();\n },\n [close, onClose]\n );\n\n const connect = useCallback(\n (deviceId: string): void => {\n const uri = `wss://${window.location.host}${apiUrl.v1}/deviceconnect/devices/${deviceId}/connect`;\n setSessionId(undefined);\n cookies.set('JWT', token, { path: '/', secure: true, sameSite: 'strict', maxAge: 5 });\n try {\n socketRef.current = new WebSocket(uri);\n } catch (error) {\n console.log(error);\n }\n },\n [token]\n );\n\n useEffect(() => {\n const currentSocket = socketRef.current;\n if (!currentSocket) {\n return;\n }\n\n currentSocket.addEventListener('close', onSocketClose);\n currentSocket.addEventListener('error', onSocketError);\n currentSocket.addEventListener('message', onSocketMessage);\n currentSocket.addEventListener('open', onSocketOpen);\n\n return () => {\n currentSocket.removeEventListener('close', onSocketClose);\n currentSocket.removeEventListener('error', onSocketError);\n currentSocket.removeEventListener('message', onSocketMessage);\n currentSocket.removeEventListener('open', onSocketOpen);\n };\n // eslint-disable-next-line react-hooks/refs\n }, [onSocketClose, onSocketError, onSocketMessage, onSocketOpen, socketRef.current?.readyState]);\n\n // eslint-disable-next-line react-hooks/refs\n return [connect, sendMessage, close, socketRef.current?.readyState ?? WebSocket.CLOSED, sessionId];\n};\n"],"mappings":";;;;;;;AAsBA,MAAM,UAAU,IAAI,QAAQ;AAG5B,MAAM,cAAc,IAAI,MAAM;CAAE,YAAY,CAAC,KAAA,CAAS;CAAG,YAAY;AAAM,CAAC;AA2B5E,MAAa,cAAc,EAAE,SAAS,qBAAqB,mBAAmB,UAAU,QAAQ,YAA+C;CAC7I,MAAM,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AAI,CAAC,eACH;EAGF,cAAc,iBAAiB,SAAS,aAAa;EACrD,cAAc,iBAAiB,SAAS,aAAa;EACrD,cAAc,iBAAiB,WAAW,eAAe;EACzD,cAAc,iBAAiB,QAAQ,YAAY;EAEnD,aAAa;GACX,cAAc,oBAAoB,SAAS,aAAa;GACxD,cAAc,oBAAoB,SAAS,aAAa;GACxD,cAAc,oBAAoB,WAAW,eAAe;GAC5D,cAAc,oBAAoB,QAAQ,YAAY;EACxD;CAEF,GAAG;EAAC;EAAe;EAAe;EAAiB;EAAc,UAAU,SAAS;CAAU,CAAC;CAG/F,OAAO;EAAC;EAAS;EAAa;EAAO,UAAU,SAAS,cAAc,UAAU;EAAQ;CAAS;AACnG"}
1
+ {"version":3,"file":"sockethook.js","names":["MessageProtocols","MessageTypes"],"sources":["../src/sockethook.ts"],"sourcesContent":["// Copyright 2022 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 { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { TIMEOUTS } from '@northern.tech/utils/constants';\nimport { blobToString, byteArrayToString } from '@northern.tech/utils/helpers';\nimport { Packr } from 'msgpackr';\nimport Cookies from 'universal-cookie';\n\nimport { DEVICE_MESSAGE_PROTOCOLS as MessageProtocols, DEVICE_MESSAGE_TYPES as MessageTypes, apiUrl } from './constants';\n\nconst cookies = new Cookies();\n\n// plain maps + omitted undefined fields keep the wire format compatible with the deviceconnect backend\nconst MessagePack = new Packr({ skipValues: [undefined], useRecords: false });\n\ntype UseSessionProps = {\n onClose: (event: CloseEvent) => void;\n onHealthCheckFailed: () => void;\n onMessageReceived: (body: Uint8Array) => void;\n onNotify: (message: string) => void;\n onOpen: (isOpen: boolean) => void;\n token: string;\n};\n\ntype MessageProps = {\n body?: Uint8Array;\n props: Record<string, string | number>;\n typ: string;\n};\n\ntype SessionWebSocket = WebSocket & { sessionId?: string };\n\ntype UseSessionReturn = [\n connect: (deviceId: string) => void,\n sendMessage: (message: MessageProps) => void,\n close: () => void,\n readyState: number,\n sessionId: string | undefined\n];\n\nexport const useSession = ({ onClose, onHealthCheckFailed, onMessageReceived, onNotify, onOpen, token }: UseSessionProps): UseSessionReturn => {\n const [sessionId, setSessionId] = useState<string | undefined>();\n const healthcheckTimeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const socketRef = useRef<SessionWebSocket | undefined>(undefined);\n const sendMessage = useCallback(({ typ, body, props }: MessageProps): void => {\n if (!socketRef.current) {\n return;\n }\n const proto_header = { proto: MessageProtocols.Shell, typ, sid: socketRef.current.sessionId, props };\n const encodedData = MessagePack.pack({ hdr: proto_header, body });\n socketRef.current.send(encodedData);\n }, []);\n\n const close = useCallback((): void => {\n clearTimeout(healthcheckTimeout.current);\n if (!socketRef.current || socketRef.current?.readyState !== WebSocket.OPEN) {\n return;\n }\n sendMessage({ typ: MessageTypes.Stop, props: {} });\n socketRef.current.close();\n setSessionId(undefined);\n }, [sendMessage]);\n\n const healthcheckFailed = useCallback((): void => {\n onHealthCheckFailed();\n close();\n }, [close, onHealthCheckFailed]);\n\n const onSocketMessage = useCallback(\n (event: MessageEvent): Promise<void> =>\n blobToString(event.data).then((data: unknown) => {\n const {\n hdr: { props = {} as Record<string, string | number>, proto, sid, typ },\n body\n } = MessagePack.unpack(new Uint8Array(data as ArrayBuffer)) as {\n body: Uint8Array;\n hdr: { props: Record<string, string | number>; proto: number; sid: string; typ: string };\n };\n if (proto !== MessageProtocols.Shell) {\n return;\n }\n switch (typ) {\n case MessageTypes.New: {\n if (props.status == WebSocket.CLOSING) {\n onNotify(`Error: ${byteArrayToString(body as unknown as Buffer)}`);\n setSessionId(undefined);\n return close();\n } else {\n clearTimeout(healthcheckTimeout.current);\n healthcheckTimeout.current = setTimeout(healthcheckFailed, 65 * TIMEOUTS.oneSecond);\n if (socketRef.current) {\n socketRef.current.sessionId = sid;\n }\n return setSessionId(sid);\n }\n }\n case MessageTypes.Shell:\n return onMessageReceived(body);\n case MessageTypes.Stop:\n return close();\n case MessageTypes.Ping: {\n if (healthcheckTimeout.current) {\n clearTimeout(healthcheckTimeout.current);\n }\n sendMessage({ typ: MessageTypes.Pong, props: {} });\n const timeout = parseInt(props.timeout as string);\n if (timeout > 0) {\n healthcheckTimeout.current = setTimeout(healthcheckFailed, timeout * TIMEOUTS.oneSecond);\n }\n return;\n }\n default:\n break;\n }\n }),\n [close, healthcheckFailed, onMessageReceived, onNotify, sendMessage]\n );\n\n const onSocketError = useCallback(\n (error: Event): void => {\n onNotify(`WebSocket error: ${(error as ErrorEvent).message || 'Unknown error'}`);\n close();\n },\n [close, onNotify]\n );\n\n const onSocketOpen = useCallback((): void => {\n sendMessage({ typ: MessageTypes.New, props: {} });\n onOpen(true);\n }, [onOpen, sendMessage]);\n\n const onSocketClose = useCallback(\n (e: CloseEvent): void => {\n console.log('closing');\n onClose(e);\n close();\n },\n [close, onClose]\n );\n\n const connect = useCallback(\n (deviceId: string): void => {\n const uri = `wss://${window.location.host}${apiUrl.v1}/deviceconnect/devices/${deviceId}/connect`;\n setSessionId(undefined);\n cookies.set('JWT', token, { path: '/', secure: true, sameSite: 'strict', maxAge: 5 });\n try {\n socketRef.current = new WebSocket(uri);\n } catch (error) {\n console.log(error);\n }\n },\n [token]\n );\n\n useEffect(() => {\n const currentSocket = socketRef.current;\n if (!currentSocket) {\n return;\n }\n\n currentSocket.addEventListener('close', onSocketClose);\n currentSocket.addEventListener('error', onSocketError);\n currentSocket.addEventListener('message', onSocketMessage);\n currentSocket.addEventListener('open', onSocketOpen);\n\n return () => {\n currentSocket.removeEventListener('close', onSocketClose);\n currentSocket.removeEventListener('error', onSocketError);\n currentSocket.removeEventListener('message', onSocketMessage);\n currentSocket.removeEventListener('open', onSocketOpen);\n };\n // eslint-disable-next-line react-hooks/refs\n }, [onSocketClose, onSocketError, onSocketMessage, onSocketOpen, socketRef.current?.readyState]);\n\n // eslint-disable-next-line react-hooks/refs\n return [connect, sendMessage, close, socketRef.current?.readyState ?? WebSocket.CLOSED, sessionId];\n};\n"],"mappings":";;;;;;;AAsBA,MAAM,UAAU,IAAI,QAAQ;AAG5B,MAAM,cAAc,IAAI,MAAM;CAAE,YAAY,CAAC,KAAA,CAAS;CAAG,YAAY;AAAM,CAAC;AA2B5E,MAAa,cAAc,EAAE,SAAS,qBAAqB,mBAAmB,UAAU,QAAQ,YAA+C;CAC7I,MAAM,CAAC,WAAW,gBAAgB,SAA6B;CAC/D,MAAM,qBAAqB,OAAkD,KAAA,CAAS;CACtF,MAAM,YAAY,OAAqC,KAAA,CAAS;CAChE,MAAM,cAAc,aAAa,EAAE,KAAK,MAAM,YAAgC;EAC5E,IAAI,CAAC,UAAU,SACb;EAEF,MAAM,eAAe;GAAE,OAAOA,yBAAiB;GAAO;GAAK,KAAK,UAAU,QAAQ;GAAW;EAAM;EACnG,MAAM,cAAc,YAAY,KAAK;GAAE,KAAK;GAAc;EAAK,CAAC;EAChE,UAAU,QAAQ,KAAK,WAAW;CACpC,GAAG,CAAC,CAAC;CAEL,MAAM,QAAQ,kBAAwB;EACpC,aAAa,mBAAmB,OAAO;EACvC,IAAI,CAAC,UAAU,WAAW,UAAU,SAAS,eAAe,UAAU,MACpE;EAEF,YAAY;GAAE,KAAKC,qBAAa;GAAM,OAAO,CAAC;EAAE,CAAC;EACjD,UAAU,QAAQ,MAAM;EACxB,aAAa,KAAA,CAAS;CACxB,GAAG,CAAC,WAAW,CAAC;CAEhB,MAAM,oBAAoB,kBAAwB;EAChD,oBAAoB;EACpB,MAAM;CACR,GAAG,CAAC,OAAO,mBAAmB,CAAC;CAE/B,MAAM,kBAAkB,aACrB,UACC,aAAa,MAAM,IAAI,CAAC,C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Q,CAAC;EACT,MAAM;CACR,GACA,CAAC,OAAO,OAAO,CACjB;CAEA,MAAM,UAAU,aACb,aAA2B;EAC1B,MAAM,MAAM,SAAS,OAAO,SAAS,OAAO,OAAO,GAAG,yBAAyB,SAAS;EACxF,aAAa,KAAA,CAAS;EACtB,QAAQ,IAAI,OAAO,OAAO;GAAE,MAAM;GAAK,QAAQ;GAAM,UAAU;GAAU,QAAQ;EAAE,CAAC;EACpF,IAAI;GACF,UAAU,UAAU,IAAI,UAAU,GAAG;EACvC,SAAS,OAAO;GACd,QAAQ,IAAI,KAAK;EACnB;CACF,GACA,CAAC,KAAK,CACR;CAEA,gBAAgB;EACd,MAAM,gBAAgB,UAAU;EAChC,IAAI,CAAC,eACH;EAGF,cAAc,iBAAiB,SAAS,aAAa;EACrD,cAAc,iBAAiB,SAAS,aAAa;EACrD,cAAc,iBAAiB,WAAW,eAAe;EACzD,cAAc,iBAAiB,QAAQ,YAAY;EAEnD,aAAa;GACX,cAAc,oBAAoB,SAAS,aAAa;GACxD,cAAc,oBAAoB,SAAS,aAAa;GACxD,cAAc,oBAAoB,WAAW,eAAe;GAC5D,cAAc,oBAAoB,QAAQ,YAAY;EACxD;CAEF,GAAG;EAAC;EAAe;EAAe;EAAiB;EAAc,UAAU,SAAS;CAAU,CAAC;CAG/F,OAAO;EAAC;EAAS;EAAa;EAAO,UAAU,SAAS,cAAc,UAAU;EAAQ;CAAS;AACnG"}
@@ -1,13 +1,13 @@
1
- import { H as emptyUiPermissions, S as Role, m as DeviceIssueOptionKey, wt as FilterOperator } from "./constants-CCkKh9KM.js";
2
- import { o as UserSliceType } from "./index-C1vNDCYR.js";
3
- import { a as ReleaseSliceType } from "./index-o_m7WKiR.js";
4
- import { a as PricePreview } from "./types-B2gphGj8.js";
1
+ import { Et as FilterOperator, H as emptyUiPermissions, S as Role, m as DeviceIssueOptionKey } from "./constants-BtVu36ou.js";
2
+ import { o as UserSliceType } from "./index-oFn9qHWB.js";
3
+ import { a as ReleaseSliceType } from "./index-CVsuKFks.js";
4
+ import { a as PricePreview } from "./types-DQtRiyGK.js";
5
5
  import { n as OnboardingSliceType } from "./index-CoObjWL4.js";
6
6
  import { o as DeploymentsSliceType, t as Deployment } from "./index-B8td4-rY.js";
7
- import { c as DeviceSliceType, i as DeviceGroup, r as DeviceFilter, u as InventoryAttributes } from "./index-DOPRnlaC.js";
8
- import { t as AppSliceType } from "./index-CThE5Gfh.js";
9
- import { t as MonitorSliceType } from "./index-C2za83Qs.js";
10
- import { t as OrganizationSliceType } from "./index-CvMpbsOo.js";
7
+ import { c as DeviceSliceType, i as DeviceGroup, r as DeviceFilter, u as InventoryAttributes } from "./index-Bc7Ugak_.js";
8
+ import { t as AppSliceType } from "./index-sw1Baeui.js";
9
+ import { t as MonitorSliceType } from "./index-Cai4oXpN.js";
10
+ import { t as OrganizationSliceType } from "./index-TS08J8mY.js";
11
11
  import { Reducer, UnknownAction } from "@reduxjs/toolkit";
12
12
  import { isDarkMode as isDarkMode$1 } from "@northern.tech/utils/helpers";
13
13
  import { TypedUseSelectorHook } from "react-redux";
@@ -302,4 +302,4 @@ declare const createAppAsyncThunk: import("@reduxjs/toolkit").CreateAsyncThunkFu
302
302
  };
303
303
  //#endregion
304
304
  export { mapFiltersToTerms as A, getAttributeScopeLabel as C, isDarkMode$1 as D, groupDeploymentStats as E, progress as F, statCollector as I, stringToBoolean as L, mapUserRolesToUiPermissions as M, mergePermissions as N, listItemMapper as O, parseSubscriptionPreview as P, stripOrchestratorManifestPrefix as R, generateDeploymentGroupDetails as S, groupDeploymentDevicesStats as T, convertToBackendSPLimits as _, commonErrorFallback as a, extractErrorMessage$1 as b, getConfiguredStore as c, useAppDispatch as d, useAppSelector as f, convertDeviceListStateToFilters as g, FilterTerm as h, RootState as i, mapTermsToFilters as j, mapDeviceAttributes as k, resetEnvironment as l, ErrorWithResponse as m, AppStore as n, commonErrorHandler as o, DeploymentStats as p, MenderEnvironment as r, createAppAsyncThunk as s, AppDispatch as t, sessionReducer as u, dispatchDelayed as v, getDeploymentState as w, filtersFilter as x, ensureVersionString as y, stripUndefined as z };
305
- //# sourceMappingURL=store-v5V-bbB_.d.ts.map
305
+ //# sourceMappingURL=store-CROmfENq.d.ts.map
@@ -1,13 +1,13 @@
1
- import { H as emptyUiPermissions, S as Role, m as DeviceIssueOptionKey, wt as FilterOperator } from "./constants-CUwYPOYK.cjs";
2
- import { o as UserSliceType } from "./index-DNYeo7wc.cjs";
3
- import { a as ReleaseSliceType } from "./index-BWtIaimn.cjs";
4
- import { a as PricePreview } from "./types-CLASWtVP.cjs";
1
+ import { Et as FilterOperator, H as emptyUiPermissions, S as Role, m as DeviceIssueOptionKey } from "./constants-DsJM7i1a.cjs";
2
+ import { o as UserSliceType } from "./index-D0DMxU8O.cjs";
3
+ import { a as ReleaseSliceType } from "./index-BnWRWRyV.cjs";
4
+ import { a as PricePreview } from "./types-DXm-HM-j.cjs";
5
5
  import { n as OnboardingSliceType } from "./index-CoObjWL4.cjs";
6
6
  import { o as DeploymentsSliceType, t as Deployment } from "./index-mvxjivTJ.cjs";
7
- import { c as DeviceSliceType, i as DeviceGroup, r as DeviceFilter, u as InventoryAttributes } from "./index-7jVuB4tG.cjs";
8
- import { t as AppSliceType } from "./index-CaNZaXie.cjs";
9
- import { t as MonitorSliceType } from "./index-BcrZxKLw.cjs";
10
- import { t as OrganizationSliceType } from "./index-CzQRHJ6f.cjs";
7
+ import { c as DeviceSliceType, i as DeviceGroup, r as DeviceFilter, u as InventoryAttributes } from "./index-3mpuzSLi.cjs";
8
+ import { t as AppSliceType } from "./index-CwjRezv2.cjs";
9
+ import { t as MonitorSliceType } from "./index-BP392nKV.cjs";
10
+ import { t as OrganizationSliceType } from "./index-DTeKxs80.cjs";
11
11
  import { AttributeFilterPredicate, AttributeResponse, FilterV2, InvoiceLineItem, Scope } from "@northern.tech/types/MenderTypes";
12
12
  import { Reducer, UnknownAction } from "@reduxjs/toolkit";
13
13
  import { AxiosError } from "axios";
@@ -302,4 +302,4 @@ declare const createAppAsyncThunk: import("@reduxjs/toolkit").CreateAsyncThunkFu
302
302
  };
303
303
  //#endregion
304
304
  export { mapFiltersToTerms as A, getAttributeScopeLabel as C, isDarkMode as D, groupDeploymentStats as E, progress as F, statCollector as I, stringToBoolean as L, mapUserRolesToUiPermissions as M, mergePermissions as N, listItemMapper as O, parseSubscriptionPreview as P, stripOrchestratorManifestPrefix as R, generateDeploymentGroupDetails as S, groupDeploymentDevicesStats as T, convertToBackendSPLimits as _, commonErrorFallback as a, extractErrorMessage as b, getConfiguredStore as c, useAppDispatch as d, useAppSelector as f, convertDeviceListStateToFilters as g, FilterTerm as h, RootState as i, mapTermsToFilters as j, mapDeviceAttributes as k, resetEnvironment as l, ErrorWithResponse as m, AppStore as n, commonErrorHandler as o, DeploymentStats as p, MenderEnvironment as r, createAppAsyncThunk as s, AppDispatch as t, sessionReducer as u, dispatchDelayed as v, getDeploymentState as w, filtersFilter as x, ensureVersionString as y, stripUndefined as z };
305
- //# sourceMappingURL=store-CCvk8X-k.d.cts.map
305
+ //# sourceMappingURL=store-xuKpT-o4.d.cts.map
package/dist/store.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_constants = require("./constants-DsOnY5o5.cjs");
2
+ const require_constants = require("./constants-DKF0kxhY.cjs");
3
3
  const require_appSlice_index = require("./appSlice/index.cjs");
4
4
  const require_deploymentsSlice_index = require("./deploymentsSlice/index.cjs");
5
5
  const require_devicesSlice_index = require("./devicesSlice/index.cjs");
package/dist/store.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as commonErrorFallback, c as getConfiguredStore, d as useAppDispatch, f as useAppSelector, i as RootState, l as resetEnvironment, m as ErrorWithResponse, n as AppStore, o as commonErrorHandler, r as MenderEnvironment, s as createAppAsyncThunk, t as AppDispatch, u as sessionReducer } from "./store-CCvk8X-k.cjs";
1
+ import { a as commonErrorFallback, c as getConfiguredStore, d as useAppDispatch, f as useAppSelector, i as RootState, l as resetEnvironment, m as ErrorWithResponse, n as AppStore, o as commonErrorHandler, r as MenderEnvironment, s as createAppAsyncThunk, t as AppDispatch, u as sessionReducer } from "./store-xuKpT-o4.cjs";
2
2
  export { AppDispatch, AppStore, type ErrorWithResponse, MenderEnvironment, RootState, commonErrorFallback, commonErrorHandler, createAppAsyncThunk, getConfiguredStore, resetEnvironment, sessionReducer, useAppDispatch, useAppSelector };
package/dist/store.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as commonErrorFallback, c as getConfiguredStore, d as useAppDispatch, f as useAppSelector, i as RootState, l as resetEnvironment, m as ErrorWithResponse, n as AppStore, o as commonErrorHandler, r as MenderEnvironment, s as createAppAsyncThunk, t as AppDispatch, u as sessionReducer } from "./store-v5V-bbB_.js";
1
+ import { a as commonErrorFallback, c as getConfiguredStore, d as useAppDispatch, f as useAppSelector, i as RootState, l as resetEnvironment, m as ErrorWithResponse, n as AppStore, o as commonErrorHandler, r as MenderEnvironment, s as createAppAsyncThunk, t as AppDispatch, u as sessionReducer } from "./store-CROmfENq.js";
2
2
  export { AppDispatch, AppStore, type ErrorWithResponse, MenderEnvironment, RootState, commonErrorFallback, commonErrorHandler, createAppAsyncThunk, getConfiguredStore, resetEnvironment, sessionReducer, useAppDispatch, useAppSelector };
package/dist/store.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Q as settingsKeys } from "./constants-DjiC_FnZ.js";
1
+ import { et as settingsKeys } from "./constants-TPYvZDsI.js";
2
2
  import appSlice_default from "./appSlice/index.js";
3
3
  import deploymentsSlice_default from "./deploymentsSlice/index.js";
4
4
  import devicesSlice_default from "./devicesSlice/index.js";
package/dist/thunks.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
3
3
  const require_appSlice_constants = require("./appSlice/constants.cjs");
4
- const require_constants = require("./constants-DsOnY5o5.cjs");
4
+ const require_constants = require("./constants-DKF0kxhY.cjs");
5
5
  const require_onboardingSlice_constants = require("./onboardingSlice/constants.cjs");
6
6
  const require_releasesSlice_constants = require("./releasesSlice/constants.cjs");
7
7
  const require_appSlice_index = require("./appSlice/index.cjs");
@@ -855,6 +855,7 @@ const getDeviceInfo = require_store.createAppAsyncThunk(`${require_devicesSlice_
855
855
  tasks.push(dispatch(require_monitorSlice_thunks.getLatestDeviceAlerts({ id: deviceId })));
856
856
  tasks.push(dispatch(require_monitorSlice_thunks.getDeviceMonitorConfig(deviceId)));
857
857
  }
858
+ if (device.tier === "system") tasks.push(dispatch(getDeviceComponents(deviceId)));
858
859
  }
859
860
  return Promise.all(tasks);
860
861
  });
@@ -1842,16 +1843,19 @@ const ssoConfigActions = {
1842
1843
  error: "retrieving"
1843
1844
  }
1844
1845
  };
1845
- const ssoConfigActionErrorHandler = (err, type) => (dispatch) => require_store.commonErrorHandler(err, `There was an error ${ssoConfigActions[type].error} the SSO configuration.`, dispatch, require_store.commonErrorFallback);
1846
+ const ssoConfigActionErrorHandler = (err, type, rejectWithValue) => (dispatch) => {
1847
+ const errorContext = `There was an error ${ssoConfigActions[type].error} the SSO configuration.`;
1848
+ return rejectWithValue ? Promise.reject(rejectWithValue(`${errorContext} ${require_utils.extractErrorMessage(err, require_store.commonErrorFallback)}`)) : require_store.commonErrorHandler(err, errorContext, dispatch, require_store.commonErrorFallback);
1849
+ };
1846
1850
  const ssoConfigActionSuccessHandler = (type) => (dispatch) => dispatch(setSnackbar$1(`The SSO configuration was ${ssoConfigActions[type].success} successfully`));
1847
- const storeSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/storeSsoConfig`, ({ config, contentType }, { dispatch }) => require_api_general_api.default.post(_northern_tech_utils_constants.ssoIdpApiUrlv1, config, { headers: {
1851
+ const storeSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/storeSsoConfig`, ({ config, contentType }, { dispatch, rejectWithValue }) => require_api_general_api.default.post(_northern_tech_utils_constants.ssoIdpApiUrlv1, config, { headers: {
1848
1852
  "Content-Type": contentType,
1849
1853
  Accept: "application/json"
1850
- } }).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "create"))).then(() => Promise.all([dispatch(ssoConfigActionSuccessHandler("create")), dispatch(getSsoConfigs())])));
1851
- const changeSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/changeSsoConfig`, ({ config, contentType }, { dispatch }) => require_api_general_api.default.put(`${_northern_tech_utils_constants.ssoIdpApiUrlv1}/${config.id}`, config.config, { headers: {
1854
+ } }).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "create", rejectWithValue))).then(() => Promise.all([dispatch(ssoConfigActionSuccessHandler("create")), dispatch(getSsoConfigs())])));
1855
+ const changeSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/changeSsoConfig`, ({ config, contentType }, { dispatch, rejectWithValue }) => require_api_general_api.default.put(`${_northern_tech_utils_constants.ssoIdpApiUrlv1}/${config.id}`, config.config, { headers: {
1852
1856
  "Content-Type": contentType,
1853
1857
  Accept: "application/json"
1854
- } }).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "edit"))).then(() => Promise.all([dispatch(ssoConfigActionSuccessHandler("edit")), dispatch(getSsoConfigs())])));
1858
+ } }).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "edit", rejectWithValue))).then(() => Promise.all([dispatch(ssoConfigActionSuccessHandler("edit")), dispatch(getSsoConfigs())])));
1855
1859
  const deleteSsoConfig = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/deleteSsoConfig`, ({ id }, { dispatch, getState }) => require_api_general_api.default.delete(`${_northern_tech_utils_constants.ssoIdpApiUrlv1}/${id}`).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "remove"))).then(() => {
1856
1860
  const configs = getState().organization.ssoConfigs.filter((item) => id !== item.id);
1857
1861
  return Promise.all([dispatch(ssoConfigActionSuccessHandler("remove")), dispatch(require_organizationSlice_index.actions.receiveSsoConfigs(configs))]);
@@ -1865,6 +1869,10 @@ const getSsoConfigById = require_store.createAppAsyncThunk(`${require_organizati
1865
1869
  }) : Promise.reject("Unsupported SSO config content type.");
1866
1870
  }));
1867
1871
  const getSsoConfigs = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/getSsoConfigs`, (_, { dispatch }) => require_api_general_api.default.get(_northern_tech_utils_constants.ssoIdpApiUrlv1).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "readMultiple"))).then(({ data }) => Promise.all(data.map((config) => dispatch(getSsoConfigById(config)).unwrap())).then((configs) => dispatch(require_organizationSlice_index.actions.receiveSsoConfigs(configs))).catch((err) => require_store.commonErrorHandler(err, err, dispatch, ""))));
1872
+ const getSsoEndpoints = require_store.createAppAsyncThunk(`${require_organizationSlice_index.sliceName}/getSsoEndpoints`, async (_, { dispatch }) => {
1873
+ const { data } = await require_api_general_api.default.get(_northern_tech_utils_constants.ssoEndpointsApiUrlv1).catch((err) => require_store.commonErrorHandler(err, "There was an error retrieving the SSO endpoints.", dispatch, require_store.commonErrorFallback));
1874
+ return dispatch(require_organizationSlice_index.actions.receiveSsoEndpoint(data));
1875
+ });
1868
1876
  //#endregion
1869
1877
  //#region src/usersSlice/thunks.ts
1870
1878
  const cookies = new universal_cookie.default();
@@ -2553,6 +2561,7 @@ exports.getSoftware = require_releasesSlice_thunks.getSoftware;
2553
2561
  exports.getSoftwareList = require_releasesSlice_thunks.getSoftwareList;
2554
2562
  exports.getSsoConfigById = getSsoConfigById;
2555
2563
  exports.getSsoConfigs = getSsoConfigs;
2564
+ exports.getSsoEndpoints = getSsoEndpoints;
2556
2565
  exports.getTargetLocation = getTargetLocation;
2557
2566
  exports.getTenantToken = getTenantToken;
2558
2567
  exports.getTenants = getTenants;