@northern.tech/store 0.3.2 → 0.3.3

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 (197) hide show
  1. package/dist/actions.cjs +20 -17
  2. package/dist/actions.cjs.map +1 -1
  3. package/dist/actions.js +8 -8
  4. package/dist/api/general-api.js +2 -2
  5. package/dist/api/types/Tenant.ts +17 -12
  6. package/dist/api/users-api.js +2 -2
  7. package/dist/appSlice/constants.cjs +18 -10
  8. package/dist/appSlice/constants.cjs.map +1 -1
  9. package/dist/appSlice/constants.d.cts +41 -84
  10. package/dist/appSlice/constants.d.ts +41 -84
  11. package/dist/appSlice/constants.js +1 -1
  12. package/dist/appSlice/index.js +2 -2
  13. package/dist/appSlice/thunks.cjs +137 -94
  14. package/dist/appSlice/thunks.cjs.map +1 -1
  15. package/dist/appSlice/thunks.js +19 -19
  16. package/dist/auth.js +2 -2
  17. package/dist/{chunk-Q6M5TTDQ.js → chunk-2CYOM4BK.js} +1 -1
  18. package/dist/chunk-2CYOM4BK.js.map +1 -0
  19. package/dist/{chunk-74OJIKXF.js → chunk-2JHFUQ6B.js} +133 -96
  20. package/dist/chunk-2JHFUQ6B.js.map +1 -0
  21. package/dist/{chunk-YETZPQFR.js → chunk-4XJMRVFI.js} +12 -11
  22. package/dist/chunk-4XJMRVFI.js.map +1 -0
  23. package/dist/{chunk-RX55KAKX.js → chunk-7JKWI5FK.js} +2 -2
  24. package/dist/{chunk-A6CT6GTI.js → chunk-C5NEDBJI.js} +17 -11
  25. package/dist/chunk-C5NEDBJI.js.map +1 -0
  26. package/dist/{chunk-NNADGHSL.js → chunk-DAPAXWA5.js} +8 -8
  27. package/dist/{chunk-ANB5BM5J.js → chunk-DCK2DBOA.js} +27 -20
  28. package/dist/chunk-DCK2DBOA.js.map +1 -0
  29. package/dist/{chunk-E5LEU5PF.js → chunk-HPBE6KYY.js} +2 -2
  30. package/dist/{chunk-2RJIDREZ.js → chunk-LEMVXAYP.js} +25 -16
  31. package/dist/chunk-LEMVXAYP.js.map +1 -0
  32. package/dist/{chunk-NI4SZOCF.js → chunk-LGNOTPUG.js} +9 -9
  33. package/dist/{chunk-MDC7Y3EX.js → chunk-LTKOV26W.js} +22 -20
  34. package/dist/chunk-LTKOV26W.js.map +1 -0
  35. package/dist/{chunk-YTQUNAZP.js → chunk-QRGTG4YB.js} +2 -2
  36. package/dist/{chunk-XTRPX7JZ.js → chunk-TI2RL5P2.js} +2 -2
  37. package/dist/chunk-TI2RL5P2.js.map +1 -0
  38. package/dist/{chunk-YGBFDXXA.js → chunk-TUACATJA.js} +2 -2
  39. package/dist/{chunk-25AKG5HH.js → chunk-UWMYZNUB.js} +19 -11
  40. package/dist/chunk-UWMYZNUB.js.map +1 -0
  41. package/dist/{chunk-UEP36GCI.js → chunk-VMNMD6KF.js} +2 -2
  42. package/dist/{chunk-KAQJH2YL.js → chunk-WXL7PVI5.js} +12 -4
  43. package/dist/chunk-WXL7PVI5.js.map +1 -0
  44. package/dist/{chunk-VOCOFE4I.js → chunk-X7IEZBM4.js} +2 -2
  45. package/dist/{chunk-XXHONFSQ.js → chunk-YDS36ALB.js} +3 -3
  46. package/dist/{chunk-XXHONFSQ.js.map → chunk-YDS36ALB.js.map} +1 -1
  47. package/dist/commonSelectors.cjs +40 -18
  48. package/dist/commonSelectors.cjs.map +1 -1
  49. package/dist/commonSelectors.d.cts +54 -46
  50. package/dist/commonSelectors.d.ts +54 -46
  51. package/dist/commonSelectors.js +9 -9
  52. package/dist/constants.cjs +35 -19
  53. package/dist/constants.cjs.map +1 -1
  54. package/dist/constants.d.cts +3 -3
  55. package/dist/constants.d.ts +3 -3
  56. package/dist/constants.js +6 -2
  57. package/dist/deploymentdevicehook.cjs +143 -99
  58. package/dist/deploymentdevicehook.cjs.map +1 -1
  59. package/dist/deploymentdevicehook.d.cts +1 -1
  60. package/dist/deploymentdevicehook.d.ts +1 -1
  61. package/dist/deploymentdevicehook.js +24 -22
  62. package/dist/deploymentdevicehook.js.map +1 -1
  63. package/dist/deploymentsSlice/constants.cjs +8 -8
  64. package/dist/deploymentsSlice/constants.cjs.map +1 -1
  65. package/dist/deploymentsSlice/constants.js +2 -2
  66. package/dist/deploymentsSlice/index.cjs +8 -8
  67. package/dist/deploymentsSlice/index.cjs.map +1 -1
  68. package/dist/deploymentsSlice/index.js +3 -3
  69. package/dist/deploymentsSlice/selectors.cjs +8 -8
  70. package/dist/deploymentsSlice/selectors.cjs.map +1 -1
  71. package/dist/deploymentsSlice/selectors.js +3 -3
  72. package/dist/deploymentsSlice/thunks.cjs +137 -94
  73. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  74. package/dist/deploymentsSlice/thunks.js +19 -19
  75. package/dist/devicesSlice/constants.cjs +11 -8
  76. package/dist/devicesSlice/constants.cjs.map +1 -1
  77. package/dist/devicesSlice/constants.d.cts +2 -1
  78. package/dist/devicesSlice/constants.d.ts +2 -1
  79. package/dist/devicesSlice/constants.js +4 -2
  80. package/dist/devicesSlice/index.cjs +8 -8
  81. package/dist/devicesSlice/index.cjs.map +1 -1
  82. package/dist/devicesSlice/index.js +3 -3
  83. package/dist/devicesSlice/selectors.cjs +9 -9
  84. package/dist/devicesSlice/selectors.cjs.map +1 -1
  85. package/dist/devicesSlice/selectors.js +3 -3
  86. package/dist/devicesSlice/thunks.cjs +139 -94
  87. package/dist/devicesSlice/thunks.cjs.map +1 -1
  88. package/dist/devicesSlice/thunks.d.cts +12 -2
  89. package/dist/devicesSlice/thunks.d.ts +12 -2
  90. package/dist/devicesSlice/thunks.js +21 -19
  91. package/dist/flag-eu-5477R2P4.svg +130 -0
  92. package/dist/flag-us-HNQAF66I.svg +63 -0
  93. package/dist/monitorSlice/constants.cjs +8 -8
  94. package/dist/monitorSlice/constants.cjs.map +1 -1
  95. package/dist/monitorSlice/constants.js +2 -2
  96. package/dist/monitorSlice/index.cjs +8 -8
  97. package/dist/monitorSlice/index.cjs.map +1 -1
  98. package/dist/monitorSlice/index.js +3 -3
  99. package/dist/monitorSlice/thunks.cjs +59 -37
  100. package/dist/monitorSlice/thunks.cjs.map +1 -1
  101. package/dist/monitorSlice/thunks.js +17 -17
  102. package/dist/onboardingSlice/thunks.cjs +146 -100
  103. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  104. package/dist/onboardingSlice/thunks.d.cts +1 -32
  105. package/dist/onboardingSlice/thunks.d.ts +1 -32
  106. package/dist/onboardingSlice/thunks.js +19 -19
  107. package/dist/organizationSlice/constants.cjs +22 -17
  108. package/dist/organizationSlice/constants.cjs.map +1 -1
  109. package/dist/organizationSlice/constants.d.cts +33 -1
  110. package/dist/organizationSlice/constants.d.ts +33 -1
  111. package/dist/organizationSlice/constants.js +4 -2
  112. package/dist/organizationSlice/index.cjs +18 -15
  113. package/dist/organizationSlice/index.cjs.map +1 -1
  114. package/dist/organizationSlice/index.d.cts +26 -1012
  115. package/dist/organizationSlice/index.d.ts +26 -1012
  116. package/dist/organizationSlice/index.js +3 -3
  117. package/dist/organizationSlice/selectors.cjs.map +1 -1
  118. package/dist/organizationSlice/selectors.d.cts +9 -1
  119. package/dist/organizationSlice/selectors.d.ts +9 -1
  120. package/dist/organizationSlice/selectors.js +3 -3
  121. package/dist/organizationSlice/thunks.cjs +1605 -1539
  122. package/dist/organizationSlice/thunks.cjs.map +1 -1
  123. package/dist/organizationSlice/thunks.d.cts +61 -36
  124. package/dist/organizationSlice/thunks.d.ts +61 -36
  125. package/dist/organizationSlice/thunks.js +19 -19
  126. package/dist/organizationSlice/types.cjs +19 -0
  127. package/dist/organizationSlice/types.cjs.map +1 -0
  128. package/dist/organizationSlice/types.d.cts +114 -0
  129. package/dist/organizationSlice/types.d.ts +114 -0
  130. package/dist/organizationSlice/types.js +1 -0
  131. package/dist/organizationSlice/types.js.map +1 -0
  132. package/dist/releasesSlice/index.js +2 -2
  133. package/dist/releasesSlice/selectors.cjs +11 -0
  134. package/dist/releasesSlice/selectors.cjs.map +1 -1
  135. package/dist/releasesSlice/selectors.js +4 -4
  136. package/dist/releasesSlice/thunks.cjs +73 -49
  137. package/dist/releasesSlice/thunks.cjs.map +1 -1
  138. package/dist/releasesSlice/thunks.d.cts +1 -4
  139. package/dist/releasesSlice/thunks.d.ts +1 -4
  140. package/dist/releasesSlice/thunks.js +17 -17
  141. package/dist/selectors.cjs +46 -18
  142. package/dist/selectors.cjs.map +1 -1
  143. package/dist/selectors.d.cts +9 -1
  144. package/dist/selectors.d.ts +9 -1
  145. package/dist/selectors.js +36 -30
  146. package/dist/store.cjs +36 -23
  147. package/dist/store.cjs.map +1 -1
  148. package/dist/store.d.cts +12 -231
  149. package/dist/store.d.ts +12 -231
  150. package/dist/store.js +13 -11
  151. package/dist/storehooks.cjs +216 -137
  152. package/dist/storehooks.cjs.map +1 -1
  153. package/dist/storehooks.js +36 -24
  154. package/dist/storehooks.js.map +1 -1
  155. package/dist/thunks.cjs +193 -122
  156. package/dist/thunks.cjs.map +1 -1
  157. package/dist/thunks.d.cts +5 -1
  158. package/dist/thunks.d.ts +5 -1
  159. package/dist/thunks.js +21 -19
  160. package/dist/usersSlice/constants.cjs +10 -10
  161. package/dist/usersSlice/constants.cjs.map +1 -1
  162. package/dist/usersSlice/constants.js +2 -2
  163. package/dist/usersSlice/index.cjs +10 -10
  164. package/dist/usersSlice/index.cjs.map +1 -1
  165. package/dist/usersSlice/index.js +3 -3
  166. package/dist/usersSlice/selectors.cjs +35 -13
  167. package/dist/usersSlice/selectors.cjs.map +1 -1
  168. package/dist/usersSlice/selectors.d.cts +44 -1
  169. package/dist/usersSlice/selectors.d.ts +44 -1
  170. package/dist/usersSlice/selectors.js +12 -6
  171. package/dist/usersSlice/thunks.cjs +135 -94
  172. package/dist/usersSlice/thunks.cjs.map +1 -1
  173. package/dist/usersSlice/thunks.d.cts +10 -9
  174. package/dist/usersSlice/thunks.d.ts +10 -9
  175. package/dist/usersSlice/thunks.js +19 -19
  176. package/dist/utils.cjs +17 -16
  177. package/dist/utils.cjs.map +1 -1
  178. package/dist/utils.js +3 -3
  179. package/package.json +7 -7
  180. package/dist/chunk-25AKG5HH.js.map +0 -1
  181. package/dist/chunk-2RJIDREZ.js.map +0 -1
  182. package/dist/chunk-74OJIKXF.js.map +0 -1
  183. package/dist/chunk-A6CT6GTI.js.map +0 -1
  184. package/dist/chunk-ANB5BM5J.js.map +0 -1
  185. package/dist/chunk-KAQJH2YL.js.map +0 -1
  186. package/dist/chunk-MDC7Y3EX.js.map +0 -1
  187. package/dist/chunk-Q6M5TTDQ.js.map +0 -1
  188. package/dist/chunk-XTRPX7JZ.js.map +0 -1
  189. package/dist/chunk-YETZPQFR.js.map +0 -1
  190. /package/dist/{chunk-RX55KAKX.js.map → chunk-7JKWI5FK.js.map} +0 -0
  191. /package/dist/{chunk-NNADGHSL.js.map → chunk-DAPAXWA5.js.map} +0 -0
  192. /package/dist/{chunk-E5LEU5PF.js.map → chunk-HPBE6KYY.js.map} +0 -0
  193. /package/dist/{chunk-NI4SZOCF.js.map → chunk-LGNOTPUG.js.map} +0 -0
  194. /package/dist/{chunk-YTQUNAZP.js.map → chunk-QRGTG4YB.js.map} +0 -0
  195. /package/dist/{chunk-YGBFDXXA.js.map → chunk-TUACATJA.js.map} +0 -0
  196. /package/dist/{chunk-UEP36GCI.js.map → chunk-VMNMD6KF.js.map} +0 -0
  197. /package/dist/{chunk-VOCOFE4I.js.map → chunk-X7IEZBM4.js.map} +0 -0
@@ -3,37 +3,37 @@ import {
3
3
  setFirstLoginAfterSignup,
4
4
  setOfflineThreshold,
5
5
  setSearchState
6
- } from "../chunk-74OJIKXF.js";
7
- import "../chunk-MDC7Y3EX.js";
8
- import "../chunk-NI4SZOCF.js";
6
+ } from "../chunk-2JHFUQ6B.js";
7
+ import "../chunk-LTKOV26W.js";
8
+ import "../chunk-LGNOTPUG.js";
9
9
  import "../chunk-JAROCU6M.js";
10
10
  import "../chunk-YT73QWCN.js";
11
11
  import "../chunk-NMAXZ3ZY.js";
12
- import "../chunk-ANB5BM5J.js";
13
- import "../chunk-KAQJH2YL.js";
14
- import "../chunk-VOCOFE4I.js";
15
- import "../chunk-RX55KAKX.js";
12
+ import "../chunk-DCK2DBOA.js";
13
+ import "../chunk-X7IEZBM4.js";
14
+ import "../chunk-WXL7PVI5.js";
15
+ import "../chunk-2CYOM4BK.js";
16
+ import "../chunk-7JKWI5FK.js";
16
17
  import "../chunk-JIS4PA3R.js";
17
- import "../chunk-Q6M5TTDQ.js";
18
- import "../chunk-XXHONFSQ.js";
18
+ import "../chunk-YDS36ALB.js";
19
19
  import "../chunk-YO22XLHI.js";
20
- import "../chunk-YETZPQFR.js";
20
+ import "../chunk-4XJMRVFI.js";
21
21
  import "../chunk-LIJIIRON.js";
22
- import "../chunk-2RJIDREZ.js";
23
- import "../chunk-NNADGHSL.js";
24
- import "../chunk-YGBFDXXA.js";
22
+ import "../chunk-LEMVXAYP.js";
23
+ import "../chunk-DAPAXWA5.js";
24
+ import "../chunk-TUACATJA.js";
25
+ import "../chunk-TI2RL5P2.js";
25
26
  import "../chunk-CYV6632F.js";
26
- import "../chunk-E5LEU5PF.js";
27
+ import "../chunk-HPBE6KYY.js";
27
28
  import "../chunk-FGKMJS3B.js";
28
- import "../chunk-XTRPX7JZ.js";
29
- import "../chunk-YTQUNAZP.js";
30
- import "../chunk-UEP36GCI.js";
29
+ import "../chunk-QRGTG4YB.js";
30
+ import "../chunk-VMNMD6KF.js";
31
31
  import "../chunk-7PVGDMNM.js";
32
32
  import "../chunk-AMGWP7A4.js";
33
- import "../chunk-A6CT6GTI.js";
33
+ import "../chunk-C5NEDBJI.js";
34
34
  import "../chunk-CK6YE6AN.js";
35
35
  import "../chunk-MRCFLG45.js";
36
- import "../chunk-25AKG5HH.js";
36
+ import "../chunk-UWMYZNUB.js";
37
37
  import "../chunk-4B3IMP4I.js";
38
38
  export {
39
39
  getLatestReleaseInfo,
package/dist/auth.js CHANGED
@@ -6,10 +6,10 @@ import {
6
6
  setSessionInfo,
7
7
  updateMaxAge
8
8
  } from "./chunk-AMGWP7A4.js";
9
- import "./chunk-A6CT6GTI.js";
9
+ import "./chunk-C5NEDBJI.js";
10
10
  import "./chunk-CK6YE6AN.js";
11
11
  import "./chunk-MRCFLG45.js";
12
- import "./chunk-25AKG5HH.js";
12
+ import "./chunk-UWMYZNUB.js";
13
13
  import "./chunk-4B3IMP4I.js";
14
14
  export {
15
15
  cleanUp,
@@ -50,4 +50,4 @@ export {
50
50
  getWebhookEventInfo,
51
51
  getAuditLogEntry
52
52
  };
53
- //# sourceMappingURL=chunk-Q6M5TTDQ.js.map
53
+ //# sourceMappingURL=chunk-2CYOM4BK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/organizationSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { EXTERNAL_PROVIDER } from '@northern.tech/store/constants';\nimport { RootState } from '@northern.tech/store/store';\nimport { createSelector } from '@reduxjs/toolkit';\n\nexport const getOrganization = (state: RootState) => state.organization.organization;\nexport const getExternalIntegrations = state => state.organization.externalDeviceIntegrations;\nexport const getAuditlogState = state => state.organization.auditlog.selectionState;\nexport const getAuditLog = state => state.organization.auditlog.events;\nexport const getAuditLogSelectionState = state => state.organization.auditlog.selectionState;\nexport const getSsoConfig = ({ organization: { ssoConfigs = [] } }) => ssoConfigs[0];\nexport const getTenantsList = state => state.organization.tenantList;\nexport const getWebhookEvents = state => state.organization.webhooks.events;\nexport const getWebhookEventTotal = state => state.organization.webhooks.eventTotal;\n\nexport const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)\n);\nexport const getIsServiceProvider = state => state.organization.organization.service_provider;\n\nexport const getWebhooks = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)\n);\nexport const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>\n webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }\n);\n\nexport const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {\n if (!selectedId) {\n return;\n }\n const [eventAction, eventTime] = atob(selectedId).split('|');\n return events.find(item => item.action === eventAction && item.time === eventTime);\n});\n"],"mappings":";;;;;AAeA,SAAS,sBAAsB;AAExB,IAAM,kBAAkB,CAAC,UAAqB,MAAM,aAAa;AACjE,IAAM,0BAA0B,WAAS,MAAM,aAAa;AAC5D,IAAM,mBAAmB,WAAS,MAAM,aAAa,SAAS;AAC9D,IAAM,cAAc,WAAS,MAAM,aAAa,SAAS;AACzD,IAAM,4BAA4B,WAAS,MAAM,aAAa,SAAS;AACvE,IAAM,eAAe,CAAC,EAAE,cAAc,EAAE,aAAa,CAAC,EAAE,EAAE,MAAM,WAAW,CAAC;AAC5E,IAAM,iBAAiB,WAAS,MAAM,aAAa;AACnD,IAAM,mBAAmB,WAAS,MAAM,aAAa,SAAS;AAC9D,IAAM,uBAAuB,WAAS,MAAM,aAAa,SAAS;AAElE,IAAM,4BAA4B;AAAA,EAAe,CAAC,uBAAuB;AAAA,EAAG,kBACjF,aAAa,OAAO,iBAAe,YAAY,MAAM,kBAAkB,YAAY,QAAQ,GAAG,UAAU;AAC1G;AACO,IAAM,uBAAuB,WAAS,MAAM,aAAa,aAAa;AAEtE,IAAM,cAAc;AAAA,EAAe,CAAC,uBAAuB;AAAA,EAAG,kBACnE,aAAa,OAAO,iBAAe,YAAY,MAAM,YAAY,aAAa,kBAAkB,QAAQ,QAAQ;AAClH;AACO,IAAM,sBAAsB;AAAA,EAAe,CAAC,aAAa,kBAAkB,oBAAoB;AAAA,EAAG,CAAC,UAAU,QAAQ,eAC1H,SAAS,SAAS,EAAE,QAAQ,WAAW,IAAI,EAAE,QAAQ,CAAC,GAAG,YAAY,EAAE;AACzE;AAEO,IAAM,mBAAmB,eAAe,CAAC,aAAa,yBAAyB,GAAG,CAAC,QAAQ,EAAE,WAAW,MAAM;AACnH,MAAI,CAAC,YAAY;AACf;AAAA,EACF;AACA,QAAM,CAAC,aAAa,SAAS,IAAI,KAAK,UAAU,EAAE,MAAM,GAAG;AAC3D,SAAO,OAAO,KAAK,UAAQ,KAAK,WAAW,eAAe,KAAK,SAAS,SAAS;AACnF,CAAC;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDeviceMonitorConfig,
3
3
  getLatestDeviceAlerts
4
- } from "./chunk-NI4SZOCF.js";
4
+ } from "./chunk-LGNOTPUG.js";
5
5
  import {
6
6
  users_api_default
7
7
  } from "./chunk-JAROCU6M.js";
@@ -14,7 +14,7 @@ import {
14
14
  getSearchEndpoint,
15
15
  getTenantCapabilities,
16
16
  getUserCapabilities
17
- } from "./chunk-ANB5BM5J.js";
17
+ } from "./chunk-DCK2DBOA.js";
18
18
  import {
19
19
  getCurrentSession,
20
20
  getCurrentUser,
@@ -22,19 +22,21 @@ import {
22
22
  getIdAttribute,
23
23
  getOfflineThresholdSettings,
24
24
  getRolesById,
25
+ getSelectedDeviceAttribute,
25
26
  getTooltipsState,
26
- getUserSettings
27
- } from "./chunk-KAQJH2YL.js";
28
- import {
29
- getDeploymentsById,
30
- getDeploymentsByStatus
31
- } from "./chunk-RX55KAKX.js";
27
+ getUserSettings,
28
+ getUsersById
29
+ } from "./chunk-WXL7PVI5.js";
32
30
  import {
33
31
  getAuditlogState,
34
32
  getDeviceTwinIntegrations,
35
33
  getOrganization,
36
34
  getTenantsList
37
- } from "./chunk-Q6M5TTDQ.js";
35
+ } from "./chunk-2CYOM4BK.js";
36
+ import {
37
+ getDeploymentsById,
38
+ getDeploymentsByStatus
39
+ } from "./chunk-7JKWI5FK.js";
38
40
  import {
39
41
  getDeviceById,
40
42
  getDeviceFilters,
@@ -43,7 +45,7 @@ import {
43
45
  getGroups,
44
46
  getGroupsById,
45
47
  getSelectedGroup
46
- } from "./chunk-XXHONFSQ.js";
48
+ } from "./chunk-YDS36ALB.js";
47
49
  import {
48
50
  convertDeviceListStateToFilters,
49
51
  filtersFilter,
@@ -53,7 +55,7 @@ import {
53
55
  mapTermsToFilters,
54
56
  mergePermissions,
55
57
  progress
56
- } from "./chunk-YETZPQFR.js";
58
+ } from "./chunk-4XJMRVFI.js";
57
59
  import {
58
60
  getFeatures,
59
61
  getSearchState
@@ -61,30 +63,30 @@ import {
61
63
  import {
62
64
  commonErrorFallback,
63
65
  commonErrorHandler
64
- } from "./chunk-2RJIDREZ.js";
66
+ } from "./chunk-LEMVXAYP.js";
65
67
  import {
66
68
  actions_default
67
- } from "./chunk-NNADGHSL.js";
69
+ } from "./chunk-DAPAXWA5.js";
68
70
  import {
69
71
  actions as actions6,
70
72
  sliceName as sliceName6
71
- } from "./chunk-YGBFDXXA.js";
73
+ } from "./chunk-TUACATJA.js";
74
+ import {
75
+ actions as actions5,
76
+ sliceName as sliceName5
77
+ } from "./chunk-TI2RL5P2.js";
72
78
  import {
73
79
  actions as actions2,
74
80
  sliceName as sliceName2
75
- } from "./chunk-E5LEU5PF.js";
81
+ } from "./chunk-HPBE6KYY.js";
76
82
  import {
77
83
  actions as actions4,
78
84
  sliceName as sliceName4
79
85
  } from "./chunk-FGKMJS3B.js";
80
- import {
81
- actions as actions5,
82
- sliceName as sliceName5
83
- } from "./chunk-XTRPX7JZ.js";
84
86
  import {
85
87
  actions as actions3,
86
88
  sliceName as sliceName3
87
- } from "./chunk-YTQUNAZP.js";
89
+ } from "./chunk-QRGTG4YB.js";
88
90
  import {
89
91
  actions,
90
92
  sliceName
@@ -104,6 +106,7 @@ import {
104
106
  OWN_USER_ID,
105
107
  PermissionTypes,
106
108
  READ_STATES,
109
+ REPORT_CHART_SIZE_LIMIT,
107
110
  SSO_TYPES,
108
111
  TENANT_LIST_DEFAULT,
109
112
  USER_LOGOUT,
@@ -133,13 +136,12 @@ import {
133
136
  uiPermissionsById,
134
137
  useradmApiUrlv1,
135
138
  useradmApiUrlv2
136
- } from "./chunk-A6CT6GTI.js";
139
+ } from "./chunk-C5NEDBJI.js";
137
140
  import {
138
141
  rootfsImageVersion
139
142
  } from "./chunk-CK6YE6AN.js";
140
143
  import {
141
- onboardingSteps,
142
- orderedOnboardingSteps
144
+ onboardingSteps
143
145
  } from "./chunk-MRCFLG45.js";
144
146
  import {
145
147
  APPLICATION_JSON_CONTENT_TYPE,
@@ -148,7 +150,7 @@ import {
148
150
  defaultReports,
149
151
  headerNames,
150
152
  locations
151
- } from "./chunk-25AKG5HH.js";
153
+ } from "./chunk-UWMYZNUB.js";
152
154
  import {
153
155
  ALL_DEVICES,
154
156
  ALL_RELEASES,
@@ -165,6 +167,7 @@ import {
165
167
 
166
168
  // src/deploymentsSlice/thunks.ts
167
169
  import { deepCompare, isEmpty, standardizePhases, startTimeSort } from "@northern.tech/utils/helpers";
170
+ import Tracking from "@northern.tech/utils/tracking";
168
171
  import { createAsyncThunk } from "@reduxjs/toolkit";
169
172
  import { isUUID } from "validator";
170
173
  var { receivedDevice, setSnackbar } = actions_default;
@@ -221,6 +224,26 @@ var getDeploymentsByStatus2 = createAsyncThunk(`${sliceName2}/getDeploymentsBySt
221
224
  return Promise.all(tasks);
222
225
  });
223
226
  });
227
+ var isWithinFirstMonth = (expirationDate) => {
228
+ if (!expirationDate) {
229
+ return false;
230
+ }
231
+ const endOfFirstMonth = new Date(expirationDate);
232
+ endOfFirstMonth.setMonth(endOfFirstMonth.getMonth() - 11);
233
+ return endOfFirstMonth > /* @__PURE__ */ new Date();
234
+ };
235
+ var trackDeploymentCreation = (totalDeploymentCount, hasDeployments, trial_expiration) => {
236
+ Tracking.event({ category: "deployments", action: "create" });
237
+ if (!totalDeploymentCount) {
238
+ if (!hasDeployments) {
239
+ Tracking.event({ category: "deployments", action: "create_initial_deployment" });
240
+ if (isWithinFirstMonth(trial_expiration)) {
241
+ Tracking.event({ category: "deployments", action: "create_initial_deployment_first_month" });
242
+ }
243
+ }
244
+ Tracking.event({ category: "deployments", action: "create_initial_deployment_user" });
245
+ }
246
+ };
224
247
  var MAX_PREVIOUS_PHASES_COUNT = 5;
225
248
  var createDeployment = createAsyncThunk(`${sliceName2}/createDeployment`, ({ newDeployment, hasNewRetryDefault = false }, { dispatch, getState }) => {
226
249
  let request;
@@ -231,6 +254,9 @@ var createDeployment = createAsyncThunk(`${sliceName2}/createDeployment`, ({ new
231
254
  } else {
232
255
  request = general_api_default.post(`${deploymentsApiUrl}/deployments`, newDeployment);
233
256
  }
257
+ const totalDeploymentCount = Object.values(getDeploymentsByStatus(getState())).reduce((accu, item) => accu + item.total, 0);
258
+ const { hasDeployments } = getGlobalSettings(getState());
259
+ const { trial_expiration } = getOrganization(getState());
234
260
  return request.catch((err) => commonErrorHandler(err, "Error creating deployment.", dispatch)).then((data) => {
235
261
  const lastslashindex = data.headers.location.lastIndexOf("/");
236
262
  const deploymentId = data.headers.location.substring(lastslashindex + 1);
@@ -245,6 +271,7 @@ var createDeployment = createAsyncThunk(`${sliceName2}/createDeployment`, ({ new
245
271
  dispatch(getSingleDeployment(deploymentId)),
246
272
  dispatch(setSnackbar("Deployment created successfully", TIMEOUTS.fiveSeconds))
247
273
  ];
274
+ trackDeploymentCreation(totalDeploymentCount, hasDeployments, trial_expiration);
248
275
  const { canManageUsers } = getUserCapabilities(getState());
249
276
  if (canManageUsers) {
250
277
  const { phases, retries } = newDeployment;
@@ -919,7 +946,7 @@ var getDevicesByStatus = createAsyncThunk2(`${sliceName3}/getDevicesByStatus`, (
919
946
  page = defaultPage2,
920
947
  perPage = defaultPerPage2,
921
948
  sortOptions = [],
922
- selectedAttributes = []
949
+ selectedAttributes = getSelectedDeviceAttribute(getState())
923
950
  } = options;
924
951
  const state = getState();
925
952
  const { applicableFilters, filterTerms } = convertDeviceListStateToFilters({
@@ -1032,7 +1059,6 @@ var getReportingLimits = createAsyncThunk2(
1032
1059
  })
1033
1060
  );
1034
1061
  var ensureVersionString = (software, fallback) => software.length && software !== "artifact_name" ? software.endsWith(".version") ? software : `${software}.version` : fallback;
1035
- var REPORT_CHART_SIZE_LIMIT = 6;
1036
1062
  var getSingleReportData = (reportConfig, groups) => {
1037
1063
  const { attribute, group, software = "" } = reportConfig;
1038
1064
  const filters = [{ key: "status", scope: "identity", operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: "accepted" }];
@@ -1112,6 +1138,13 @@ var getDeviceConnect = createAsyncThunk2(
1112
1138
  ({ data }) => Promise.all([dispatch(actions3.receivedDevice({ connect_status: data.status, connect_updated_ts: data.updated_ts, id })), Promise.resolve(data)])
1113
1139
  )
1114
1140
  );
1141
+ var updateTypeMap = { deploymentUpdate: "check-update", inventoryUpdate: "send-inventory" };
1142
+ var triggerDeviceUpdate = createAsyncThunk2(
1143
+ `${sliceName3}/triggerDeviceUpdate`,
1144
+ ({ id, type }, { dispatch }) => general_api_default.post(`${deviceConnect}/devices/${id}/${updateTypeMap[type] ?? updateTypeMap.deploymentUpdate}`).then(
1145
+ () => new Promise((resolve) => setTimeout(() => resolve(dispatch(getDeviceById2(id))), TIMEOUTS.threeSeconds))
1146
+ )
1147
+ );
1115
1148
  var getSessionDetails = createAsyncThunk2(`${sliceName3}/getSessionDetails`, ({ sessionId, deviceId, userId, startDate, endDate }) => {
1116
1149
  const { start: startUnix, end: endUnix } = dateRangeToUnix(startDate, endDate);
1117
1150
  const createdAfter = startDate ? `&created_after=${startUnix}` : "";
@@ -1214,12 +1247,12 @@ var deleteAuthset = createAsyncThunk2(
1214
1247
  );
1215
1248
  var preauthDevice = createAsyncThunk2(
1216
1249
  `${sliceName3}/preauthDevice`,
1217
- (authset, { dispatch }) => general_api_default.post(`${deviceAuthV2}/devices`, authset).catch((err) => {
1250
+ (authset, { dispatch, rejectWithValue }) => general_api_default.post(`${deviceAuthV2}/devices`, authset).then(() => Promise.resolve(dispatch(setSnackbar2("Device was successfully added to the preauthorization list", TIMEOUTS.fiveSeconds)))).catch((err) => {
1218
1251
  if (err.response.status === 409) {
1219
- return Promise.reject("A device with a matching identity data set already exists");
1252
+ return rejectWithValue("A device with a matching identity data set already exists");
1220
1253
  }
1221
1254
  return commonErrorHandler(err, "The device could not be added:", dispatch);
1222
- }).then(() => Promise.resolve(dispatch(setSnackbar2("Device was successfully added to the preauthorization list", TIMEOUTS.fiveSeconds))))
1255
+ })
1223
1256
  );
1224
1257
  var decommissionDevice = createAsyncThunk2(
1225
1258
  `${sliceName3}/decommissionDevice`,
@@ -1385,18 +1418,20 @@ var getDevicesInBounds = createAsyncThunk2(`${sliceName3}/getDevicesInBounds`, (
1385
1418
 
1386
1419
  // src/onboardingSlice/thunks.ts
1387
1420
  import { getDemoDeviceAddress } from "@northern.tech/utils/helpers";
1421
+ import { onboardingSteps as onboardingSteps2 } from "@northern.tech/utils/onboardingManager";
1422
+ import Tracking2 from "@northern.tech/utils/tracking";
1388
1423
  import { createAsyncThunk as createAsyncThunk3 } from "@reduxjs/toolkit";
1389
1424
  import Cookies from "universal-cookie";
1390
1425
  var cookies = new Cookies();
1391
1426
  var applyOnboardingFallbacks = (progress2) => {
1392
- const step = orderedOnboardingSteps[progress2];
1427
+ const step = onboardingSteps2[progress2];
1393
1428
  if (step && step.fallbackStep) {
1394
1429
  return step.fallbackStep;
1395
1430
  }
1396
1431
  return progress2;
1397
1432
  };
1398
1433
  var determineProgress = (acceptedDevices, pendingDevices, releases, pastDeployments) => {
1399
- const steps = orderedOnboardingSteps;
1434
+ const steps = Object.keys(onboardingSteps2);
1400
1435
  let progress2 = -1;
1401
1436
  progress2 = pendingDevices.length > 1 ? steps.findIndex((step) => step === onboardingSteps.DEVICES_PENDING_ACCEPTING_ONBOARDING) : progress2;
1402
1437
  progress2 = acceptedDevices.length >= 1 ? steps.findIndex((step) => step === onboardingSteps.DEVICES_ACCEPTED_ONBOARDING) : progress2;
@@ -1413,7 +1448,7 @@ var deductOnboardingState = ({ devicesById, devicesByStatus, onboardingState, pa
1413
1448
  const progress2 = applyOnboardingFallbacks(onboardingState.progress || determineProgress(acceptedDevices, pendingDevices, releases, pastDeployments));
1414
1449
  return {
1415
1450
  ...onboardingState,
1416
- complete: !!(Boolean(userCookie) || onboardingState.complete || acceptedDevices.length > 1 && pendingDevices.length > 0 && releases.length > 1 && pastDeployments.length > 1 || acceptedDevices.length >= 1 && releases.length >= 2 && pastDeployments.length > 2 || acceptedDevices.length >= 1 && pendingDevices.length > 0 && releases.length >= 2 && pastDeployments.length >= 2 || orderedOnboardingSteps.findIndex((step) => step === progress2) >= orderedOnboardingSteps.length - 1 || onboardingState.disable || ![canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases].every((i) => i)),
1451
+ complete: !!(Boolean(userCookie) || onboardingState.complete || acceptedDevices.length > 1 && pendingDevices.length > 0 && releases.length > 1 && pastDeployments.length > 1 || acceptedDevices.length >= 1 && releases.length >= 2 && pastDeployments.length > 2 || acceptedDevices.length >= 1 && pendingDevices.length > 0 && releases.length >= 2 && pastDeployments.length >= 2 || Object.keys(onboardingSteps2).findIndex((step) => step === progress2) >= Object.keys(onboardingSteps2).length - 1 || onboardingState.disable || ![canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases].every((i) => i)),
1417
1452
  showTips: onboardingState.showTips != null ? onboardingState.showTips : true,
1418
1453
  deviceType,
1419
1454
  approach: onboardingState.approach || (deviceType.some((type) => type.startsWith("qemu")) ? "virtual" : "physical"),
@@ -1466,10 +1501,10 @@ var setOnboardingCanceled = createAsyncThunk3(
1466
1501
  Promise.resolve(dispatch(actions4.setShowOnboardingHelp(false))),
1467
1502
  Promise.resolve(dispatch(actions4.setShowDismissOnboardingTipsDialog(false))),
1468
1503
  Promise.resolve(dispatch(actions4.setOnboardingComplete(true)))
1469
- ]).then(() => dispatch(advanceOnboarding(onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE)))
1504
+ ]).then(() => dispatch(advanceOnboarding(onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE))).then(() => Tracking2.event({ category: "onboarding", action: onboardingSteps2.ONBOARDING_CANCELED }))
1470
1505
  );
1471
1506
  var advanceOnboarding = createAsyncThunk3(`${sliceName4}/advanceOnboarding`, (stepId, { dispatch, getState }) => {
1472
- const steps = orderedOnboardingSteps;
1507
+ const steps = Object.keys(onboardingSteps2);
1473
1508
  const progress2 = steps.findIndex((step) => step === getState().onboarding.progress);
1474
1509
  const stepIndex = steps.findIndex((step) => step === stepId);
1475
1510
  if (progress2 > stepIndex || getState().onboarding.progress === null) {
@@ -1477,7 +1512,8 @@ var advanceOnboarding = createAsyncThunk3(`${sliceName4}/advanceOnboarding`, (st
1477
1512
  }
1478
1513
  const madeProgress = steps[stepIndex + 1];
1479
1514
  const state = { ...getOnboardingState(getState()), progress: madeProgress };
1480
- state.complete = stepIndex + 1 >= steps.findIndex((step) => step === onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE) ? true : state.complete;
1515
+ state.complete = stepIndex + 1 >= Object.keys(onboardingSteps2).findIndex((step) => step === onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE) ? true : state.complete;
1516
+ Tracking2.event({ category: "onboarding", action: stepId });
1481
1517
  return Promise.all([dispatch(actions4.setOnboardingProgress(madeProgress)), dispatch(saveUserSettings({ onboarding: state }))]);
1482
1518
  });
1483
1519
 
@@ -1556,7 +1592,7 @@ var startUpgrade = createAsyncThunk4(
1556
1592
  var cancelUpgrade = createAsyncThunk4(`${sliceName5}/cancelUpgrade`, (tenantId) => general_api_default.post(`${tenantadmApiUrlv2}/tenants/${tenantId}/upgrade/cancel`));
1557
1593
  var completeUpgrade = createAsyncThunk4(
1558
1594
  `${sliceName5}/completeUpgrade`,
1559
- ({ tenantId, plan }, { dispatch }) => general_api_default.post(`${tenantadmApiUrlv2}/tenants/${tenantId}/upgrade/complete`, { plan }).catch((err) => commonErrorHandler(err, `There was an error upgrading your account:`, dispatch)).then(() => Promise.resolve(dispatch(getUserOrganization())))
1595
+ ({ tenantId, plan, billing_profile }, { dispatch }) => general_api_default.post(`${tenantadmApiUrlv2}/tenants/${tenantId}/upgrade/complete`, { plan, billing_profile }).catch((err) => commonErrorHandler(err, `There was an error upgrading your account:`, dispatch)).then(() => Promise.all([dispatch(getDeviceLimit()), dispatch(getUserOrganization())]))
1560
1596
  );
1561
1597
  var prepareAuditlogQuery = ({ startDate, endDate, user: userFilter, type, detail: detailFilter, sort = {} }) => {
1562
1598
  const userId = userFilter?.id || userFilter;
@@ -1605,7 +1641,12 @@ var setAuditlogsState = createAsyncThunk4(`${sliceName5}/setAuditlogsState`, (se
1605
1641
  });
1606
1642
  var tenantDataDivergedMessage = "The system detected there is a change in your plan or purchased add-ons. Please log out and log in again";
1607
1643
  var addTenant = createAsyncThunk4(`${sliceName5}/createTenant`, (selectionState, { dispatch }) => {
1608
- return general_api_default.post(`${tenantadmApiUrlv2}/tenants`, selectionState).then(() => Promise.all([dispatch(getTenants()), dispatch(setSnackbar3("Tenant was created successfully."))])).catch((err) => commonErrorHandler(err, "There was an error creating tenant", dispatch, commonErrorFallback));
1644
+ return general_api_default.post(`${tenantadmApiUrlv2}/tenants`, selectionState).then(
1645
+ () => Promise.all([
1646
+ dispatch(setSnackbar3("Tenant was created successfully.")),
1647
+ new Promise((resolve) => setTimeout(() => resolve(dispatch(getTenants())), TIMEOUTS.oneSecond))
1648
+ ])
1649
+ ).catch((err) => commonErrorHandler(err, "There was an error creating tenant", dispatch, commonErrorFallback));
1609
1650
  });
1610
1651
  var tenantListRetrieval = async (config) => {
1611
1652
  const { page, perPage } = config;
@@ -1633,15 +1674,20 @@ var setTenantsListState = createAsyncThunk4(`${sliceName5}/setTenantsListState`,
1633
1674
  });
1634
1675
  var editTenantDeviceLimit = createAsyncThunk4(`${sliceName5}/editDeviceLimit`, ({ newLimit, id, name }, { dispatch }) => {
1635
1676
  return general_api_default.put(`${tenantadmApiUrlv2}/tenants/${id}/child`, { device_limit: newLimit, name }).catch((err) => commonErrorHandler(err, `Device Limit cannot be changed`, dispatch)).then(() => {
1636
- const tasks = [Promise.resolve(dispatch(setSnackbar3("Device Limit was changed successfully")))];
1637
- tasks.push(dispatch(getTenants()));
1638
- tasks.push(dispatch(getUserOrganization()));
1639
- return Promise.all(tasks);
1677
+ return Promise.all([
1678
+ dispatch(setSnackbar3("Device Limit was changed successfully")),
1679
+ dispatch(getUserOrganization()),
1680
+ new Promise((resolve) => setTimeout(() => resolve(dispatch(getTenants())), TIMEOUTS.oneSecond))
1681
+ ]);
1640
1682
  });
1641
1683
  });
1642
1684
  var removeTenant = createAsyncThunk4(`${sliceName5}/editDeviceLimit`, ({ id }, { dispatch }) => {
1643
1685
  return general_api_default.post(`${tenantadmApiUrlv2}/tenants/${id}/remove/start`).catch((err) => commonErrorHandler(err, `There was an error removing the tenant`, dispatch)).then(
1644
- () => Promise.all([Promise.resolve(dispatch(setSnackbar3("Device Limit was changed successfully"))), dispatch(getTenants()), dispatch(getUserOrganization())])
1686
+ () => Promise.all([
1687
+ dispatch(setSnackbar3("The tenant was removed successfully")),
1688
+ dispatch(getUserOrganization()),
1689
+ new Promise((resolve) => setTimeout(() => resolve(dispatch(getTenants())), TIMEOUTS.oneSecond))
1690
+ ])
1645
1691
  );
1646
1692
  });
1647
1693
  var getUserOrganization = createAsyncThunk4(`${sliceName5}/getUserOrganization`, (_, { dispatch, getState }) => {
@@ -1665,7 +1711,10 @@ var sendSupportMessage = createAsyncThunk4(
1665
1711
  );
1666
1712
  var requestPlanChange = createAsyncThunk4(
1667
1713
  `${sliceName5}/requestPlanChange`,
1668
- ({ content, tenantId }, { dispatch }) => general_api_default.post(`${tenantadmApiUrlv2}/tenants/${tenantId}/plan`, content).catch((err) => commonErrorHandler(err, "There was an error sending your request", dispatch, commonErrorFallback)).then(() => Promise.resolve(dispatch(setSnackbar3({ message: "Your request was sent successfully", autoHideDuration: TIMEOUTS.fiveSeconds }))))
1714
+ ({ content, tenantId }, { dispatch, rejectWithValue }) => general_api_default.post(`${tenantadmApiUrlv2}/tenants/${tenantId}/plan`, content).catch(async (err) => {
1715
+ await commonErrorHandler(err, "There was an error sending your request", dispatch, commonErrorFallback);
1716
+ rejectWithValue(err);
1717
+ }).then(() => Promise.resolve(dispatch(setSnackbar3({ message: "Your request was sent successfully", autoHideDuration: TIMEOUTS.fiveSeconds }))))
1669
1718
  );
1670
1719
  var downloadLicenseReport = createAsyncThunk4(
1671
1720
  `${sliceName5}/downloadLicenseReport`,
@@ -1758,6 +1807,7 @@ var getSsoConfigs = createAsyncThunk4(
1758
1807
  );
1759
1808
 
1760
1809
  // src/usersSlice/thunks.ts
1810
+ import { HELPTOOLTIPS } from "@northern.tech/common-ui/helptips";
1761
1811
  import { duplicateFilter, extractErrorMessage as extractErrorMessage2, isEmpty as isEmpty2, preformatWithRequestID } from "@northern.tech/utils/helpers";
1762
1812
  import { clearAllRetryTimers } from "@northern.tech/utils/retrytimer";
1763
1813
  import { createAsyncThunk as createAsyncThunk5 } from "@reduxjs/toolkit";
@@ -1776,7 +1826,7 @@ var handleLoginError = (err, { token2fa: has2FA, password }, rejectWithValue) =>
1776
1826
  }
1777
1827
  const twoFAError = is2FABackend ? " and verification code" : "";
1778
1828
  const errorMessage = `There was a problem logging in. Please check your email${twoFAError ? "," : " and"} password${twoFAError}. If you still have problems, contact an administrator.`;
1779
- return Promise.reject(dispatch(setSnackbar4(preformatWithRequestID(err.response, errorMessage), null, "Copy to clipboard")));
1829
+ return Promise.reject(dispatch(setSnackbar4({ message: preformatWithRequestID(err.response, errorMessage), action: "Copy to clipboard" })));
1780
1830
  };
1781
1831
  var loginUser = createAsyncThunk5(
1782
1832
  `${sliceName6}/loginUser`,
@@ -1800,19 +1850,16 @@ var loginUser = createAsyncThunk5(
1800
1850
  const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
1801
1851
  setSessionInfo({ token, expiresAt });
1802
1852
  cookies3.remove("JWT", { path: "/" });
1803
- return (
1804
- // @ts-ignore
1805
- Promise.resolve(dispatch(getUser(OWN_USER_ID))).unwrap().catch((e) => {
1806
- cleanUp();
1807
- return Promise.reject(dispatch(setSnackbar4(extractErrorMessage2(e))));
1808
- }).then(() => {
1809
- window.sessionStorage.removeItem("pendings-redirect");
1810
- if (window.location.pathname !== "/ui/") {
1811
- window.location.replace("/ui/");
1812
- }
1813
- return Promise.resolve(dispatch(actions6.successfullyLoggedIn({ expiresAt, token })));
1814
- })
1815
- );
1853
+ return dispatch(getUser(OWN_USER_ID)).unwrap().catch((e) => {
1854
+ cleanUp();
1855
+ return Promise.reject(dispatch(setSnackbar4(extractErrorMessage2(e))));
1856
+ }).then(() => {
1857
+ window.sessionStorage.removeItem("pendings-redirect");
1858
+ if (window.location.pathname !== "/ui/") {
1859
+ window.location.replace("/ui/");
1860
+ }
1861
+ return Promise.resolve(dispatch(actions6.successfullyLoggedIn({ expiresAt, token })));
1862
+ });
1816
1863
  })
1817
1864
  );
1818
1865
  var logoutUser = createAsyncThunk5(`${sliceName6}/logoutUser`, (_, { dispatch, getState }) => {
@@ -1830,6 +1877,7 @@ var switchUserOrganization = createAsyncThunk5(`${sliceName6}/switchUserOrganiza
1830
1877
  return Promise.reject();
1831
1878
  }
1832
1879
  return general_api_default.get(`${useradmApiUrlv1}/users/tenants/${tenantId}/token`).then(({ data: token }) => {
1880
+ window.sessionStorage.setItem("tenantChanged", "true");
1833
1881
  setSessionInfo({ ...getSessionInfo(), token });
1834
1882
  window.location.reload();
1835
1883
  });
@@ -1870,11 +1918,18 @@ var verify2FA = createAsyncThunk5(
1870
1918
  );
1871
1919
  var getUserList = createAsyncThunk5(
1872
1920
  `${sliceName6}/getUserList`,
1873
- (_, { dispatch }) => general_api_default.get(`${useradmApiUrlv1}/users`).then((res) => {
1874
- const users = res.data.reduce((accu, item) => {
1875
- accu[item.id] = item;
1876
- return accu;
1877
- }, {});
1921
+ (_, { dispatch, getState }) => general_api_default.get(`${useradmApiUrlv1}/users`).then((res) => {
1922
+ const currentUsersById = getUsersById(getState());
1923
+ const users = res.data.reduce(
1924
+ (accu, item) => {
1925
+ accu[item.id] = {
1926
+ ...accu[item.id],
1927
+ ...item
1928
+ };
1929
+ return accu;
1930
+ },
1931
+ { ...currentUsersById }
1932
+ );
1878
1933
  return dispatch(actions6.receivedUserList(users));
1879
1934
  }).catch((err) => commonErrorHandler(err, `Users couldn't be loaded.`, dispatch, commonErrorFallback))
1880
1935
  );
@@ -1883,9 +1938,7 @@ var getUser = createAsyncThunk5(
1883
1938
  (id, { dispatch, rejectWithValue }) => general_api_default.get(`${useradmApiUrlv1}/users/${id}`).then(
1884
1939
  ({ data: user }) => Promise.all([
1885
1940
  dispatch(actions6.receivedUser(user)),
1886
- // @ts-ignore
1887
1941
  dispatch(setHideAnnouncement({ shouldHide: false, userId: user.id })),
1888
- // @ts-ignore
1889
1942
  dispatch(updateUserColumnSettings({ currentUserId: user.id })),
1890
1943
  user
1891
1944
  ])
@@ -1932,10 +1985,7 @@ var createUser = createAsyncThunk5(
1932
1985
  );
1933
1986
  var removeUser = createAsyncThunk5(
1934
1987
  `${sliceName6}/removeUser`,
1935
- (userId, { dispatch }) => (
1936
- // @ts-ignore
1937
- general_api_default.delete(`${useradmApiUrlv1}/users/${userId}`).then(() => Promise.all([dispatch(actions6.removedUser(userId)), dispatch(getUserList()), dispatch(setSnackbar4(userActions.remove.successMessage))])).catch((err) => userActionErrorHandler(err, "remove", dispatch))
1938
- )
1988
+ (userId, { dispatch }) => general_api_default.delete(`${useradmApiUrlv1}/users/${userId}`).then(() => Promise.all([dispatch(actions6.removedUser(userId)), dispatch(getUserList()), dispatch(setSnackbar4(userActions.remove.successMessage))])).catch((err) => userActionErrorHandler(err, "remove", dispatch))
1939
1989
  );
1940
1990
  var editUser = createAsyncThunk5(
1941
1991
  `${sliceName6}/editUser`,
@@ -1956,7 +2006,7 @@ var enableUser2fa = createAsyncThunk5(
1956
2006
  );
1957
2007
  var disableUser2fa = createAsyncThunk5(
1958
2008
  `${sliceName6}/disableUser2fa`,
1959
- (userId = OWN_USER_ID, { dispatch }) => general_api_default.post(`${useradmApiUrlv1}/users/${userId}/2fa/disable`).catch((err) => commonErrorHandler(err, `There was an error disabling Two Factor authentication for the user.`, dispatch)).then(() => Promise.resolve(dispatch(getUser(userId))))
2009
+ (userId = OWN_USER_ID, { dispatch }) => general_api_default.post(`${useradmApiUrlv1}/users/${userId}/2fa/disable`).catch((err) => commonErrorHandler(err, `There was an error disabling Two Factor authentication for the user.`, dispatch)).then(() => Promise.all([dispatch(getUser(userId)), dispatch(actions6.receivedQrCode(null))]))
1960
2010
  );
1961
2011
  var mapHttpPermission = (permission) => Object.entries(uiPermissionsByArea).reduce(
1962
2012
  (accu, [area, definition]) => {
@@ -2109,7 +2159,6 @@ var getPermissionSets = createAsyncThunk5(
2109
2159
  accu[permissionSet.name] = permissionSetObject;
2110
2160
  return accu;
2111
2161
  },
2112
- // @ts-ignore
2113
2162
  { ...getState().users.permissionSetsById }
2114
2163
  );
2115
2164
  return Promise.all([dispatch(actions6.receivedPermissionSets(permissionSets)), permissionSets]);
@@ -2202,7 +2251,6 @@ var transformRoleDataToRole = (roleData, roleState = {}) => {
2202
2251
  role: {
2203
2252
  ...emptyRole,
2204
2253
  name,
2205
- // @ts-ignore
2206
2254
  description: description ? description : roleState.description,
2207
2255
  uiPermissions: {
2208
2256
  ...emptyUiPermissions,
@@ -2245,10 +2293,7 @@ var editRole = createAsyncThunk5(`${sliceName6}/editRole`, (roleData, { dispatch
2245
2293
  });
2246
2294
  var removeRole = createAsyncThunk5(
2247
2295
  `${sliceName6}/removeRole`,
2248
- (roleId, { dispatch }) => (
2249
- // @ts-ignore
2250
- general_api_default.delete(`${useradmApiUrlv2}/roles/${roleId}`).then(() => Promise.all([dispatch(actions6.removedRole(roleId)), dispatch(getRoles()), dispatch(setSnackbar4(roleActions.remove.successMessage))])).catch((err) => roleActionErrorHandler(err, "remove", dispatch))
2251
- )
2296
+ (roleId, { dispatch }) => general_api_default.delete(`${useradmApiUrlv2}/roles/${roleId}`).then(() => Promise.all([dispatch(actions6.removedRole(roleId)), dispatch(getRoles()), dispatch(setSnackbar4(roleActions.remove.successMessage))])).catch((err) => roleActionErrorHandler(err, "remove", dispatch))
2252
2297
  );
2253
2298
  var getGlobalSettings2 = createAsyncThunk5(
2254
2299
  `${sliceName6}/getGlobalSettings`,
@@ -2259,7 +2304,6 @@ var getGlobalSettings2 = createAsyncThunk5(
2259
2304
  );
2260
2305
  var saveGlobalSettings = createAsyncThunk5(
2261
2306
  `${sliceName6}/saveGlobalSettings`,
2262
- // @ts-ignore
2263
2307
  ({ beOptimistic = false, notify = false, ...settings }, { dispatch, getState }) => {
2264
2308
  if (!window.sessionStorage.getItem(settingsKeys.initialized) && !beOptimistic) {
2265
2309
  return;
@@ -2305,11 +2349,9 @@ var saveUserSettings = createAsyncThunk5(`${sliceName6}/saveUserSettings`, (sett
2305
2349
  const tooltipState = getTooltipsState(getState());
2306
2350
  const updatedSettings = {
2307
2351
  ...userSettings,
2308
- // @ts-ignore
2309
2352
  ...settings,
2310
2353
  onboarding: {
2311
2354
  ...onboardingState,
2312
- // @ts-ignore
2313
2355
  ...settings.onboarding
2314
2356
  },
2315
2357
  tooltips: tooltipState
@@ -2353,10 +2395,7 @@ var generateToken = createAsyncThunk5(
2353
2395
  );
2354
2396
  var revokeToken = createAsyncThunk5(
2355
2397
  `${sliceName6}/revokeToken`,
2356
- (token, { dispatch }) => (
2357
- // @ts-ignore
2358
- general_api_default.delete(`${useradmApiUrlv1}/settings/tokens/${token.id}`).then(() => Promise.resolve(dispatch(getTokens())))
2359
- )
2398
+ (token, { dispatch }) => general_api_default.delete(`${useradmApiUrlv1}/settings/tokens/${token.id}`).then(() => Promise.resolve(dispatch(getTokens())))
2360
2399
  );
2361
2400
  var setTooltipReadState = createAsyncThunk5(`${sliceName6}/setTooltipReadState`, ({ persist, ...remainder }, { dispatch }) => {
2362
2401
  let tasks = [dispatch(actions6.setTooltipState(remainder))];
@@ -2365,23 +2404,20 @@ var setTooltipReadState = createAsyncThunk5(`${sliceName6}/setTooltipReadState`,
2365
2404
  }
2366
2405
  return Promise.all(tasks);
2367
2406
  });
2368
- var setAllTooltipsReadState = createAsyncThunk5(`${sliceName6}/toggleHelptips`, ({ readState = READ_STATES.read, tooltips }, { dispatch }) => {
2369
- const updatedTips = tooltips.reduce((accu, id) => ({ ...accu, [id]: { readState } }), {});
2407
+ var setAllTooltipsReadState = createAsyncThunk5(`${sliceName6}/toggleHelptips`, (readState = READ_STATES.read, { dispatch }) => {
2408
+ const updatedTips = Object.keys(HELPTOOLTIPS).reduce((accu, id) => ({ ...accu, [id]: { readState } }), {});
2370
2409
  return Promise.resolve(dispatch(actions6.setTooltipsState(updatedTips))).then(() => dispatch(saveUserSettings()));
2371
2410
  });
2372
2411
  var submitFeedback = createAsyncThunk5(
2373
2412
  `${sliceName6}/submitFeedback`,
2374
- // @ts-ignore
2375
- ({ satisfaction, feedback, ...meta }, { dispatch }) => {
2376
- return general_api_default.post(`${tenantadmApiUrlv2}/contact/support`, {
2377
- subject: "feedback submission",
2378
- body: JSON.stringify({ feedback, satisfaction, meta })
2379
- }).then(() => {
2380
- const today = /* @__PURE__ */ new Date();
2381
- dispatch(saveUserSettings({ feedbackCollectedAt: today.toISOString().split("T")[0] }));
2382
- setTimeout(() => dispatch(actions6.setShowFeedbackDialog(false)), TIMEOUTS.threeSeconds);
2383
- });
2384
- }
2413
+ ({ satisfaction, feedback, ...meta }, { dispatch }) => general_api_default.post(`${tenantadmApiUrlv2}/contact/support`, {
2414
+ subject: "feedback submission",
2415
+ body: JSON.stringify({ feedback, satisfaction, meta })
2416
+ }).then(() => {
2417
+ const today = /* @__PURE__ */ new Date();
2418
+ dispatch(saveUserSettings({ feedbackCollectedAt: today.toISOString().split("T")[0] }));
2419
+ setTimeout(() => dispatch(actions6.setShowFeedbackDialog(false)), TIMEOUTS.threeSeconds);
2420
+ })
2385
2421
  );
2386
2422
 
2387
2423
  // src/appSlice/thunks.ts
@@ -2540,6 +2576,7 @@ export {
2540
2576
  deriveReportsData,
2541
2577
  getReportsDataWithoutBackendSupport,
2542
2578
  getDeviceConnect,
2579
+ triggerDeviceUpdate,
2543
2580
  getSessionDetails,
2544
2581
  getDeviceFileDownloadLink,
2545
2582
  deviceFileUpload,
@@ -2635,4 +2672,4 @@ export {
2635
2672
  setAllTooltipsReadState,
2636
2673
  submitFeedback
2637
2674
  };
2638
- //# sourceMappingURL=chunk-74OJIKXF.js.map
2675
+ //# sourceMappingURL=chunk-2JHFUQ6B.js.map