@northern.tech/store 0.1.3 → 0.2.1

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 (217) hide show
  1. package/dist/actions.js +251 -135
  2. package/dist/actions.js.map +1 -1
  3. package/dist/actions.mjs +13 -13
  4. package/dist/api/general-api.js +102 -51
  5. package/dist/api/general-api.js.map +1 -1
  6. package/dist/api/general-api.mjs +6 -6
  7. package/dist/api/users-api.js +104 -66
  8. package/dist/api/users-api.js.map +1 -1
  9. package/dist/api/users-api.mjs +7 -7
  10. package/dist/appSlice/constants.js +1 -39
  11. package/dist/appSlice/constants.js.map +1 -1
  12. package/dist/appSlice/constants.mjs +2 -2
  13. package/dist/appSlice/index.js +111 -64
  14. package/dist/appSlice/index.js.map +1 -1
  15. package/dist/appSlice/index.mjs +5 -5
  16. package/dist/appSlice/selectors.js +1 -43
  17. package/dist/appSlice/selectors.js.map +1 -1
  18. package/dist/appSlice/selectors.mjs +2 -2
  19. package/dist/appSlice/thunks.js +649 -552
  20. package/dist/appSlice/thunks.js.map +1 -1
  21. package/dist/appSlice/thunks.mjs +28 -28
  22. package/dist/auth.js +99 -51
  23. package/dist/auth.js.map +1 -1
  24. package/dist/auth.mjs +5 -5
  25. package/dist/{chunk-C2YZYTJ6.mjs → chunk-2Z3RFYW4.mjs} +2 -11
  26. package/dist/{chunk-C2YZYTJ6.mjs.map → chunk-2Z3RFYW4.mjs.map} +1 -1
  27. package/dist/{chunk-F37LUTBX.mjs → chunk-3ORTTLIB.mjs} +19 -16
  28. package/dist/{chunk-F37LUTBX.mjs.map → chunk-3ORTTLIB.mjs.map} +1 -1
  29. package/dist/{chunk-7E7KJHY3.mjs → chunk-4SDUITD4.mjs} +6 -12
  30. package/dist/{chunk-7E7KJHY3.mjs.map → chunk-4SDUITD4.mjs.map} +1 -1
  31. package/dist/{chunk-BOSBROA3.mjs → chunk-5VNQCCAQ.mjs} +2 -7
  32. package/dist/{chunk-BOSBROA3.mjs.map → chunk-5VNQCCAQ.mjs.map} +1 -1
  33. package/dist/{chunk-R2GBNXLV.mjs → chunk-65YIOCCD.mjs} +6 -11
  34. package/dist/{chunk-R2GBNXLV.mjs.map → chunk-65YIOCCD.mjs.map} +1 -1
  35. package/dist/{chunk-ZIYGEXSJ.mjs → chunk-6CSGHZ3E.mjs} +9 -21
  36. package/dist/{chunk-ZIYGEXSJ.mjs.map → chunk-6CSGHZ3E.mjs.map} +1 -1
  37. package/dist/{chunk-HRWZJQMH.mjs → chunk-AZRVRNXT.mjs} +40 -30
  38. package/dist/{chunk-HRWZJQMH.mjs.map → chunk-AZRVRNXT.mjs.map} +1 -1
  39. package/dist/{chunk-M4U5R7A4.mjs → chunk-B42NUKMZ.mjs} +2 -6
  40. package/dist/{chunk-M4U5R7A4.mjs.map → chunk-B42NUKMZ.mjs.map} +1 -1
  41. package/dist/{chunk-DZBVTSIX.mjs → chunk-CHUCIHMY.mjs} +3 -4
  42. package/dist/{chunk-DZBVTSIX.mjs.map → chunk-CHUCIHMY.mjs.map} +1 -1
  43. package/dist/{chunk-YNVSU3AA.mjs → chunk-DIZJVB6M.mjs} +307 -292
  44. package/dist/chunk-DIZJVB6M.mjs.map +1 -0
  45. package/dist/chunk-H5UCKQWK.mjs +41 -0
  46. package/dist/{chunk-IPPIKGIB.mjs.map → chunk-H5UCKQWK.mjs.map} +1 -1
  47. package/dist/{chunk-ZNST5R6O.mjs → chunk-IFWKT27G.mjs} +92 -29
  48. package/dist/chunk-IFWKT27G.mjs.map +1 -0
  49. package/dist/{chunk-6667TCAJ.mjs → chunk-JA27QXVB.mjs} +37 -28
  50. package/dist/{chunk-6667TCAJ.mjs.map → chunk-JA27QXVB.mjs.map} +1 -1
  51. package/dist/{chunk-HVHZG2H4.mjs → chunk-K2NZL5V4.mjs} +4 -7
  52. package/dist/chunk-K2NZL5V4.mjs.map +1 -0
  53. package/dist/{chunk-RQOE5OOT.mjs → chunk-KJAZNKV2.mjs} +66 -55
  54. package/dist/chunk-KJAZNKV2.mjs.map +1 -0
  55. package/dist/{chunk-G32LAKW4.mjs → chunk-KPPU6OWF.mjs} +27 -39
  56. package/dist/{chunk-G32LAKW4.mjs.map → chunk-KPPU6OWF.mjs.map} +1 -1
  57. package/dist/{chunk-BJSH2G7W.mjs → chunk-KZSTW27Q.mjs} +30 -18
  58. package/dist/{chunk-BJSH2G7W.mjs.map → chunk-KZSTW27Q.mjs.map} +1 -1
  59. package/dist/chunk-LZOMFHX3.mjs +38 -0
  60. package/dist/{chunk-XYVPYFSM.mjs → chunk-NJNSCJEY.mjs} +22 -26
  61. package/dist/{chunk-XYVPYFSM.mjs.map → chunk-NJNSCJEY.mjs.map} +1 -1
  62. package/dist/{chunk-N7G6QK2E.mjs → chunk-O6TYYKSD.mjs} +62 -60
  63. package/dist/chunk-O6TYYKSD.mjs.map +1 -0
  64. package/dist/{chunk-G3I53JGW.mjs → chunk-QQBUNZHA.mjs} +3 -6
  65. package/dist/{chunk-G3I53JGW.mjs.map → chunk-QQBUNZHA.mjs.map} +1 -1
  66. package/dist/{chunk-TD45YTYK.mjs → chunk-R7LXL3KJ.mjs} +22 -23
  67. package/dist/chunk-R7LXL3KJ.mjs.map +1 -0
  68. package/dist/{chunk-G7LATUT6.mjs → chunk-WCUGLHYM.mjs} +16 -20
  69. package/dist/{chunk-G7LATUT6.mjs.map → chunk-WCUGLHYM.mjs.map} +1 -1
  70. package/dist/chunk-WYHJFSMQ.mjs +25 -0
  71. package/dist/{chunk-IVSYYXTC.mjs.map → chunk-WYHJFSMQ.mjs.map} +1 -1
  72. package/dist/{chunk-O6O3D52B.mjs → chunk-XC5UXEIB.mjs} +4 -11
  73. package/dist/{chunk-O6O3D52B.mjs.map → chunk-XC5UXEIB.mjs.map} +1 -1
  74. package/dist/{chunk-BRHSKNFC.mjs → chunk-XD7INCM4.mjs} +11 -17
  75. package/dist/{chunk-BRHSKNFC.mjs.map → chunk-XD7INCM4.mjs.map} +1 -1
  76. package/dist/{chunk-RH6ONMG7.mjs → chunk-ZE7R2XXE.mjs} +10 -12
  77. package/dist/{chunk-RH6ONMG7.mjs.map → chunk-ZE7R2XXE.mjs.map} +1 -1
  78. package/dist/{chunk-HXPYJ6QN.mjs → chunk-ZK4W5T53.mjs} +7 -11
  79. package/dist/{chunk-HXPYJ6QN.mjs.map → chunk-ZK4W5T53.mjs.map} +1 -1
  80. package/dist/commonConstants.d.mts +18 -19
  81. package/dist/commonConstants.d.ts +18 -19
  82. package/dist/commonConstants.js +2 -35
  83. package/dist/commonConstants.js.map +1 -1
  84. package/dist/commonConstants.mjs +2 -2
  85. package/dist/commonSelectors.d.mts +42 -1
  86. package/dist/commonSelectors.d.ts +42 -1
  87. package/dist/commonSelectors.js +149 -129
  88. package/dist/commonSelectors.js.map +1 -1
  89. package/dist/commonSelectors.mjs +14 -12
  90. package/dist/constants.d.mts +3 -3
  91. package/dist/constants.d.ts +3 -3
  92. package/dist/constants.js +92 -147
  93. package/dist/constants.js.map +1 -1
  94. package/dist/constants.mjs +18 -14
  95. package/dist/deploymentsSlice/constants.js +94 -55
  96. package/dist/deploymentsSlice/constants.js.map +1 -1
  97. package/dist/deploymentsSlice/constants.mjs +4 -4
  98. package/dist/deploymentsSlice/index.js +128 -75
  99. package/dist/deploymentsSlice/index.js.map +1 -1
  100. package/dist/deploymentsSlice/index.mjs +5 -5
  101. package/dist/deploymentsSlice/selectors.js +95 -48
  102. package/dist/deploymentsSlice/selectors.js.map +1 -1
  103. package/dist/deploymentsSlice/selectors.mjs +5 -5
  104. package/dist/deploymentsSlice/thunks.js +649 -561
  105. package/dist/deploymentsSlice/thunks.js.map +1 -1
  106. package/dist/deploymentsSlice/thunks.mjs +28 -28
  107. package/dist/devicesSlice/constants.js +94 -54
  108. package/dist/devicesSlice/constants.js.map +1 -1
  109. package/dist/devicesSlice/constants.mjs +4 -4
  110. package/dist/devicesSlice/index.js +131 -77
  111. package/dist/devicesSlice/index.js.map +1 -1
  112. package/dist/devicesSlice/index.mjs +5 -5
  113. package/dist/devicesSlice/selectors.js +100 -85
  114. package/dist/devicesSlice/selectors.js.map +1 -1
  115. package/dist/devicesSlice/selectors.mjs +5 -5
  116. package/dist/devicesSlice/thunks.js +649 -597
  117. package/dist/devicesSlice/thunks.js.map +1 -1
  118. package/dist/devicesSlice/thunks.mjs +28 -28
  119. package/dist/monitorSlice/constants.js +94 -41
  120. package/dist/monitorSlice/constants.js.map +1 -1
  121. package/dist/monitorSlice/constants.mjs +4 -4
  122. package/dist/monitorSlice/index.js +101 -48
  123. package/dist/monitorSlice/index.js.map +1 -1
  124. package/dist/monitorSlice/index.mjs +5 -5
  125. package/dist/monitorSlice/selectors.js +0 -4
  126. package/dist/monitorSlice/selectors.mjs +1 -1
  127. package/dist/monitorSlice/thunks.js +333 -238
  128. package/dist/monitorSlice/thunks.js.map +1 -1
  129. package/dist/monitorSlice/thunks.mjs +25 -25
  130. package/dist/onboardingSlice/constants.js +0 -5
  131. package/dist/onboardingSlice/constants.mjs +1 -1
  132. package/dist/onboardingSlice/index.js +1 -22
  133. package/dist/onboardingSlice/index.js.map +1 -1
  134. package/dist/onboardingSlice/index.mjs +2 -2
  135. package/dist/onboardingSlice/selectors.js +0 -4
  136. package/dist/onboardingSlice/selectors.mjs +1 -1
  137. package/dist/onboardingSlice/thunks.js +649 -555
  138. package/dist/onboardingSlice/thunks.js.map +1 -1
  139. package/dist/onboardingSlice/thunks.mjs +28 -28
  140. package/dist/organizationSlice/constants.d.mts +6 -1
  141. package/dist/organizationSlice/constants.d.ts +6 -1
  142. package/dist/organizationSlice/constants.js +89 -51
  143. package/dist/organizationSlice/constants.js.map +1 -1
  144. package/dist/organizationSlice/constants.mjs +6 -4
  145. package/dist/organizationSlice/index.d.mts +224 -246
  146. package/dist/organizationSlice/index.d.ts +224 -246
  147. package/dist/organizationSlice/index.js +113 -59
  148. package/dist/organizationSlice/index.js.map +1 -1
  149. package/dist/organizationSlice/index.mjs +5 -5
  150. package/dist/organizationSlice/selectors.js +96 -58
  151. package/dist/organizationSlice/selectors.js.map +1 -1
  152. package/dist/organizationSlice/selectors.mjs +5 -5
  153. package/dist/organizationSlice/thunks.js +649 -580
  154. package/dist/organizationSlice/thunks.js.map +1 -1
  155. package/dist/organizationSlice/thunks.mjs +28 -28
  156. package/dist/releasesSlice/constants.js +0 -7
  157. package/dist/releasesSlice/constants.mjs +1 -1
  158. package/dist/releasesSlice/index.js +98 -60
  159. package/dist/releasesSlice/index.js.map +1 -1
  160. package/dist/releasesSlice/index.mjs +5 -5
  161. package/dist/releasesSlice/selectors.js +97 -53
  162. package/dist/releasesSlice/selectors.js.map +1 -1
  163. package/dist/releasesSlice/selectors.mjs +6 -6
  164. package/dist/releasesSlice/thunks.js +377 -287
  165. package/dist/releasesSlice/thunks.js.map +1 -1
  166. package/dist/releasesSlice/thunks.mjs +25 -25
  167. package/dist/selectors.d.mts +1 -1
  168. package/dist/selectors.d.ts +1 -1
  169. package/dist/selectors.js +150 -202
  170. package/dist/selectors.js.map +1 -1
  171. package/dist/selectors.mjs +45 -43
  172. package/dist/store.d.mts +235 -135
  173. package/dist/store.d.ts +235 -135
  174. package/dist/store.js +262 -157
  175. package/dist/store.js.map +1 -1
  176. package/dist/store.mjs +16 -16
  177. package/dist/storehooks.d.mts +3 -1
  178. package/dist/storehooks.d.ts +3 -1
  179. package/dist/storehooks.js +686 -569
  180. package/dist/storehooks.js.map +1 -1
  181. package/dist/storehooks.mjs +71 -54
  182. package/dist/storehooks.mjs.map +1 -1
  183. package/dist/thunks.js +649 -710
  184. package/dist/thunks.js.map +1 -1
  185. package/dist/thunks.mjs +28 -28
  186. package/dist/usersSlice/constants.d.mts +192 -17
  187. package/dist/usersSlice/constants.d.ts +192 -17
  188. package/dist/usersSlice/constants.js +97 -61
  189. package/dist/usersSlice/constants.js.map +1 -1
  190. package/dist/usersSlice/constants.mjs +6 -4
  191. package/dist/usersSlice/index.d.mts +1628 -704
  192. package/dist/usersSlice/index.d.ts +1628 -704
  193. package/dist/usersSlice/index.js +122 -67
  194. package/dist/usersSlice/index.js.map +1 -1
  195. package/dist/usersSlice/index.mjs +5 -5
  196. package/dist/usersSlice/selectors.js +101 -62
  197. package/dist/usersSlice/selectors.js.map +1 -1
  198. package/dist/usersSlice/selectors.mjs +6 -6
  199. package/dist/usersSlice/thunks.js +649 -584
  200. package/dist/usersSlice/thunks.js.map +1 -1
  201. package/dist/usersSlice/thunks.mjs +28 -28
  202. package/dist/utils.d.mts +6 -5
  203. package/dist/utils.d.ts +6 -5
  204. package/dist/utils.js +117 -89
  205. package/dist/utils.js.map +1 -1
  206. package/dist/utils.mjs +5 -5
  207. package/package.json +66 -1
  208. package/dist/chunk-HVHZG2H4.mjs.map +0 -1
  209. package/dist/chunk-IPPIKGIB.mjs +0 -35
  210. package/dist/chunk-IVSYYXTC.mjs +0 -36
  211. package/dist/chunk-N7G6QK2E.mjs.map +0 -1
  212. package/dist/chunk-RQOE5OOT.mjs.map +0 -1
  213. package/dist/chunk-TD45YTYK.mjs.map +0 -1
  214. package/dist/chunk-XWBD7VOK.mjs +0 -93
  215. package/dist/chunk-YNVSU3AA.mjs.map +0 -1
  216. package/dist/chunk-ZNST5R6O.mjs.map +0 -1
  217. /package/dist/{chunk-XWBD7VOK.mjs.map → chunk-LZOMFHX3.mjs.map} +0 -0
@@ -1,40 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __restKey = (key) => typeof key === "symbol" ? key : key + "";
26
- var __objRest = (source, exclude) => {
27
- var target = {};
28
- for (var prop in source)
29
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
- target[prop] = source[prop];
31
- if (source != null && __getOwnPropSymbols)
32
- for (var prop of __getOwnPropSymbols(source)) {
33
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
- target[prop] = source[prop];
35
- }
36
- return target;
37
- };
38
8
  var __export = (target, all) => {
39
9
  for (var name in all)
40
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -90,7 +60,7 @@ var chartTypes = {
90
60
  };
91
61
  var emptyChartSelection = { software: "", group: "", chartType: chartTypes.bar.key, attribute: "artifact_name" };
92
62
  var defaultReportType = "distribution";
93
- var defaultReports = [__spreadProps(__spreadValues({}, emptyChartSelection), { group: null, attribute: "artifact_name", type: defaultReportType })];
63
+ var defaultReports = [{ ...emptyChartSelection, group: null, attribute: "artifact_name", type: defaultReportType }];
94
64
  var PLANS = {
95
65
  os: {
96
66
  id: "os",
@@ -412,13 +382,14 @@ var emptyUiPermissions = Object.freeze({
412
382
  deployments: [],
413
383
  groups: Object.freeze({}),
414
384
  releases: Object.freeze({}),
385
+ tenantManagement: [],
415
386
  userManagement: []
416
387
  });
417
388
  var emptyRole = Object.freeze({
418
389
  name: void 0,
419
390
  description: "",
420
391
  permissions: [],
421
- uiPermissions: Object.freeze(__spreadValues({}, emptyUiPermissions))
392
+ uiPermissions: Object.freeze({ ...emptyUiPermissions })
422
393
  });
423
394
 
424
395
  // src/deploymentsSlice/constants.ts
@@ -447,11 +418,12 @@ var deploymentStatesToSubstates = {
447
418
  pending: [deploymentSubstates.pending],
448
419
  successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact]
449
420
  };
450
- var deploymentStatesToSubstatesWithSkipped = __spreadProps(__spreadValues({}, deploymentStatesToSubstates), {
421
+ var deploymentStatesToSubstatesWithSkipped = {
422
+ ...deploymentStatesToSubstates,
451
423
  failures: [deploymentSubstates.failure],
452
424
  skipped: [deploymentSubstates.aborted, deploymentSubstates.noartifact, deploymentSubstates.alreadyInstalled, deploymentSubstates.decommissioned],
453
425
  successes: [deploymentSubstates.success]
454
- });
426
+ };
455
427
  var installationSubstatesMap = {
456
428
  download: {
457
429
  title: "download",
@@ -496,8 +468,8 @@ var DEPLOYMENT_STATES = {
496
468
  var listDefaultsByState = {
497
469
  [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },
498
470
  [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },
499
- [DEPLOYMENT_STATES.scheduled]: __spreadValues({}, DEVICE_LIST_DEFAULTS),
500
- [DEPLOYMENT_STATES.finished]: __spreadValues({}, DEVICE_LIST_DEFAULTS),
471
+ [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },
472
+ [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },
501
473
  sort: { direction: SORTING_OPTIONS.desc }
502
474
  };
503
475
  var DEFAULT_PENDING_INPROGRESS_COUNT = 10;
@@ -624,6 +596,13 @@ var auditLogsApiUrl = `${apiUrl.v1}/auditlogs`;
624
596
  var tenantadmApiUrlv1 = `${apiUrl.v1}/tenantadm`;
625
597
  var tenantadmApiUrlv2 = `${apiUrl.v2}/tenantadm`;
626
598
  var ssoIdpApiUrlv1 = `${apiUrl.v1}/useradm/sso/idp/metadata`;
599
+ var AUDIT_LOGS_TYPES = [
600
+ { title: "Artifact", queryParameter: "object_type", value: "artifact" },
601
+ { title: "Deployment", queryParameter: "object_deployment_name", value: "deployment" },
602
+ { title: "Device", queryParameter: "object_id", value: "device" },
603
+ { title: "User", queryParameter: "object_id", value: "user" }
604
+ ];
605
+ var SP_AUDIT_LOGS_TYPES = [AUDIT_LOGS_TYPES[3], { title: "Tenant", queryParameter: "object_id", value: "tenant" }];
627
606
  var emptyWebhook = {
628
607
  description: "",
629
608
  enabled: true,
@@ -671,10 +650,12 @@ var permissionSetIds = {
671
650
  DeployToDevices: "DeployToDevices",
672
651
  ManageDevices: "ManageDevices",
673
652
  ManageReleases: "ManageReleases",
653
+ ManageTenants: "ManageTenants",
674
654
  ManageUsers: "ManageUsers",
675
655
  ReadAuditLogs: "ReadAuditLogs",
676
656
  ReadDevices: "ReadDevices",
677
657
  ReadReleases: "ReadReleases",
658
+ ReadTenants: "ReadTenants",
678
659
  ReadUsers: "ReadUsers",
679
660
  SuperUser: "SuperUser",
680
661
  UploadArtifacts: "UploadArtifacts"
@@ -713,6 +694,7 @@ var uiPermissionsById = {
713
694
  permissionSets: {
714
695
  groups: permissionSetIds.ManageDevices,
715
696
  releases: permissionSetIds.ManageReleases,
697
+ tenantManagement: permissionSetIds.ManageTenants,
716
698
  userManagement: permissionSetIds.ManageUsers
717
699
  },
718
700
  title: "Manage",
@@ -726,6 +708,7 @@ var uiPermissionsById = {
726
708
  auditlog: permissionSetIds.ReadAuditLogs,
727
709
  groups: permissionSetIds.ReadDevices,
728
710
  releases: permissionSetIds.ReadReleases,
711
+ tenantManagement: permissionSetIds.ReadTenants,
729
712
  userManagement: permissionSetIds.ReadUsers
730
713
  },
731
714
  title: "Read",
@@ -750,6 +733,7 @@ var uiPermissionsByArea = {
750
733
  auditlog: {
751
734
  endpoints: [{ path: /\/(auditlog)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] }],
752
735
  explanation: "Granting access to the audit log will allow tracing changes to devices, releases and user accounts, as well as providing information about deployments.",
736
+ key: "auditlog",
753
737
  uiPermissions: [uiPermissionsById.read],
754
738
  title: "System audit log"
755
739
  },
@@ -760,6 +744,7 @@ var uiPermissionsByArea = {
760
744
  { path: /\/(deployments\/config)/i, types: [PermissionTypes.Get, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] }
761
745
  ],
762
746
  explanation: "Providing deploy permissions will allow deployments to be created using the releases and devices a user has access to.",
747
+ key: "deployments",
763
748
  uiPermissions: [uiPermissionsById.read, uiPermissionsById.deploy],
764
749
  title: "Deployments"
765
750
  },
@@ -775,6 +760,7 @@ var uiPermissionsByArea = {
775
760
  { path: /\/(deviceconnect\/devices)/i, types: [PermissionTypes.Get, PermissionTypes.Post], uiPermissions: [uiPermissionsById.connect] }
776
761
  ],
777
762
  explanation: "Device group management permissions control the degree to which devices in a group can be accessed and moved to other groups.",
763
+ key: "groups",
778
764
  scope: scopedPermissionAreas.groups.scopeType,
779
765
  uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.deploy, uiPermissionsById.configure, uiPermissionsById.connect],
780
766
  title: "Group Management"
@@ -794,16 +780,29 @@ var uiPermissionsByArea = {
794
780
  }
795
781
  ],
796
782
  explanation: "Release permissions can be granted to allow artifact & release modifications, as well as the creation of new releases.",
783
+ key: "releases",
797
784
  scope: "ReleaseTags",
798
785
  uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.upload],
799
786
  title: "Release Management"
800
787
  },
788
+ tenantManagement: {
789
+ endpoints: [
790
+ { path: /\/(tenantadm\/tenants)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },
791
+ { path: /\/(tenantadm\/tenants)/i, types: [PermissionTypes.Post, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] },
792
+ { path: /\/(users\/exists)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.manage] }
793
+ ],
794
+ explanation: "Tenant management permissions allow listing, creating and modifying child tenants",
795
+ key: "tenantManagement",
796
+ uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],
797
+ title: "Tenant Management"
798
+ },
801
799
  userManagement: {
802
800
  endpoints: [
803
801
  { path: /\/(useradm)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },
804
802
  { path: /\/(useradm)/i, types: [PermissionTypes.Post], uiPermissions: [uiPermissionsById.manage] }
805
803
  ],
806
804
  explanation: "User management permissions should be granted carefully, as these allow privilege increases for any users managed by a user with user management permissions",
805
+ key: "userManagement",
807
806
  uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],
808
807
  title: "User Management"
809
808
  }
@@ -816,56 +815,87 @@ var rolesById = Object.freeze({
816
815
  description: "Full access",
817
816
  permissions: [],
818
817
  // permissions refers to the values returned from the backend
819
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
818
+ uiPermissions: {
819
+ ...emptyUiPermissions,
820
820
  auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
821
821
  deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
822
822
  groups: { [ALL_DEVICES]: uiPermissionsByArea.groups.uiPermissions.map(permissionMapper) },
823
823
  releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) },
824
824
  userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper)
825
- })
825
+ }
826
826
  },
827
827
  [staticRolesByName.readOnly]: {
828
828
  name: "Read Access",
829
829
  value: staticRolesByName.readOnly,
830
830
  description: "",
831
831
  permissions: [],
832
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
832
+ uiPermissions: {
833
+ ...emptyUiPermissions,
833
834
  deployments: [uiPermissionsById.read.value],
834
835
  groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] },
835
836
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] },
836
837
  userManagement: [uiPermissionsById.read.value]
837
- })
838
+ }
838
839
  },
839
840
  [staticRolesByName.ci]: {
840
841
  name: "Releases Manager",
841
842
  value: staticRolesByName.ci,
842
843
  description: "",
843
844
  permissions: [],
844
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
845
+ uiPermissions: {
846
+ ...emptyUiPermissions,
845
847
  releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) }
846
- })
848
+ }
847
849
  },
848
850
  [staticRolesByName.deploymentsManager]: {
849
851
  name: "Deployments Manager",
850
852
  value: staticRolesByName.deploymentsManager,
851
853
  description: "",
852
854
  permissions: [],
853
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
855
+ uiPermissions: {
856
+ ...emptyUiPermissions,
854
857
  deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
855
858
  groups: { [ALL_DEVICES]: [uiPermissionsById.deploy.value, uiPermissionsById.read.value] },
856
859
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }
857
- })
860
+ }
858
861
  },
859
862
  [staticRolesByName.terminalAccess]: {
860
863
  name: "Troubleshooting",
861
864
  value: staticRolesByName.terminalAccess,
862
865
  description: "Access to the troubleshooting features: Remote Terminal, File Transfer, Port Forwarding",
863
866
  permissions: [],
864
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
867
+ uiPermissions: {
868
+ ...emptyUiPermissions,
865
869
  groups: { [ALL_DEVICES]: [uiPermissionsById.connect.value] }
866
- })
870
+ }
867
871
  }
868
872
  });
873
+ var serviceProviderRolesById = {
874
+ admin: {
875
+ name: "Admin",
876
+ value: staticRolesByName.admin,
877
+ description: "Full access",
878
+ permissions: [],
879
+ uiPermissions: {
880
+ ...emptyUiPermissions,
881
+ auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
882
+ userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper),
883
+ tenantManagement: uiPermissionsByArea.tenantManagement.uiPermissions.map(permissionMapper)
884
+ }
885
+ },
886
+ readOnly: {
887
+ name: "Read access",
888
+ value: staticRolesByName.admin,
889
+ description: "This role can see all linked organizations but cannot make any changes",
890
+ permissions: [],
891
+ uiPermissions: {
892
+ ...emptyUiPermissions,
893
+ auditlog: [uiPermissionsById.read.value],
894
+ userManagement: [uiPermissionsById.read.value],
895
+ tenantManagement: [uiPermissionsById.read.value]
896
+ }
897
+ }
898
+ };
869
899
  var defaultPermissionSets = {
870
900
  [permissionSetIds.Basic]: {
871
901
  name: permissionSetIds.Basic,
@@ -876,7 +906,9 @@ var defaultPermissionSets = {
876
906
  },
877
907
  [permissionSetIds.SuperUser]: {
878
908
  name: permissionSetIds.SuperUser,
879
- result: __spreadValues({}, rolesById[staticRolesByName.admin].uiPermissions)
909
+ result: {
910
+ ...rolesById[staticRolesByName.admin].uiPermissions
911
+ }
880
912
  },
881
913
  [permissionSetIds.ManageUsers]: {
882
914
  name: permissionSetIds.ManageUsers,
@@ -896,6 +928,18 @@ var defaultPermissionSets = {
896
928
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }
897
929
  }
898
930
  },
931
+ [permissionSetIds.ReadTenants]: {
932
+ name: permissionSetIds.ReadTenants,
933
+ result: {
934
+ tenantManagement: [uiPermissionsById.read.value]
935
+ }
936
+ },
937
+ [permissionSetIds.ManageTenants]: {
938
+ name: permissionSetIds.ManageTenants,
939
+ result: {
940
+ tenantManagement: [uiPermissionsById.manage.value]
941
+ }
942
+ },
899
943
  [permissionSetIds.ReadUsers]: {
900
944
  name: permissionSetIds.ReadUsers,
901
945
  result: {
@@ -948,11 +992,12 @@ var defaultPermissionSets = {
948
992
  }
949
993
  };
950
994
  var USER_LOGOUT = "USER_LOGOUT";
951
- var rolesByName = __spreadProps(__spreadValues({}, staticRolesByName), {
995
+ var rolesByName = {
996
+ ...staticRolesByName,
952
997
  deploymentCreation: { action: "CREATE_DEPLOYMENT", object: { type: "DEVICE_GROUP", value: void 0 } },
953
998
  groupAccess: { action: "VIEW_DEVICE", object: { type: "DEVICE_GROUP", value: void 0 } },
954
999
  userManagement: { action: "http", object: { type: "any", value: `${useradmApiUrlv1}/.*` } }
955
- });
1000
+ };
956
1001
  var twoFAStates = {
957
1002
  enabled: "enabled",
958
1003
  disabled: "disabled",
@@ -1040,7 +1085,10 @@ var appSlice = (0, import_toolkit.createSlice)({
1040
1085
  initialState,
1041
1086
  reducers: {
1042
1087
  setFeatures: (state, action) => {
1043
- state.features = __spreadValues(__spreadValues({}, state.features), action.payload);
1088
+ state.features = {
1089
+ ...state.features,
1090
+ ...action.payload
1091
+ };
1044
1092
  },
1045
1093
  setSnackbar: (state, { payload }) => {
1046
1094
  let { message, autoHideDuration, action, children, onClick, onClose } = payload;
@@ -1065,7 +1113,10 @@ var appSlice = (0, import_toolkit.createSlice)({
1065
1113
  state.hostedAnnouncement = action.payload;
1066
1114
  },
1067
1115
  setSearchState: (state, action) => {
1068
- state.searchState = __spreadValues(__spreadValues({}, state.searchState), action.payload);
1116
+ state.searchState = {
1117
+ ...state.searchState,
1118
+ ...action.payload
1119
+ };
1069
1120
  },
1070
1121
  setOfflineThreshold: (state, action) => {
1071
1122
  state.offlineThreshold = action.payload;
@@ -1076,20 +1127,23 @@ var appSlice = (0, import_toolkit.createSlice)({
1076
1127
  },
1077
1128
  uploadProgress: (state, action) => {
1078
1129
  const { id, progress } = action.payload;
1079
- state.uploadsById[id] = __spreadProps(__spreadValues({}, state.uploadsById[id]), {
1130
+ state.uploadsById[id] = {
1131
+ ...state.uploadsById[id],
1080
1132
  progress
1081
- });
1133
+ };
1082
1134
  },
1083
1135
  cleanUpUpload: (state, action) => {
1084
- var _a;
1085
- const _b2 = state.uploadsById, { [_a = action.payload]: current } = _b2, remainder = __objRest(_b2, [__restKey(_a)]);
1136
+ const { [action.payload]: current, ...remainder } = state.uploadsById;
1086
1137
  state.uploadsById = remainder;
1087
1138
  },
1088
1139
  setVersionInformation: (state, action) => {
1089
- state.versionInformation = __spreadValues(__spreadValues({}, state.versionInformation), action.payload);
1140
+ state.versionInformation = {
1141
+ ...state.versionInformation,
1142
+ ...action.payload
1143
+ };
1090
1144
  },
1091
1145
  setEnvironmentData: (state, action) => {
1092
- return __spreadValues(__spreadValues({}, state), action.payload);
1146
+ return { ...state, ...action.payload };
1093
1147
  }
1094
1148
  }
1095
1149
  });
@@ -1121,7 +1175,7 @@ var initialState2 = {
1121
1175
  sourceWindow: -1
1122
1176
  },
1123
1177
  binaryDeltaLimits: {
1124
- timeout: __spreadProps(__spreadValues({}, limitDefault), { default: 60, max: 3600, min: 60 }),
1178
+ timeout: { ...limitDefault, default: 60, max: 3600, min: 60 },
1125
1179
  sourceWindow: limitDefault,
1126
1180
  inputWindow: limitDefault,
1127
1181
  duplicatesWindow: limitDefault,
@@ -1131,10 +1185,10 @@ var initialState2 = {
1131
1185
  deploymentDeviceLimit: 5e3,
1132
1186
  selectedDeviceIds: [],
1133
1187
  selectionState: {
1134
- finished: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" }),
1135
- inprogress: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] }),
1136
- pending: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] }),
1137
- scheduled: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { selection: [] }),
1188
+ finished: { ...DEVICE_LIST_DEFAULTS, endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" },
1189
+ inprogress: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
1190
+ pending: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
1191
+ scheduled: { ...DEVICE_LIST_DEFAULTS, selection: [] },
1138
1192
  general: {
1139
1193
  state: DEPLOYMENT_ROUTES.active.key,
1140
1194
  showCreationDialog: false,
@@ -1150,40 +1204,55 @@ var deploymentsSlice = (0, import_toolkit2.createSlice)({
1150
1204
  initialState: initialState2,
1151
1205
  reducers: {
1152
1206
  createdDeployment: (state, action) => {
1153
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, deploymentPrototype), action.payload);
1207
+ state.byId[action.payload.id] = {
1208
+ ...deploymentPrototype,
1209
+ ...action.payload
1210
+ };
1154
1211
  state.byStatus[DEPLOYMENT_STATES.pending].total = state.byStatus[DEPLOYMENT_STATES.pending].total + 1;
1155
1212
  state.byStatus[DEPLOYMENT_STATES.pending].deploymentIds = [...state.byStatus.pending.deploymentIds, action.payload.id];
1156
1213
  state.selectionState[DEPLOYMENT_STATES.pending].selection = [action.payload.id, ...state.selectionState[DEPLOYMENT_STATES.pending].selection], state.selectionState[DEPLOYMENT_STATES.pending].total = state.selectionState[DEPLOYMENT_STATES.pending].total + 1;
1157
1214
  },
1158
1215
  removedDeployment: (state, action) => {
1159
- var _a;
1160
- const _b2 = state.byId, { [_a = action.payload]: removedDeployment } = _b2, remainder = __objRest(_b2, [__restKey(_a)]);
1216
+ const { [action.payload]: removedDeployment, ...remainder } = state.byId;
1161
1217
  state.byId = remainder;
1162
1218
  },
1163
1219
  receivedDeployment: (state, action) => {
1164
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id] || {}), action.payload);
1220
+ state.byId[action.payload.id] = {
1221
+ ...state.byId[action.payload.id] || {},
1222
+ ...action.payload
1223
+ };
1165
1224
  },
1166
1225
  receivedDeploymentDeviceLog: (state, action) => {
1167
1226
  const { id, deviceId, log } = action.payload;
1168
- const deployment = __spreadValues(__spreadValues({}, deploymentPrototype), state.byId[id]);
1169
- state.byId[id] = __spreadProps(__spreadValues({}, deployment), {
1170
- devices: __spreadProps(__spreadValues({}, deployment.devices), {
1171
- [deviceId]: __spreadProps(__spreadValues({}, deployment.devices[deviceId]), {
1227
+ const deployment = {
1228
+ ...deploymentPrototype,
1229
+ ...state.byId[id]
1230
+ };
1231
+ state.byId[id] = {
1232
+ ...deployment,
1233
+ devices: {
1234
+ ...deployment.devices,
1235
+ [deviceId]: {
1236
+ ...deployment.devices[deviceId],
1172
1237
  log
1173
- })
1174
- })
1175
- });
1238
+ }
1239
+ }
1240
+ };
1176
1241
  },
1177
1242
  receivedDeploymentDevices: (state, action) => {
1178
1243
  const { id, devices, selectedDeviceIds, totalDeviceCount } = action.payload;
1179
- state.byId[id] = __spreadProps(__spreadValues({}, state.byId[id]), {
1244
+ state.byId[id] = {
1245
+ ...state.byId[id],
1180
1246
  devices,
1181
1247
  totalDeviceCount
1182
- });
1248
+ };
1183
1249
  state.selectedDeviceIds = selectedDeviceIds;
1184
1250
  },
1185
1251
  receivedDeployments: (state, action) => {
1186
- state.byId = __spreadValues(__spreadValues({}, state.byId), action.payload);
1252
+ state.byId = {
1253
+ ...state.byId,
1254
+ ...action.payload
1255
+ };
1187
1256
  },
1188
1257
  receivedDeploymentsForStatus: (state, action) => {
1189
1258
  const { status, deploymentIds, total } = action.payload;
@@ -1225,9 +1294,9 @@ var initialState3 = {
1225
1294
  [DEVICE_STATES.preauth]: { deviceIds: [], total: 0 },
1226
1295
  [DEVICE_STATES.rejected]: { deviceIds: [], total: 0 }
1227
1296
  },
1228
- deviceList: __spreadProps(__spreadValues({
1229
- deviceIds: []
1230
- }, DEVICE_LIST_DEFAULTS), {
1297
+ deviceList: {
1298
+ deviceIds: [],
1299
+ ...DEVICE_LIST_DEFAULTS,
1231
1300
  selectedAttributes: [],
1232
1301
  selectedIssues: [],
1233
1302
  selection: [],
@@ -1238,7 +1307,7 @@ var initialState3 = {
1238
1307
  },
1239
1308
  state: DEVICE_STATES.accepted,
1240
1309
  total: 0
1241
- }),
1310
+ },
1242
1311
  filters: [
1243
1312
  // { key: 'device_type', value: 'raspberry', operator: '$eq', scope: 'inventory' }
1244
1313
  ],
@@ -1273,49 +1342,59 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1273
1342
  },
1274
1343
  addToGroup: (state, action) => {
1275
1344
  const { group, deviceIds } = action.payload;
1276
- const maybeExistingGroup = __spreadValues({
1345
+ const maybeExistingGroup = {
1277
1346
  filters: [],
1278
- deviceIds: []
1279
- }, state.groups.byId[group]);
1280
- state.groups.byId[group] = __spreadProps(__spreadValues({}, maybeExistingGroup), {
1347
+ deviceIds: [],
1348
+ ...state.groups.byId[group]
1349
+ };
1350
+ state.groups.byId[group] = {
1351
+ ...maybeExistingGroup,
1281
1352
  deviceIds: [...maybeExistingGroup.deviceIds, ...deviceIds].filter(import_helpers.duplicateFilter),
1282
1353
  total: (maybeExistingGroup.total || 0) + 1
1283
- });
1354
+ };
1284
1355
  },
1285
1356
  removeFromGroup: (state, action) => {
1286
1357
  const { group, deviceIds: removedIds } = action.payload;
1287
- const _a = state.groups.byId[group] || {}, { deviceIds = [], total = 0 } = _a, maybeExistingGroup = __objRest(_a, ["deviceIds", "total"]);
1288
- const changedGroup = __spreadProps(__spreadValues({}, maybeExistingGroup), {
1358
+ const { deviceIds = [], total = 0, ...maybeExistingGroup } = state.groups.byId[group] || {};
1359
+ const changedGroup = {
1360
+ ...maybeExistingGroup,
1289
1361
  deviceIds: deviceIds.filter((id) => !removedIds.includes(id)),
1290
1362
  total: Math.max(total - removedIds.length, 0)
1291
- });
1363
+ };
1292
1364
  if (changedGroup.total || changedGroup.deviceIds.length) {
1293
1365
  state.groups.byId[group] = changedGroup;
1294
1366
  return;
1295
1367
  } else if (state.groups.selectedGroup === group) {
1296
1368
  state.groups.selectedGroup = void 0;
1297
1369
  }
1298
- const _b2 = state.groups.byId, { [group]: removal } = _b2, remainingById = __objRest(_b2, [__restKey(group)]);
1370
+ const { [group]: removal, ...remainingById } = state.groups.byId;
1299
1371
  state.groups.byId = remainingById;
1300
1372
  },
1301
1373
  addGroup: (state, action) => {
1302
1374
  const { groupName, group } = action.payload;
1303
- state.groups.byId[groupName] = __spreadValues(__spreadValues({}, state.groups.byId[groupName]), group);
1375
+ state.groups.byId[groupName] = {
1376
+ ...state.groups.byId[groupName],
1377
+ ...group
1378
+ };
1304
1379
  },
1305
1380
  selectGroup: (state, { payload: group }) => {
1306
1381
  state.deviceList.deviceIds = state.groups.byId[group] && state.groups.byId[group].deviceIds.length > 0 ? state.groups.byId[group].deviceIds : [];
1307
1382
  state.groups.selectedGroup = group;
1308
1383
  },
1309
1384
  removeGroup: (state, action) => {
1310
- var _a;
1311
- const _b2 = state.groups.byId, { [_a = action.payload]: removal } = _b2, remainingById = __objRest(_b2, [__restKey(_a)]);
1385
+ const { [action.payload]: removal, ...remainingById } = state.groups.byId;
1312
1386
  state.groups.byId = remainingById;
1313
1387
  state.groups.selectedGroup = state.groups.selectedGroup === action.payload ? void 0 : state.groups.selectedGroup;
1314
1388
  },
1315
1389
  setDeviceListState: (state, action) => {
1316
- state.deviceList = __spreadProps(__spreadValues(__spreadValues({}, state.deviceList), action.payload), {
1317
- sort: __spreadValues(__spreadValues({}, state.deviceList.sort), action.payload.sort)
1318
- });
1390
+ state.deviceList = {
1391
+ ...state.deviceList,
1392
+ ...action.payload,
1393
+ sort: {
1394
+ ...state.deviceList.sort,
1395
+ ...action.payload.sort
1396
+ }
1397
+ };
1319
1398
  },
1320
1399
  setFilterAttributes: (state, action) => {
1321
1400
  state.filteringAttributes = action.payload;
@@ -1324,7 +1403,10 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1324
1403
  state.filteringAttributesConfig = action.payload;
1325
1404
  },
1326
1405
  receivedDevices: (state, action) => {
1327
- state.byId = __spreadValues(__spreadValues({}, state.byId), action.payload);
1406
+ state.byId = {
1407
+ ...state.byId,
1408
+ ...action.payload
1409
+ };
1328
1410
  },
1329
1411
  setDeviceFilters: (state, action) => {
1330
1412
  if ((0, import_helpers.deepCompare)(action.payload, state.filters)) {
@@ -1355,7 +1437,10 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1355
1437
  state.limit = action.payload;
1356
1438
  },
1357
1439
  receivedDevice: (state, action) => {
1358
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id]), action.payload);
1440
+ state.byId[action.payload.id] = {
1441
+ ...state.byId[action.payload.id],
1442
+ ...action.payload
1443
+ };
1359
1444
  },
1360
1445
  maybeUpdateDevicesByStatus: (state, action) => {
1361
1446
  const { deviceId, authId } = action.payload;
@@ -1376,15 +1461,17 @@ var import_toolkit4 = require("@reduxjs/toolkit");
1376
1461
  var sliceName4 = "monitor";
1377
1462
  var initialState4 = {
1378
1463
  alerts: {
1379
- alertList: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { total: 0 }),
1464
+ alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },
1380
1465
  byDeviceId: {}
1381
1466
  },
1382
1467
  issueCounts: {
1383
- byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => __spreadProps(__spreadValues({}, accu), { [key]: { filtered: 0, total: 0 } }), {})
1468
+ byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {})
1384
1469
  },
1385
1470
  settings: {
1386
1471
  global: {
1387
- channels: __spreadValues({}, Object.keys(alertChannels).reduce((accu, item) => __spreadProps(__spreadValues({}, accu), { [item]: { enabled: true } }), {}))
1472
+ channels: {
1473
+ ...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {})
1474
+ }
1388
1475
  }
1389
1476
  }
1390
1477
  };
@@ -1402,14 +1489,14 @@ var monitorSlice = (0, import_toolkit4.createSlice)({
1402
1489
  },
1403
1490
  receiveLatestDeviceAlerts: (state, action) => {
1404
1491
  const { deviceId, alerts } = action.payload;
1405
- state.alerts.byDeviceId[deviceId] = __spreadProps(__spreadValues({}, state.alerts.byDeviceId[deviceId]), { latest: alerts });
1492
+ state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };
1406
1493
  },
1407
1494
  receiveDeviceIssueCounts: (state, action) => {
1408
1495
  const { issueType, counts } = action.payload;
1409
1496
  state.issueCounts.byType[issueType] = counts;
1410
1497
  },
1411
1498
  setAlertListState: (state, action) => {
1412
- state.alerts.alertList = __spreadValues(__spreadValues({}, state.alerts.alertList), action.payload);
1499
+ state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };
1413
1500
  }
1414
1501
  }
1415
1502
  });
@@ -1433,7 +1520,7 @@ var onboardingSlice = (0, import_toolkit5.createSlice)({
1433
1520
  initialState: initialState5,
1434
1521
  reducers: {
1435
1522
  setOnboardingState: (state, action) => {
1436
- return __spreadValues(__spreadValues({}, state), action.payload);
1523
+ return { ...state, ...action.payload };
1437
1524
  },
1438
1525
  setDemoArtifactPort: (state, action) => {
1439
1526
  state.demoArtifactPort = action.payload;
@@ -1471,21 +1558,23 @@ var initialState6 = {
1471
1558
  brand: ""
1472
1559
  },
1473
1560
  intentId: null,
1561
+ tenantList: {
1562
+ ...TENANT_LIST_DEFAULT,
1563
+ total: 0,
1564
+ tenants: [],
1565
+ selectedTenant: null,
1566
+ sort: {
1567
+ direction: SORTING_OPTIONS.desc,
1568
+ key: "name"
1569
+ }
1570
+ },
1474
1571
  organization: {
1475
- tenantList: __spreadProps(__spreadValues({}, TENANT_LIST_DEFAULT), {
1476
- total: 0,
1477
- tenants: [],
1478
- selectedTenant: null,
1479
- sort: {
1480
- direction: SORTING_OPTIONS.desc,
1481
- key: "name"
1482
- }
1483
- })
1484
1572
  // id, name, status, tenant_token, plan
1485
1573
  },
1486
1574
  auditlog: {
1487
1575
  events: [],
1488
- selectionState: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), {
1576
+ selectionState: {
1577
+ ...DEVICE_LIST_DEFAULTS,
1489
1578
  detail: void 0,
1490
1579
  endDate: void 0,
1491
1580
  selectedIssue: void 0,
@@ -1494,7 +1583,7 @@ var initialState6 = {
1494
1583
  total: 0,
1495
1584
  type: void 0,
1496
1585
  user: void 0
1497
- })
1586
+ }
1498
1587
  },
1499
1588
  externalDeviceIntegrations: [
1500
1589
  // { <connection_string|x509|...>, id, provider }
@@ -1517,7 +1606,10 @@ var organizationSlice = (0, import_toolkit6.createSlice)({
1517
1606
  state.auditlog.selectionState.total = total;
1518
1607
  },
1519
1608
  setAuditLogState: (state, action) => {
1520
- state.auditlog.selectionState = __spreadValues(__spreadValues({}, state.auditlog.selectionState), action.payload);
1609
+ state.auditlog.selectionState = {
1610
+ ...state.auditlog.selectionState,
1611
+ ...action.payload
1612
+ };
1521
1613
  },
1522
1614
  receiveCurrentCard: (state, action) => {
1523
1615
  state.card = action.payload;
@@ -1526,12 +1618,10 @@ var organizationSlice = (0, import_toolkit6.createSlice)({
1526
1618
  state.intentId = action.payload;
1527
1619
  },
1528
1620
  setOrganization: (state, action) => {
1529
- state.organization = __spreadProps(__spreadValues(__spreadValues({}, state.organization), action.payload), {
1530
- tenantList: __spreadValues(__spreadValues({}, state.organization.tenantList), action.payload.tenantList)
1531
- });
1621
+ state.organization = { ...state.organization, ...action.payload };
1532
1622
  },
1533
1623
  setTenantListState: (state, action) => {
1534
- state.organization.tenantList = action.payload;
1624
+ state.tenantList = action.payload;
1535
1625
  },
1536
1626
  receiveExternalDeviceIntegrations: (state, action) => {
1537
1627
  state.externalDeviceIntegrations = action.payload;
@@ -1591,7 +1681,8 @@ var initialState7 = {
1591
1681
  }
1592
1682
  */
1593
1683
  },
1594
- releasesList: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), {
1684
+ releasesList: {
1685
+ ...DEVICE_LIST_DEFAULTS,
1595
1686
  searchedIds: [],
1596
1687
  releaseIds: [],
1597
1688
  selection: [],
@@ -1605,7 +1696,7 @@ var initialState7 = {
1605
1696
  selectedTags: [],
1606
1697
  total: 0,
1607
1698
  type: ""
1608
- }),
1699
+ },
1609
1700
  tags: [],
1610
1701
  updateTypes: [],
1611
1702
  /*
@@ -1631,8 +1722,7 @@ var releaseSlice = (0, import_toolkit7.createSlice)({
1631
1722
  state.updateTypes = action.payload;
1632
1723
  },
1633
1724
  removeRelease: (state, action) => {
1634
- var _a;
1635
- const _b2 = state.byId, { [_a = action.payload]: toBeRemoved } = _b2, byId = __objRest(_b2, [__restKey(_a)]);
1725
+ const { [action.payload]: toBeRemoved, ...byId } = state.byId;
1636
1726
  state.byId = byId;
1637
1727
  state.selectedRelease = action.payload === state.selectedRelease ? null : state.selectedRelease;
1638
1728
  },
@@ -1665,8 +1755,12 @@ var initialState8 = {
1665
1755
  previousPhases: [],
1666
1756
  retries: 0
1667
1757
  },
1668
- permissionSetsById: __spreadValues({}, defaultPermissionSets),
1669
- rolesById: __spreadValues({}, rolesById),
1758
+ permissionSetsById: {
1759
+ ...defaultPermissionSets
1760
+ },
1761
+ rolesById: {
1762
+ ...rolesById
1763
+ },
1670
1764
  settingsInitialized: false,
1671
1765
  showConnectDeviceDialog: false,
1672
1766
  showFeedbackDialog: false,
@@ -1706,13 +1800,15 @@ var usersSlice = (0, import_toolkit8.createSlice)({
1706
1800
  state.byId[0] = action.payload;
1707
1801
  },
1708
1802
  removedUser: (state, action) => {
1709
- var _a;
1710
- const _b2 = state.byId, { [_a = action.payload]: removedUser } = _b2, byId = __objRest(_b2, [__restKey(_a)]);
1803
+ const { [action.payload]: removedUser, ...byId } = state.byId;
1711
1804
  state.byId = byId;
1712
1805
  state.currentUser = state.currentUser === action.payload ? null : state.currentUser;
1713
1806
  },
1714
1807
  updatedUser: (state, action) => {
1715
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id]), action.payload);
1808
+ state.byId[action.payload.id] = {
1809
+ ...state.byId[action.payload.id],
1810
+ ...action.payload
1811
+ };
1716
1812
  },
1717
1813
  receivedPermissionSets: (state, action) => {
1718
1814
  state.permissionSetsById = action.payload;
@@ -1721,11 +1817,13 @@ var usersSlice = (0, import_toolkit8.createSlice)({
1721
1817
  state.rolesById = action.payload;
1722
1818
  },
1723
1819
  createdRole: (state, action) => {
1724
- state.rolesById[action.payload.name] = __spreadValues(__spreadValues({}, state.rolesById[action.payload.name]), action.payload);
1820
+ state.rolesById[action.payload.name] = {
1821
+ ...state.rolesById[action.payload.name],
1822
+ ...action.payload
1823
+ };
1725
1824
  },
1726
1825
  removedRole: (state, action) => {
1727
- var _a;
1728
- const _b2 = state.rolesById, { [_a = action.payload]: toBeRemoved } = _b2, rolesById2 = __objRest(_b2, [__restKey(_a)]);
1826
+ const { [action.payload]: toBeRemoved, ...rolesById2 } = state.rolesById;
1729
1827
  state.rolesById = rolesById2;
1730
1828
  },
1731
1829
  setCustomColumns: (state, action) => {
@@ -1733,18 +1831,27 @@ var usersSlice = (0, import_toolkit8.createSlice)({
1733
1831
  },
1734
1832
  setGlobalSettings: (state, action) => {
1735
1833
  state.settingsInitialized = true;
1736
- state.globalSettings = __spreadValues(__spreadValues({}, state.globalSettings), action.payload);
1834
+ state.globalSettings = {
1835
+ ...state.globalSettings,
1836
+ ...action.payload
1837
+ };
1737
1838
  },
1738
1839
  setUserSettings: (state, action) => {
1739
1840
  state.userSettingsInitialized = true;
1740
- state.userSettings = __spreadValues(__spreadValues({}, state.userSettings), action.payload);
1841
+ state.userSettings = {
1842
+ ...state.userSettings,
1843
+ ...action.payload
1844
+ };
1741
1845
  },
1742
1846
  setTooltipState: (state, action) => {
1743
1847
  const { id, readState = READ_STATES.read } = action.payload;
1744
1848
  state.tooltips.byId[id].readState = readState;
1745
1849
  },
1746
1850
  setTooltipsState: (state, action) => {
1747
- state.tooltips.byId = __spreadValues(__spreadValues({}, state.tooltips.byId), action.payload);
1851
+ state.tooltips.byId = {
1852
+ ...state.tooltips.byId,
1853
+ ...action.payload
1854
+ };
1748
1855
  },
1749
1856
  setShowFeedbackDialog: (state, action) => {
1750
1857
  state.showFeedbackDialog = action.payload;
@@ -1761,7 +1868,16 @@ var actions8 = usersSlice.actions;
1761
1868
  var usersSlice_default = usersSlice.reducer;
1762
1869
 
1763
1870
  // src/actions.ts
1764
- var actions_default = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, actions), actions2), actions3), actions4), actions5), actions6), actions7), actions8);
1871
+ var actions_default = {
1872
+ ...actions,
1873
+ ...actions2,
1874
+ ...actions3,
1875
+ ...actions4,
1876
+ ...actions5,
1877
+ ...actions6,
1878
+ ...actions7,
1879
+ ...actions8
1880
+ };
1765
1881
 
1766
1882
  // src/api/general-api.ts
1767
1883
  var import_axios = __toESM(require("axios"));
@@ -1772,18 +1888,17 @@ var cookies = new import_universal_cookie.default();
1772
1888
  var emptySession = Object.freeze({ token: "", exiresAt: void 0 });
1773
1889
  var tokenCache = "";
1774
1890
  var getSessionInfo = () => {
1775
- var _a, _b2;
1776
- let sessionInfo = __spreadValues({}, emptySession);
1891
+ let sessionInfo = { ...emptySession };
1777
1892
  try {
1778
- sessionInfo = JSON.parse((_a = window.localStorage.getItem("JWT")) != null ? _a : "");
1779
- } catch (e) {
1893
+ sessionInfo = JSON.parse(window.localStorage.getItem("JWT") ?? "");
1894
+ } catch {
1780
1895
  }
1781
1896
  if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < /* @__PURE__ */ new Date()) {
1782
1897
  cleanUp();
1783
- return __spreadValues({}, emptySession);
1898
+ return { ...emptySession };
1784
1899
  }
1785
1900
  if (!sessionInfo.token) {
1786
- let jwtTokenFromCookie = (_b2 = cookies.get("JWT", { doNotParse: true })) != null ? _b2 : "";
1901
+ let jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
1787
1902
  if (jwtTokenFromCookie) {
1788
1903
  setSessionInfo({ token: jwtTokenFromCookie, undefined: void 0 });
1789
1904
  sessionInfo.token = jwtTokenFromCookie;
@@ -1810,8 +1925,7 @@ var cleanUp = () => {
1810
1925
 
1811
1926
  // src/api/general-api.ts
1812
1927
  var unauthorizedRedirect = (error) => {
1813
- var _a;
1814
- if (!(0, import_axios.isCancel)(error) && ((_a = error.response) == null ? void 0 : _a.status) === 401 && getToken()) {
1928
+ if (!(0, import_axios.isCancel)(error) && error.response?.status === 401 && getToken()) {
1815
1929
  cleanUp();
1816
1930
  window.location.replace("/ui/");
1817
1931
  }
@@ -1821,7 +1935,7 @@ var commonRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { "Conten
1821
1935
  var authenticatedRequest = import_axios.default.create(commonRequestConfig);
1822
1936
  authenticatedRequest.interceptors.response.use((res) => res, unauthorizedRedirect);
1823
1937
  authenticatedRequest.interceptors.request.use(
1824
- (config) => __spreadProps(__spreadValues({}, config), { headers: __spreadProps(__spreadValues({}, config.headers), { Authorization: `Bearer ${getToken()}` }) }),
1938
+ (config) => ({ ...config, headers: { ...config.headers, Authorization: `Bearer ${getToken()}` } }),
1825
1939
  (error) => Promise.reject(error)
1826
1940
  );
1827
1941
  var Api = {
@@ -1829,7 +1943,7 @@ var Api = {
1829
1943
  delete: (url, data) => authenticatedRequest.request({ method: "delete", url, data }),
1830
1944
  patch: authenticatedRequest.patch,
1831
1945
  post: authenticatedRequest.post,
1832
- postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, __spreadValues(__spreadValues({}, commonRequestConfig), config)),
1946
+ postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, { ...commonRequestConfig, ...config }),
1833
1947
  put: authenticatedRequest.put,
1834
1948
  upload: (url, formData, progress, cancelSignal) => authenticatedRequest.post(url, formData, {
1835
1949
  headers: { "Content-Type": "multipart/form-data" },
@@ -1860,10 +1974,7 @@ var getSearchState = (state) => state.app.searchState;
1860
1974
  var getSearchedDevices = (0, import_toolkit9.createSelector)([getSearchState], ({ deviceIds }) => deviceIds);
1861
1975
  var getVersionInformation = (0, import_toolkit9.createSelector)(
1862
1976
  [getFullVersionInformation, getFeatures],
1863
- (_a, { isHosted }) => {
1864
- var _b2 = _a, { Integration } = _b2, remainder = __objRest(_b2, ["Integration"]);
1865
- return isHosted && Integration !== "next" ? remainder : __spreadProps(__spreadValues({}, remainder), { Integration });
1866
- }
1977
+ ({ Integration, ...remainder }, { isHosted }) => isHosted && Integration !== "next" ? remainder : { ...remainder, Integration }
1867
1978
  );
1868
1979
  var getIsPreview = (0, import_toolkit9.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers2.versionCompare)(Integration, "next") > -1);
1869
1980
 
@@ -1880,8 +1991,7 @@ var getDeploymentsSelectionState = (state) => state.deployments.selectionState;
1880
1991
  var getMappedDeploymentSelection = (0, import_toolkit10.createSelector)(
1881
1992
  [getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],
1882
1993
  (selectionState, deploymentsState, deploymentsById) => {
1883
- var _a;
1884
- const { selection = [] } = (_a = selectionState[deploymentsState]) != null ? _a : {};
1994
+ const { selection = [] } = selectionState[deploymentsState] ?? {};
1885
1995
  return selection.reduce((accu, id) => {
1886
1996
  if (deploymentsById[id]) {
1887
1997
  accu.push(deploymentsById[id]);
@@ -1924,7 +2034,8 @@ var getListedDevices = (state) => state.devices.deviceList.deviceIds;
1924
2034
  var getFilteringAttributes = (state) => state.devices.filteringAttributes;
1925
2035
  var getDeviceFilters = (state) => state.devices.filters || [];
1926
2036
  var getFilteringAttributesFromConfig = (state) => state.devices.filteringAttributesConfig.attributes;
1927
- var getSortedFilteringAttributes = (0, import_toolkit11.createSelector)([getFilteringAttributes], (filteringAttributes) => __spreadProps(__spreadValues({}, filteringAttributes), {
2037
+ var getSortedFilteringAttributes = (0, import_toolkit11.createSelector)([getFilteringAttributes], (filteringAttributes) => ({
2038
+ ...filteringAttributes,
1928
2039
  identityAttributes: [...filteringAttributes.identityAttributes, "id"]
1929
2040
  }));
1930
2041
  var getDeviceLimit = (state) => state.devices.limit;
@@ -1952,10 +2063,7 @@ var getDeviceCountsByStatus = (0, import_toolkit11.createSelector)(
1952
2063
  return accu;
1953
2064
  }, {})
1954
2065
  );
1955
- var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => {
1956
- var _a;
1957
- return (_a = devicesById[deviceId]) != null ? _a : {};
1958
- });
2066
+ var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
1959
2067
  var getSelectedGroupInfo = (0, import_toolkit11.createSelector)(
1960
2068
  [getAcceptedDevices, getGroupsById, getSelectedGroup],
1961
2069
  ({ total: acceptedDeviceTotal }, groupsById, selectedGroup) => {
@@ -1972,17 +2080,13 @@ var getLimitMaxed = (0, import_toolkit11.createSelector)(
1972
2080
  [getAcceptedDevices, getDeviceLimit],
1973
2081
  ({ total: acceptedDevices = 0 }, deviceLimit) => Boolean(deviceLimit && deviceLimit <= acceptedDevices)
1974
2082
  );
1975
- var _b;
1976
- var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], (_a) => {
1977
- var _c = _a, { [_b = UNGROUPED_GROUP.id]: ungrouped } = _c, groups = __objRest(_c, [__restKey(_b)]);
1978
- return groups;
1979
- });
2083
+ var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
1980
2084
  var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsById) => {
1981
2085
  const groupNames = Object.keys(groupsById).sort();
1982
2086
  const groupedGroups = Object.entries(groupsById).sort((a, b) => a[0].localeCompare(b[0])).reduce(
1983
2087
  (accu, [groupname, group]) => {
1984
2088
  const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;
1985
- const groupItem = __spreadProps(__spreadValues({}, group), { groupId: name, name: groupname });
2089
+ const groupItem = { ...group, groupId: name, name: groupname };
1986
2090
  if (group.filters.length > 0) {
1987
2091
  if (groupname !== UNGROUPED_GROUP.id) {
1988
2092
  accu.dynamic.push(groupItem);
@@ -1996,7 +2100,7 @@ var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsByI
1996
2100
  },
1997
2101
  { dynamic: [], static: [], ungrouped: [] }
1998
2102
  );
1999
- return __spreadValues({ groupNames }, groupedGroups);
2103
+ return { groupNames, ...groupedGroups };
2000
2104
  });
2001
2105
  var getAttributesList = (0, import_toolkit11.createSelector)(
2002
2106
  [getFilteringAttributes, getFilteringAttributesFromConfig],
@@ -2034,10 +2138,7 @@ var getWebhookEvents = (state) => state.organization.webhooks.events;
2034
2138
  var getWebhookEventTotal = (state) => state.organization.webhooks.eventTotal;
2035
2139
  var getDeviceTwinIntegrations = (0, import_toolkit12.createSelector)(
2036
2140
  [getExternalIntegrations],
2037
- (integrations) => integrations.filter((integration) => {
2038
- var _a;
2039
- return integration.id && ((_a = EXTERNAL_PROVIDER[integration.provider]) == null ? void 0 : _a.deviceTwin);
2040
- })
2141
+ (integrations) => integrations.filter((integration) => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)
2041
2142
  );
2042
2143
  var getIsServiceProvider = (state) => state.organization.organization.service_provider;
2043
2144
  var getWebhooks = (0, import_toolkit12.createSelector)(
@@ -2071,25 +2172,21 @@ var filterProcessors = {
2071
2172
  var filterAliases = {
2072
2173
  $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
2073
2174
  };
2074
- var mapFiltersToTerms = (filters) => filters.map((filter) => {
2075
- var _a;
2076
- return {
2077
- scope: filter.scope,
2078
- attribute: filter.key,
2079
- type: ((_a = filterAliases[filter.operator]) == null ? void 0 : _a.alias) || filter.operator,
2080
- value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
2081
- };
2082
- });
2175
+ var mapFiltersToTerms = (filters) => filters.map((filter) => ({
2176
+ scope: filter.scope,
2177
+ attribute: filter.key,
2178
+ type: filterAliases[filter.operator]?.alias || filter.operator,
2179
+ value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
2180
+ }));
2083
2181
  var convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) => issuesSelection.map((item) => {
2084
2182
  if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === "function") {
2085
- return __spreadProps(__spreadValues({}, DEVICE_ISSUE_OPTIONS[item].filterRule), { value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) });
2183
+ return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };
2086
2184
  }
2087
2185
  return DEVICE_ISSUE_OPTIONS[item].filterRule;
2088
2186
  });
2089
2187
  var convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {} }, offlineThreshold, selectedIssues = [], status }) => {
2090
- var _a;
2091
2188
  let applicableFilters = [...filters];
2092
- if (typeof group === "string" && !(((_a = groups.byId[group]) == null ? void 0 : _a.filters) || applicableFilters).length) {
2189
+ if (typeof group === "string" && !(groups.byId[group]?.filters || applicableFilters).length) {
2093
2190
  applicableFilters.push({ key: "group", value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "system" });
2094
2191
  }
2095
2192
  const nonMonitorFilters = applicableFilters.filter(
@@ -2105,12 +2202,12 @@ var convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {
2105
2202
  var listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => {
2106
2203
  return ids.slice(0, cutOffSize).reduce((accu, id) => {
2107
2204
  if (id && byId[id]) {
2108
- accu.push(__spreadValues(__spreadValues({}, defaultObject), byId[id]));
2205
+ accu.push({ ...defaultObject, ...byId[id] });
2109
2206
  }
2110
2207
  return accu;
2111
2208
  }, []);
2112
2209
  };
2113
- var mergePermissions = (existingPermissions = __spreadValues({}, emptyUiPermissions), addedPermissions) => Object.entries(existingPermissions).reduce(
2210
+ var mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) => Object.entries(existingPermissions).reduce(
2114
2211
  (accu, [key, value]) => {
2115
2212
  let values;
2116
2213
  if (!accu[key]) {
@@ -2120,12 +2217,12 @@ var mergePermissions = (existingPermissions = __spreadValues({}, emptyUiPermissi
2120
2217
  if (Array.isArray(value)) {
2121
2218
  values = [...value, ...accu[key]].filter(import_helpers4.duplicateFilter);
2122
2219
  } else {
2123
- values = mergePermissions(accu[key], __spreadValues({}, value));
2220
+ values = mergePermissions(accu[key], { ...value });
2124
2221
  }
2125
2222
  accu[key] = values;
2126
2223
  return accu;
2127
2224
  },
2128
- __spreadValues({}, addedPermissions)
2225
+ { ...addedPermissions }
2129
2226
  );
2130
2227
  var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
2131
2228
  (accu, roleId) => {
@@ -2134,16 +2231,13 @@ var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
2134
2231
  }
2135
2232
  return mergePermissions(accu, roles[roleId].uiPermissions);
2136
2233
  },
2137
- __spreadValues({}, emptyUiPermissions)
2234
+ { ...emptyUiPermissions }
2138
2235
  );
2139
- var extractErrorMessage = (err, fallback = "") => {
2140
- var _a, _b2, _c, _d, _e;
2141
- return ((_c = (_b2 = (_a = err.response) == null ? void 0 : _a.data) == null ? void 0 : _b2.error) == null ? void 0 : _c.message) || ((_e = (_d = err.response) == null ? void 0 : _d.data) == null ? void 0 : _e.error) || err.error || err.message || fallback;
2142
- };
2236
+ var extractErrorMessage = (err, fallback = "") => err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;
2143
2237
  var preformatWithRequestID = (res, failMsg) => {
2144
2238
  if (failMsg.length > 100) failMsg = `${failMsg.substring(0, 220)}...`;
2145
2239
  try {
2146
- if ((res == null ? void 0 : res.data) && Object.keys(res.data).includes("request_id")) {
2240
+ if (res?.data && Object.keys(res.data).includes("request_id")) {
2147
2241
  let shortRequestUUID = res.data["request_id"].substring(0, 8);
2148
2242
  return `${failMsg} [Request ID: ${shortRequestUUID}]`;
2149
2243
  }
@@ -2163,15 +2257,12 @@ var getReleaseListState = (state) => state.releases.releasesList;
2163
2257
  var getListedReleases = (state) => state.releases.releasesList.releaseIds;
2164
2258
  var getReleaseMappingDefaults = () => ({});
2165
2259
  var getReleasesList = (0, import_toolkit13.createSelector)([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);
2166
- var getReleaseTagsById = (0, import_toolkit13.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => __spreadProps(__spreadValues({}, accu), { [key]: key }), {}));
2260
+ var getReleaseTagsById = (0, import_toolkit13.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));
2167
2261
  var getHasReleases = (0, import_toolkit13.createSelector)(
2168
2262
  [getReleaseListState, getReleasesById],
2169
2263
  ({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)
2170
2264
  );
2171
- var getSelectedRelease = (0, import_toolkit13.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => {
2172
- var _a;
2173
- return (_a = byId[id]) != null ? _a : {};
2174
- });
2265
+ var getSelectedRelease = (0, import_toolkit13.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id] ?? {});
2175
2266
 
2176
2267
  // src/usersSlice/selectors.ts
2177
2268
  var import_toolkit14 = require("@reduxjs/toolkit");
@@ -2180,10 +2271,7 @@ var getTooltipsById = (state) => state.users.tooltips.byId;
2180
2271
  var getGlobalSettings = (state) => state.users.globalSettings;
2181
2272
  var getCurrentUserId = (state) => state.users.currentUser;
2182
2273
  var getUsersById = (state) => state.users.byId;
2183
- var getCurrentUser = (0, import_toolkit14.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => {
2184
- var _a;
2185
- return (_a = usersById[userId]) != null ? _a : {};
2186
- });
2274
+ var getCurrentUser = (0, import_toolkit14.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => usersById[userId] ?? {});
2187
2275
  var getUserSettings = (state) => state.users.userSettings;
2188
2276
  var getIsDarkMode = (0, import_toolkit14.createSelector)([getUserSettings], ({ mode }) => isDarkMode(mode));
2189
2277
  var getShowHelptips = (0, import_toolkit14.createSelector)(
@@ -2194,22 +2282,22 @@ var getTooltipsState = (0, import_toolkit14.createSelector)(
2194
2282
  [getTooltipsById, getUserSettings],
2195
2283
  (byId, { tooltips = {} }) => Object.entries(byId).reduce(
2196
2284
  (accu, [id, value]) => {
2197
- accu[id] = __spreadValues(__spreadValues({}, accu[id]), value);
2285
+ accu[id] = { ...accu[id], ...value };
2198
2286
  return accu;
2199
2287
  },
2200
- __spreadValues({}, tooltips)
2288
+ { ...tooltips }
2201
2289
  )
2202
2290
  );
2203
2291
  var getHas2FA = (0, import_toolkit14.createSelector)(
2204
2292
  [getCurrentUser],
2205
2293
  (currentUser) => currentUser.hasOwnProperty("tfa_status") && currentUser.tfa_status === twoFAStates.enabled
2206
2294
  );
2207
- var getIdAttribute = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ id_attribute = __spreadValues({}, defaultIdAttribute) }) => id_attribute);
2295
+ var getIdAttribute = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);
2208
2296
  var getOfflineThresholdSettings = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ offlineThreshold }) => ({
2209
- interval: (offlineThreshold == null ? void 0 : offlineThreshold.interval) || DEVICE_ONLINE_CUTOFF.interval,
2210
- intervalUnit: (offlineThreshold == null ? void 0 : offlineThreshold.intervalUnit) || DEVICE_ONLINE_CUTOFF.intervalName
2297
+ interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,
2298
+ intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
2211
2299
  }));
2212
- var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([id, role]) => __spreadValues({ id }, role)));
2300
+ var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([id, role]) => ({ id, ...role })));
2213
2301
 
2214
2302
  // src/commonSelectors.ts
2215
2303
  var getIsEnterprise = (0, import_toolkit15.createSelector)(
@@ -2227,8 +2315,7 @@ var getSearchEndpoint = (0, import_toolkit15.createSelector)(
2227
2315
  var getUserRoles = (0, import_toolkit15.createSelector)(
2228
2316
  [getCurrentUser, getRolesById, getIsEnterprise, getFeatures, getOrganization],
2229
2317
  (currentUser, rolesById2, isEnterprise, { isHosted, hasMultitenancy }, { plan = PLANS.os.id }) => {
2230
- var _a;
2231
- const isAdmin = ((_a = currentUser.roles) == null ? void 0 : _a.length) ? currentUser.roles.some((role) => role === rolesByName.admin) : !(hasMultitenancy || isEnterprise || isHosted && plan !== PLANS.os.id);
2318
+ const isAdmin = currentUser.roles?.length ? currentUser.roles.some((role) => role === rolesByName.admin) : !(hasMultitenancy || isEnterprise || isHosted && plan !== PLANS.os.id);
2232
2319
  const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById2) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById2);
2233
2320
  return { isAdmin, uiPermissions };
2234
2321
  }
@@ -2297,10 +2384,11 @@ var getFilterAttributes = (0, import_toolkit15.createSelector)(
2297
2384
  const deviceNameAttribute = { key: "name", value: "Name", scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };
2298
2385
  const deviceIdAttribute = { key: "id", value: "Device ID", scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };
2299
2386
  const checkInAttribute = { key: "check_in_time", value: "Latest activity", scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };
2300
- const updateAttribute = __spreadProps(__spreadValues({}, checkInAttribute), { key: "updated_ts", value: "Last inventory update" });
2387
+ const updateAttribute = { ...checkInAttribute, key: "updated_ts", value: "Last inventory update" };
2301
2388
  const firstRequestAttribute = { key: "created_ts", value: "First request", scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };
2302
2389
  const attributes = [
2303
- ...previousFilters.map((item) => __spreadProps(__spreadValues({}, item), {
2390
+ ...previousFilters.map((item) => ({
2391
+ ...item,
2304
2392
  value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,
2305
2393
  category: "recently used",
2306
2394
  priority: 0
@@ -2318,14 +2406,13 @@ var getFilterAttributes = (0, import_toolkit15.createSelector)(
2318
2406
  return (0, import_helpers5.attributeDuplicateFilter)(attributes, "key");
2319
2407
  }
2320
2408
  );
2321
- var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], (_a, { onboarding = {} }) => {
2322
- var _b2 = _a, { complete, progress, showTips } = _b2, remainder = __objRest(_b2, ["complete", "progress", "showTips"]);
2323
- return __spreadProps(__spreadValues(__spreadValues({}, remainder), onboarding), {
2324
- complete: onboarding.complete || complete,
2325
- progress: Object.keys(onboardingSteps).findIndex((step) => step === progress) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress : onboarding.progress,
2326
- showTips: !onboarding.showTips ? onboarding.showTips : showTips
2327
- });
2328
- });
2409
+ var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({
2410
+ ...remainder,
2411
+ ...onboarding,
2412
+ complete: onboarding.complete || complete,
2413
+ progress: Object.keys(onboardingSteps).findIndex((step) => step === progress) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress : onboarding.progress,
2414
+ showTips: !onboarding.showTips ? onboarding.showTips : showTips
2415
+ }));
2329
2416
  var getDemoDeviceAddress = (0, import_toolkit15.createSelector)([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {
2330
2417
  const demoDeviceAddress = `http://${(0, import_helpers5.getDemoDeviceAddress)(Object.values(devicesById), approach)}`;
2331
2418
  return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;
@@ -2346,12 +2433,11 @@ var getDeploymentRelease = (0, import_toolkit15.createSelector)(
2346
2433
  var getSelectedDeploymentData = (0, import_toolkit15.createSelector)(
2347
2434
  [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],
2348
2435
  (deploymentsById, { selectedId }, devicesById, selectedDeviceIds) => {
2349
- var _a;
2350
- const deployment = (_a = deploymentsById[selectedId]) != null ? _a : {};
2436
+ const deployment = deploymentsById[selectedId] ?? {};
2351
2437
  const { devices = {} } = deployment;
2352
2438
  return {
2353
2439
  deployment,
2354
- selectedDevices: selectedDeviceIds.map((deviceId) => __spreadValues(__spreadValues({}, devicesById[deviceId]), devices[deviceId]))
2440
+ selectedDevices: selectedDeviceIds.map((deviceId) => ({ ...devicesById[deviceId], ...devices[deviceId] }))
2355
2441
  };
2356
2442
  }
2357
2443
  );
@@ -2366,8 +2452,7 @@ var getAvailableIssueOptionsByType = (0, import_toolkit15.createSelector)(
2366
2452
  }, {})
2367
2453
  );
2368
2454
  var getGroupNames = (0, import_toolkit15.createSelector)([getGroupsById, getUserRoles, (_, options = {}) => options], (groupsById, { uiPermissions }, { staticOnly }) => {
2369
- var _a;
2370
- const _b2 = groupsById, { [_a = UNGROUPED_GROUP.id]: ungrouped } = _b2, groups = __objRest(_b2, [__restKey(_a)]);
2455
+ const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;
2371
2456
  if (staticOnly) {
2372
2457
  return Object.keys(uiPermissions.groups).sort();
2373
2458
  }
@@ -2401,9 +2486,25 @@ var getAuditlogDevice = (0, import_toolkit15.createSelector)([getAuditLogEntry,
2401
2486
  if (auditlogEvent) {
2402
2487
  const { object = {} } = auditlogEvent;
2403
2488
  const { device = {}, id, type } = object;
2404
- auditlogDevice = type === "device" ? __spreadValues({ id }, device) : auditlogDevice;
2489
+ auditlogDevice = type === "device" ? { id, ...device } : auditlogDevice;
2405
2490
  }
2406
- return __spreadValues(__spreadValues({}, auditlogDevice), devicesById[auditlogDevice.id]);
2491
+ return { ...auditlogDevice, ...devicesById[auditlogDevice.id] };
2492
+ });
2493
+ var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, getRolesList], ({ service_provider }, roles) => {
2494
+ if (service_provider) {
2495
+ return roles.reduce((accu, role) => {
2496
+ if (rolesById[role.id]) {
2497
+ return accu;
2498
+ }
2499
+ accu.push(role);
2500
+ return accu;
2501
+ }, Object.values(serviceProviderRolesById));
2502
+ }
2503
+ return Object.keys(rolesById).reverse().reduce((accu, key) => {
2504
+ const index = accu.findIndex(({ id }) => id === key);
2505
+ accu = [accu[index], ...accu.filter((item, itemIndex) => index !== itemIndex)];
2506
+ return accu;
2507
+ }, roles);
2407
2508
  });
2408
2509
 
2409
2510
  // src/store.ts
@@ -2439,8 +2540,9 @@ var sessionReducer = (state, action) => {
2439
2540
  return rootReducer(state, action);
2440
2541
  };
2441
2542
  var getConfiguredStore = (options = {}) => {
2442
- const _a = options, { preloadedState = {} } = _a, config = __objRest(_a, ["preloadedState"]);
2443
- return (0, import_toolkit16.configureStore)(__spreadProps(__spreadValues({}, config), {
2543
+ const { preloadedState = {}, ...config } = options;
2544
+ return (0, import_toolkit16.configureStore)({
2545
+ ...config,
2444
2546
  preloadedState,
2445
2547
  reducer: sessionReducer,
2446
2548
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
@@ -2453,7 +2555,7 @@ var getConfiguredStore = (options = {}) => {
2453
2555
  ignoredPaths: ["app.uploadsById", "app.snackbar", "organization.externalDeviceIntegrations"]
2454
2556
  }
2455
2557
  })
2456
- }));
2558
+ });
2457
2559
  };
2458
2560
  var store = getConfiguredStore({
2459
2561
  preloadedState: {}
@@ -2465,7 +2567,7 @@ var { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;
2465
2567
  var cutoffLength = 75;
2466
2568
  var ellipsis = "...";
2467
2569
  var longTextTrimmer = (text) => text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text;
2468
- var sanitizeDeviceAlerts = (alerts) => alerts.map((alert) => __spreadProps(__spreadValues({}, alert), { fullName: alert.name, name: longTextTrimmer(alert.name) }));
2570
+ var sanitizeDeviceAlerts = (alerts) => alerts.map((alert) => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name) }));
2469
2571
  var getDeviceAlerts = (0, import_toolkit17.createAsyncThunk)(`${sliceName4}/getDeviceAlerts`, ({ id, config = {} }, { dispatch }) => {
2470
2572
  const { page = defaultPage, perPage = defaultPerPage, issuedBefore, issuedAfter, sortAscending = false } = config;
2471
2573
  const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : "";
@@ -2483,14 +2585,15 @@ var getLatestDeviceAlerts = (0, import_toolkit17.createAsyncThunk)(`${sliceName4
2483
2585
  });
2484
2586
  var getIssueCountsByType2 = (0, import_toolkit17.createAsyncThunk)(`${sliceName4}/getIssueCountsByType`, ({ type, options = {} }, { dispatch, getState }) => {
2485
2587
  const state = getState();
2486
- const _a = options, { filters = getDeviceFilters(state), group, status } = _a, remainder = __objRest(_a, ["filters", "group", "status"]);
2487
- const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters(__spreadProps(__spreadValues({}, remainder), {
2588
+ const { filters = getDeviceFilters(state), group, status, ...remainder } = options;
2589
+ const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({
2590
+ ...remainder,
2488
2591
  filters,
2489
2592
  group,
2490
2593
  offlineThreshold: state.app.offlineThreshold,
2491
2594
  selectedIssues: [type],
2492
2595
  status
2493
- }));
2596
+ });
2494
2597
  return general_api_default.post(getSearchEndpoint(getState()), {
2495
2598
  page: 1,
2496
2599
  per_page: 1,
@@ -2520,12 +2623,4 @@ var changeNotificationSetting = (0, import_toolkit17.createAsyncThunk)(
2520
2623
  );
2521
2624
  }
2522
2625
  );
2523
- // Annotate the CommonJS export names for ESM import in node:
2524
- 0 && (module.exports = {
2525
- changeNotificationSetting,
2526
- getDeviceAlerts,
2527
- getDeviceMonitorConfig,
2528
- getIssueCountsByType,
2529
- getLatestDeviceAlerts
2530
- });
2531
2626
  //# sourceMappingURL=thunks.js.map