@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 });
@@ -101,7 +71,7 @@ var chartTypes = {
101
71
  };
102
72
  var emptyChartSelection = { software: "", group: "", chartType: chartTypes.bar.key, attribute: "artifact_name" };
103
73
  var defaultReportType = "distribution";
104
- var defaultReports = [__spreadProps(__spreadValues({}, emptyChartSelection), { group: null, attribute: "artifact_name", type: defaultReportType })];
74
+ var defaultReports = [{ ...emptyChartSelection, group: null, attribute: "artifact_name", type: defaultReportType }];
105
75
  var PLANS = {
106
76
  os: {
107
77
  id: "os",
@@ -423,13 +393,14 @@ var emptyUiPermissions = Object.freeze({
423
393
  deployments: [],
424
394
  groups: Object.freeze({}),
425
395
  releases: Object.freeze({}),
396
+ tenantManagement: [],
426
397
  userManagement: []
427
398
  });
428
399
  var emptyRole = Object.freeze({
429
400
  name: void 0,
430
401
  description: "",
431
402
  permissions: [],
432
- uiPermissions: Object.freeze(__spreadValues({}, emptyUiPermissions))
403
+ uiPermissions: Object.freeze({ ...emptyUiPermissions })
433
404
  });
434
405
 
435
406
  // src/deploymentsSlice/constants.ts
@@ -458,11 +429,12 @@ var deploymentStatesToSubstates = {
458
429
  pending: [deploymentSubstates.pending],
459
430
  successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact]
460
431
  };
461
- var deploymentStatesToSubstatesWithSkipped = __spreadProps(__spreadValues({}, deploymentStatesToSubstates), {
432
+ var deploymentStatesToSubstatesWithSkipped = {
433
+ ...deploymentStatesToSubstates,
462
434
  failures: [deploymentSubstates.failure],
463
435
  skipped: [deploymentSubstates.aborted, deploymentSubstates.noartifact, deploymentSubstates.alreadyInstalled, deploymentSubstates.decommissioned],
464
436
  successes: [deploymentSubstates.success]
465
- });
437
+ };
466
438
  var installationSubstatesMap = {
467
439
  download: {
468
440
  title: "download",
@@ -507,8 +479,8 @@ var DEPLOYMENT_STATES = {
507
479
  var listDefaultsByState = {
508
480
  [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },
509
481
  [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },
510
- [DEPLOYMENT_STATES.scheduled]: __spreadValues({}, DEVICE_LIST_DEFAULTS),
511
- [DEPLOYMENT_STATES.finished]: __spreadValues({}, DEVICE_LIST_DEFAULTS),
482
+ [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },
483
+ [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },
512
484
  sort: { direction: SORTING_OPTIONS.desc }
513
485
  };
514
486
  var DEFAULT_PENDING_INPROGRESS_COUNT = 10;
@@ -635,6 +607,13 @@ var auditLogsApiUrl = `${apiUrl.v1}/auditlogs`;
635
607
  var tenantadmApiUrlv1 = `${apiUrl.v1}/tenantadm`;
636
608
  var tenantadmApiUrlv2 = `${apiUrl.v2}/tenantadm`;
637
609
  var ssoIdpApiUrlv1 = `${apiUrl.v1}/useradm/sso/idp/metadata`;
610
+ var AUDIT_LOGS_TYPES = [
611
+ { title: "Artifact", queryParameter: "object_type", value: "artifact" },
612
+ { title: "Deployment", queryParameter: "object_deployment_name", value: "deployment" },
613
+ { title: "Device", queryParameter: "object_id", value: "device" },
614
+ { title: "User", queryParameter: "object_id", value: "user" }
615
+ ];
616
+ var SP_AUDIT_LOGS_TYPES = [AUDIT_LOGS_TYPES[3], { title: "Tenant", queryParameter: "object_id", value: "tenant" }];
638
617
  var emptyWebhook = {
639
618
  description: "",
640
619
  enabled: true,
@@ -683,10 +662,12 @@ var permissionSetIds = {
683
662
  DeployToDevices: "DeployToDevices",
684
663
  ManageDevices: "ManageDevices",
685
664
  ManageReleases: "ManageReleases",
665
+ ManageTenants: "ManageTenants",
686
666
  ManageUsers: "ManageUsers",
687
667
  ReadAuditLogs: "ReadAuditLogs",
688
668
  ReadDevices: "ReadDevices",
689
669
  ReadReleases: "ReadReleases",
670
+ ReadTenants: "ReadTenants",
690
671
  ReadUsers: "ReadUsers",
691
672
  SuperUser: "SuperUser",
692
673
  UploadArtifacts: "UploadArtifacts"
@@ -725,6 +706,7 @@ var uiPermissionsById = {
725
706
  permissionSets: {
726
707
  groups: permissionSetIds.ManageDevices,
727
708
  releases: permissionSetIds.ManageReleases,
709
+ tenantManagement: permissionSetIds.ManageTenants,
728
710
  userManagement: permissionSetIds.ManageUsers
729
711
  },
730
712
  title: "Manage",
@@ -738,6 +720,7 @@ var uiPermissionsById = {
738
720
  auditlog: permissionSetIds.ReadAuditLogs,
739
721
  groups: permissionSetIds.ReadDevices,
740
722
  releases: permissionSetIds.ReadReleases,
723
+ tenantManagement: permissionSetIds.ReadTenants,
741
724
  userManagement: permissionSetIds.ReadUsers
742
725
  },
743
726
  title: "Read",
@@ -762,6 +745,7 @@ var uiPermissionsByArea = {
762
745
  auditlog: {
763
746
  endpoints: [{ path: /\/(auditlog)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] }],
764
747
  explanation: "Granting access to the audit log will allow tracing changes to devices, releases and user accounts, as well as providing information about deployments.",
748
+ key: "auditlog",
765
749
  uiPermissions: [uiPermissionsById.read],
766
750
  title: "System audit log"
767
751
  },
@@ -772,6 +756,7 @@ var uiPermissionsByArea = {
772
756
  { path: /\/(deployments\/config)/i, types: [PermissionTypes.Get, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] }
773
757
  ],
774
758
  explanation: "Providing deploy permissions will allow deployments to be created using the releases and devices a user has access to.",
759
+ key: "deployments",
775
760
  uiPermissions: [uiPermissionsById.read, uiPermissionsById.deploy],
776
761
  title: "Deployments"
777
762
  },
@@ -787,6 +772,7 @@ var uiPermissionsByArea = {
787
772
  { path: /\/(deviceconnect\/devices)/i, types: [PermissionTypes.Get, PermissionTypes.Post], uiPermissions: [uiPermissionsById.connect] }
788
773
  ],
789
774
  explanation: "Device group management permissions control the degree to which devices in a group can be accessed and moved to other groups.",
775
+ key: "groups",
790
776
  scope: scopedPermissionAreas.groups.scopeType,
791
777
  uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.deploy, uiPermissionsById.configure, uiPermissionsById.connect],
792
778
  title: "Group Management"
@@ -806,16 +792,29 @@ var uiPermissionsByArea = {
806
792
  }
807
793
  ],
808
794
  explanation: "Release permissions can be granted to allow artifact & release modifications, as well as the creation of new releases.",
795
+ key: "releases",
809
796
  scope: "ReleaseTags",
810
797
  uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.upload],
811
798
  title: "Release Management"
812
799
  },
800
+ tenantManagement: {
801
+ endpoints: [
802
+ { path: /\/(tenantadm\/tenants)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },
803
+ { path: /\/(tenantadm\/tenants)/i, types: [PermissionTypes.Post, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] },
804
+ { path: /\/(users\/exists)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.manage] }
805
+ ],
806
+ explanation: "Tenant management permissions allow listing, creating and modifying child tenants",
807
+ key: "tenantManagement",
808
+ uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],
809
+ title: "Tenant Management"
810
+ },
813
811
  userManagement: {
814
812
  endpoints: [
815
813
  { path: /\/(useradm)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },
816
814
  { path: /\/(useradm)/i, types: [PermissionTypes.Post], uiPermissions: [uiPermissionsById.manage] }
817
815
  ],
818
816
  explanation: "User management permissions should be granted carefully, as these allow privilege increases for any users managed by a user with user management permissions",
817
+ key: "userManagement",
819
818
  uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],
820
819
  title: "User Management"
821
820
  }
@@ -828,56 +827,87 @@ var rolesById = Object.freeze({
828
827
  description: "Full access",
829
828
  permissions: [],
830
829
  // permissions refers to the values returned from the backend
831
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
830
+ uiPermissions: {
831
+ ...emptyUiPermissions,
832
832
  auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
833
833
  deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
834
834
  groups: { [ALL_DEVICES]: uiPermissionsByArea.groups.uiPermissions.map(permissionMapper) },
835
835
  releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) },
836
836
  userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper)
837
- })
837
+ }
838
838
  },
839
839
  [staticRolesByName.readOnly]: {
840
840
  name: "Read Access",
841
841
  value: staticRolesByName.readOnly,
842
842
  description: "",
843
843
  permissions: [],
844
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
844
+ uiPermissions: {
845
+ ...emptyUiPermissions,
845
846
  deployments: [uiPermissionsById.read.value],
846
847
  groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] },
847
848
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] },
848
849
  userManagement: [uiPermissionsById.read.value]
849
- })
850
+ }
850
851
  },
851
852
  [staticRolesByName.ci]: {
852
853
  name: "Releases Manager",
853
854
  value: staticRolesByName.ci,
854
855
  description: "",
855
856
  permissions: [],
856
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
857
+ uiPermissions: {
858
+ ...emptyUiPermissions,
857
859
  releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) }
858
- })
860
+ }
859
861
  },
860
862
  [staticRolesByName.deploymentsManager]: {
861
863
  name: "Deployments Manager",
862
864
  value: staticRolesByName.deploymentsManager,
863
865
  description: "",
864
866
  permissions: [],
865
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
867
+ uiPermissions: {
868
+ ...emptyUiPermissions,
866
869
  deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
867
870
  groups: { [ALL_DEVICES]: [uiPermissionsById.deploy.value, uiPermissionsById.read.value] },
868
871
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }
869
- })
872
+ }
870
873
  },
871
874
  [staticRolesByName.terminalAccess]: {
872
875
  name: "Troubleshooting",
873
876
  value: staticRolesByName.terminalAccess,
874
877
  description: "Access to the troubleshooting features: Remote Terminal, File Transfer, Port Forwarding",
875
878
  permissions: [],
876
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
879
+ uiPermissions: {
880
+ ...emptyUiPermissions,
877
881
  groups: { [ALL_DEVICES]: [uiPermissionsById.connect.value] }
878
- })
882
+ }
879
883
  }
880
884
  });
885
+ var serviceProviderRolesById = {
886
+ admin: {
887
+ name: "Admin",
888
+ value: staticRolesByName.admin,
889
+ description: "Full access",
890
+ permissions: [],
891
+ uiPermissions: {
892
+ ...emptyUiPermissions,
893
+ auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
894
+ userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper),
895
+ tenantManagement: uiPermissionsByArea.tenantManagement.uiPermissions.map(permissionMapper)
896
+ }
897
+ },
898
+ readOnly: {
899
+ name: "Read access",
900
+ value: staticRolesByName.admin,
901
+ description: "This role can see all linked organizations but cannot make any changes",
902
+ permissions: [],
903
+ uiPermissions: {
904
+ ...emptyUiPermissions,
905
+ auditlog: [uiPermissionsById.read.value],
906
+ userManagement: [uiPermissionsById.read.value],
907
+ tenantManagement: [uiPermissionsById.read.value]
908
+ }
909
+ }
910
+ };
881
911
  var defaultPermissionSets = {
882
912
  [permissionSetIds.Basic]: {
883
913
  name: permissionSetIds.Basic,
@@ -888,7 +918,9 @@ var defaultPermissionSets = {
888
918
  },
889
919
  [permissionSetIds.SuperUser]: {
890
920
  name: permissionSetIds.SuperUser,
891
- result: __spreadValues({}, rolesById[staticRolesByName.admin].uiPermissions)
921
+ result: {
922
+ ...rolesById[staticRolesByName.admin].uiPermissions
923
+ }
892
924
  },
893
925
  [permissionSetIds.ManageUsers]: {
894
926
  name: permissionSetIds.ManageUsers,
@@ -908,6 +940,18 @@ var defaultPermissionSets = {
908
940
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }
909
941
  }
910
942
  },
943
+ [permissionSetIds.ReadTenants]: {
944
+ name: permissionSetIds.ReadTenants,
945
+ result: {
946
+ tenantManagement: [uiPermissionsById.read.value]
947
+ }
948
+ },
949
+ [permissionSetIds.ManageTenants]: {
950
+ name: permissionSetIds.ManageTenants,
951
+ result: {
952
+ tenantManagement: [uiPermissionsById.manage.value]
953
+ }
954
+ },
911
955
  [permissionSetIds.ReadUsers]: {
912
956
  name: permissionSetIds.ReadUsers,
913
957
  result: {
@@ -960,11 +1004,12 @@ var defaultPermissionSets = {
960
1004
  }
961
1005
  };
962
1006
  var USER_LOGOUT = "USER_LOGOUT";
963
- var rolesByName = __spreadProps(__spreadValues({}, staticRolesByName), {
1007
+ var rolesByName = {
1008
+ ...staticRolesByName,
964
1009
  deploymentCreation: { action: "CREATE_DEPLOYMENT", object: { type: "DEVICE_GROUP", value: void 0 } },
965
1010
  groupAccess: { action: "VIEW_DEVICE", object: { type: "DEVICE_GROUP", value: void 0 } },
966
1011
  userManagement: { action: "http", object: { type: "any", value: `${useradmApiUrlv1}/.*` } }
967
- });
1012
+ };
968
1013
  var twoFAStates = {
969
1014
  enabled: "enabled",
970
1015
  disabled: "disabled",
@@ -1052,7 +1097,10 @@ var appSlice = (0, import_toolkit.createSlice)({
1052
1097
  initialState,
1053
1098
  reducers: {
1054
1099
  setFeatures: (state, action) => {
1055
- state.features = __spreadValues(__spreadValues({}, state.features), action.payload);
1100
+ state.features = {
1101
+ ...state.features,
1102
+ ...action.payload
1103
+ };
1056
1104
  },
1057
1105
  setSnackbar: (state, { payload }) => {
1058
1106
  let { message, autoHideDuration, action, children, onClick, onClose } = payload;
@@ -1077,7 +1125,10 @@ var appSlice = (0, import_toolkit.createSlice)({
1077
1125
  state.hostedAnnouncement = action.payload;
1078
1126
  },
1079
1127
  setSearchState: (state, action) => {
1080
- state.searchState = __spreadValues(__spreadValues({}, state.searchState), action.payload);
1128
+ state.searchState = {
1129
+ ...state.searchState,
1130
+ ...action.payload
1131
+ };
1081
1132
  },
1082
1133
  setOfflineThreshold: (state, action) => {
1083
1134
  state.offlineThreshold = action.payload;
@@ -1088,20 +1139,23 @@ var appSlice = (0, import_toolkit.createSlice)({
1088
1139
  },
1089
1140
  uploadProgress: (state, action) => {
1090
1141
  const { id, progress: progress2 } = action.payload;
1091
- state.uploadsById[id] = __spreadProps(__spreadValues({}, state.uploadsById[id]), {
1142
+ state.uploadsById[id] = {
1143
+ ...state.uploadsById[id],
1092
1144
  progress: progress2
1093
- });
1145
+ };
1094
1146
  },
1095
1147
  cleanUpUpload: (state, action) => {
1096
- var _a;
1097
- const _b2 = state.uploadsById, { [_a = action.payload]: current } = _b2, remainder = __objRest(_b2, [__restKey(_a)]);
1148
+ const { [action.payload]: current, ...remainder } = state.uploadsById;
1098
1149
  state.uploadsById = remainder;
1099
1150
  },
1100
1151
  setVersionInformation: (state, action) => {
1101
- state.versionInformation = __spreadValues(__spreadValues({}, state.versionInformation), action.payload);
1152
+ state.versionInformation = {
1153
+ ...state.versionInformation,
1154
+ ...action.payload
1155
+ };
1102
1156
  },
1103
1157
  setEnvironmentData: (state, action) => {
1104
- return __spreadValues(__spreadValues({}, state), action.payload);
1158
+ return { ...state, ...action.payload };
1105
1159
  }
1106
1160
  }
1107
1161
  });
@@ -1133,7 +1187,7 @@ var initialState2 = {
1133
1187
  sourceWindow: -1
1134
1188
  },
1135
1189
  binaryDeltaLimits: {
1136
- timeout: __spreadProps(__spreadValues({}, limitDefault), { default: 60, max: 3600, min: 60 }),
1190
+ timeout: { ...limitDefault, default: 60, max: 3600, min: 60 },
1137
1191
  sourceWindow: limitDefault,
1138
1192
  inputWindow: limitDefault,
1139
1193
  duplicatesWindow: limitDefault,
@@ -1143,10 +1197,10 @@ var initialState2 = {
1143
1197
  deploymentDeviceLimit: 5e3,
1144
1198
  selectedDeviceIds: [],
1145
1199
  selectionState: {
1146
- finished: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" }),
1147
- inprogress: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] }),
1148
- pending: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] }),
1149
- scheduled: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { selection: [] }),
1200
+ finished: { ...DEVICE_LIST_DEFAULTS, endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" },
1201
+ inprogress: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
1202
+ pending: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
1203
+ scheduled: { ...DEVICE_LIST_DEFAULTS, selection: [] },
1150
1204
  general: {
1151
1205
  state: DEPLOYMENT_ROUTES.active.key,
1152
1206
  showCreationDialog: false,
@@ -1162,40 +1216,55 @@ var deploymentsSlice = (0, import_toolkit2.createSlice)({
1162
1216
  initialState: initialState2,
1163
1217
  reducers: {
1164
1218
  createdDeployment: (state, action) => {
1165
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, deploymentPrototype), action.payload);
1219
+ state.byId[action.payload.id] = {
1220
+ ...deploymentPrototype,
1221
+ ...action.payload
1222
+ };
1166
1223
  state.byStatus[DEPLOYMENT_STATES.pending].total = state.byStatus[DEPLOYMENT_STATES.pending].total + 1;
1167
1224
  state.byStatus[DEPLOYMENT_STATES.pending].deploymentIds = [...state.byStatus.pending.deploymentIds, action.payload.id];
1168
1225
  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;
1169
1226
  },
1170
1227
  removedDeployment: (state, action) => {
1171
- var _a;
1172
- const _b2 = state.byId, { [_a = action.payload]: removedDeployment } = _b2, remainder = __objRest(_b2, [__restKey(_a)]);
1228
+ const { [action.payload]: removedDeployment, ...remainder } = state.byId;
1173
1229
  state.byId = remainder;
1174
1230
  },
1175
1231
  receivedDeployment: (state, action) => {
1176
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id] || {}), action.payload);
1232
+ state.byId[action.payload.id] = {
1233
+ ...state.byId[action.payload.id] || {},
1234
+ ...action.payload
1235
+ };
1177
1236
  },
1178
1237
  receivedDeploymentDeviceLog: (state, action) => {
1179
1238
  const { id, deviceId, log } = action.payload;
1180
- const deployment = __spreadValues(__spreadValues({}, deploymentPrototype), state.byId[id]);
1181
- state.byId[id] = __spreadProps(__spreadValues({}, deployment), {
1182
- devices: __spreadProps(__spreadValues({}, deployment.devices), {
1183
- [deviceId]: __spreadProps(__spreadValues({}, deployment.devices[deviceId]), {
1239
+ const deployment = {
1240
+ ...deploymentPrototype,
1241
+ ...state.byId[id]
1242
+ };
1243
+ state.byId[id] = {
1244
+ ...deployment,
1245
+ devices: {
1246
+ ...deployment.devices,
1247
+ [deviceId]: {
1248
+ ...deployment.devices[deviceId],
1184
1249
  log
1185
- })
1186
- })
1187
- });
1250
+ }
1251
+ }
1252
+ };
1188
1253
  },
1189
1254
  receivedDeploymentDevices: (state, action) => {
1190
1255
  const { id, devices, selectedDeviceIds, totalDeviceCount } = action.payload;
1191
- state.byId[id] = __spreadProps(__spreadValues({}, state.byId[id]), {
1256
+ state.byId[id] = {
1257
+ ...state.byId[id],
1192
1258
  devices,
1193
1259
  totalDeviceCount
1194
- });
1260
+ };
1195
1261
  state.selectedDeviceIds = selectedDeviceIds;
1196
1262
  },
1197
1263
  receivedDeployments: (state, action) => {
1198
- state.byId = __spreadValues(__spreadValues({}, state.byId), action.payload);
1264
+ state.byId = {
1265
+ ...state.byId,
1266
+ ...action.payload
1267
+ };
1199
1268
  },
1200
1269
  receivedDeploymentsForStatus: (state, action) => {
1201
1270
  const { status, deploymentIds, total } = action.payload;
@@ -1237,9 +1306,9 @@ var initialState3 = {
1237
1306
  [DEVICE_STATES.preauth]: { deviceIds: [], total: 0 },
1238
1307
  [DEVICE_STATES.rejected]: { deviceIds: [], total: 0 }
1239
1308
  },
1240
- deviceList: __spreadProps(__spreadValues({
1241
- deviceIds: []
1242
- }, DEVICE_LIST_DEFAULTS), {
1309
+ deviceList: {
1310
+ deviceIds: [],
1311
+ ...DEVICE_LIST_DEFAULTS,
1243
1312
  selectedAttributes: [],
1244
1313
  selectedIssues: [],
1245
1314
  selection: [],
@@ -1250,7 +1319,7 @@ var initialState3 = {
1250
1319
  },
1251
1320
  state: DEVICE_STATES.accepted,
1252
1321
  total: 0
1253
- }),
1322
+ },
1254
1323
  filters: [
1255
1324
  // { key: 'device_type', value: 'raspberry', operator: '$eq', scope: 'inventory' }
1256
1325
  ],
@@ -1285,49 +1354,59 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1285
1354
  },
1286
1355
  addToGroup: (state, action) => {
1287
1356
  const { group, deviceIds } = action.payload;
1288
- const maybeExistingGroup = __spreadValues({
1357
+ const maybeExistingGroup = {
1289
1358
  filters: [],
1290
- deviceIds: []
1291
- }, state.groups.byId[group]);
1292
- state.groups.byId[group] = __spreadProps(__spreadValues({}, maybeExistingGroup), {
1359
+ deviceIds: [],
1360
+ ...state.groups.byId[group]
1361
+ };
1362
+ state.groups.byId[group] = {
1363
+ ...maybeExistingGroup,
1293
1364
  deviceIds: [...maybeExistingGroup.deviceIds, ...deviceIds].filter(import_helpers.duplicateFilter),
1294
1365
  total: (maybeExistingGroup.total || 0) + 1
1295
- });
1366
+ };
1296
1367
  },
1297
1368
  removeFromGroup: (state, action) => {
1298
1369
  const { group, deviceIds: removedIds } = action.payload;
1299
- const _a = state.groups.byId[group] || {}, { deviceIds = [], total = 0 } = _a, maybeExistingGroup = __objRest(_a, ["deviceIds", "total"]);
1300
- const changedGroup = __spreadProps(__spreadValues({}, maybeExistingGroup), {
1370
+ const { deviceIds = [], total = 0, ...maybeExistingGroup } = state.groups.byId[group] || {};
1371
+ const changedGroup = {
1372
+ ...maybeExistingGroup,
1301
1373
  deviceIds: deviceIds.filter((id) => !removedIds.includes(id)),
1302
1374
  total: Math.max(total - removedIds.length, 0)
1303
- });
1375
+ };
1304
1376
  if (changedGroup.total || changedGroup.deviceIds.length) {
1305
1377
  state.groups.byId[group] = changedGroup;
1306
1378
  return;
1307
1379
  } else if (state.groups.selectedGroup === group) {
1308
1380
  state.groups.selectedGroup = void 0;
1309
1381
  }
1310
- const _b2 = state.groups.byId, { [group]: removal } = _b2, remainingById = __objRest(_b2, [__restKey(group)]);
1382
+ const { [group]: removal, ...remainingById } = state.groups.byId;
1311
1383
  state.groups.byId = remainingById;
1312
1384
  },
1313
1385
  addGroup: (state, action) => {
1314
1386
  const { groupName, group } = action.payload;
1315
- state.groups.byId[groupName] = __spreadValues(__spreadValues({}, state.groups.byId[groupName]), group);
1387
+ state.groups.byId[groupName] = {
1388
+ ...state.groups.byId[groupName],
1389
+ ...group
1390
+ };
1316
1391
  },
1317
1392
  selectGroup: (state, { payload: group }) => {
1318
1393
  state.deviceList.deviceIds = state.groups.byId[group] && state.groups.byId[group].deviceIds.length > 0 ? state.groups.byId[group].deviceIds : [];
1319
1394
  state.groups.selectedGroup = group;
1320
1395
  },
1321
1396
  removeGroup: (state, action) => {
1322
- var _a;
1323
- const _b2 = state.groups.byId, { [_a = action.payload]: removal } = _b2, remainingById = __objRest(_b2, [__restKey(_a)]);
1397
+ const { [action.payload]: removal, ...remainingById } = state.groups.byId;
1324
1398
  state.groups.byId = remainingById;
1325
1399
  state.groups.selectedGroup = state.groups.selectedGroup === action.payload ? void 0 : state.groups.selectedGroup;
1326
1400
  },
1327
1401
  setDeviceListState: (state, action) => {
1328
- state.deviceList = __spreadProps(__spreadValues(__spreadValues({}, state.deviceList), action.payload), {
1329
- sort: __spreadValues(__spreadValues({}, state.deviceList.sort), action.payload.sort)
1330
- });
1402
+ state.deviceList = {
1403
+ ...state.deviceList,
1404
+ ...action.payload,
1405
+ sort: {
1406
+ ...state.deviceList.sort,
1407
+ ...action.payload.sort
1408
+ }
1409
+ };
1331
1410
  },
1332
1411
  setFilterAttributes: (state, action) => {
1333
1412
  state.filteringAttributes = action.payload;
@@ -1336,7 +1415,10 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1336
1415
  state.filteringAttributesConfig = action.payload;
1337
1416
  },
1338
1417
  receivedDevices: (state, action) => {
1339
- state.byId = __spreadValues(__spreadValues({}, state.byId), action.payload);
1418
+ state.byId = {
1419
+ ...state.byId,
1420
+ ...action.payload
1421
+ };
1340
1422
  },
1341
1423
  setDeviceFilters: (state, action) => {
1342
1424
  if ((0, import_helpers.deepCompare)(action.payload, state.filters)) {
@@ -1367,7 +1449,10 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1367
1449
  state.limit = action.payload;
1368
1450
  },
1369
1451
  receivedDevice: (state, action) => {
1370
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id]), action.payload);
1452
+ state.byId[action.payload.id] = {
1453
+ ...state.byId[action.payload.id],
1454
+ ...action.payload
1455
+ };
1371
1456
  },
1372
1457
  maybeUpdateDevicesByStatus: (state, action) => {
1373
1458
  const { deviceId, authId } = action.payload;
@@ -1388,15 +1473,17 @@ var import_toolkit4 = require("@reduxjs/toolkit");
1388
1473
  var sliceName4 = "monitor";
1389
1474
  var initialState4 = {
1390
1475
  alerts: {
1391
- alertList: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { total: 0 }),
1476
+ alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },
1392
1477
  byDeviceId: {}
1393
1478
  },
1394
1479
  issueCounts: {
1395
- byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => __spreadProps(__spreadValues({}, accu), { [key]: { filtered: 0, total: 0 } }), {})
1480
+ byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {})
1396
1481
  },
1397
1482
  settings: {
1398
1483
  global: {
1399
- channels: __spreadValues({}, Object.keys(alertChannels).reduce((accu, item) => __spreadProps(__spreadValues({}, accu), { [item]: { enabled: true } }), {}))
1484
+ channels: {
1485
+ ...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {})
1486
+ }
1400
1487
  }
1401
1488
  }
1402
1489
  };
@@ -1414,14 +1501,14 @@ var monitorSlice = (0, import_toolkit4.createSlice)({
1414
1501
  },
1415
1502
  receiveLatestDeviceAlerts: (state, action) => {
1416
1503
  const { deviceId, alerts } = action.payload;
1417
- state.alerts.byDeviceId[deviceId] = __spreadProps(__spreadValues({}, state.alerts.byDeviceId[deviceId]), { latest: alerts });
1504
+ state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };
1418
1505
  },
1419
1506
  receiveDeviceIssueCounts: (state, action) => {
1420
1507
  const { issueType, counts } = action.payload;
1421
1508
  state.issueCounts.byType[issueType] = counts;
1422
1509
  },
1423
1510
  setAlertListState: (state, action) => {
1424
- state.alerts.alertList = __spreadValues(__spreadValues({}, state.alerts.alertList), action.payload);
1511
+ state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };
1425
1512
  }
1426
1513
  }
1427
1514
  });
@@ -1445,7 +1532,7 @@ var onboardingSlice = (0, import_toolkit5.createSlice)({
1445
1532
  initialState: initialState5,
1446
1533
  reducers: {
1447
1534
  setOnboardingState: (state, action) => {
1448
- return __spreadValues(__spreadValues({}, state), action.payload);
1535
+ return { ...state, ...action.payload };
1449
1536
  },
1450
1537
  setDemoArtifactPort: (state, action) => {
1451
1538
  state.demoArtifactPort = action.payload;
@@ -1483,21 +1570,23 @@ var initialState6 = {
1483
1570
  brand: ""
1484
1571
  },
1485
1572
  intentId: null,
1573
+ tenantList: {
1574
+ ...TENANT_LIST_DEFAULT,
1575
+ total: 0,
1576
+ tenants: [],
1577
+ selectedTenant: null,
1578
+ sort: {
1579
+ direction: SORTING_OPTIONS.desc,
1580
+ key: "name"
1581
+ }
1582
+ },
1486
1583
  organization: {
1487
- tenantList: __spreadProps(__spreadValues({}, TENANT_LIST_DEFAULT), {
1488
- total: 0,
1489
- tenants: [],
1490
- selectedTenant: null,
1491
- sort: {
1492
- direction: SORTING_OPTIONS.desc,
1493
- key: "name"
1494
- }
1495
- })
1496
1584
  // id, name, status, tenant_token, plan
1497
1585
  },
1498
1586
  auditlog: {
1499
1587
  events: [],
1500
- selectionState: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), {
1588
+ selectionState: {
1589
+ ...DEVICE_LIST_DEFAULTS,
1501
1590
  detail: void 0,
1502
1591
  endDate: void 0,
1503
1592
  selectedIssue: void 0,
@@ -1506,7 +1595,7 @@ var initialState6 = {
1506
1595
  total: 0,
1507
1596
  type: void 0,
1508
1597
  user: void 0
1509
- })
1598
+ }
1510
1599
  },
1511
1600
  externalDeviceIntegrations: [
1512
1601
  // { <connection_string|x509|...>, id, provider }
@@ -1529,7 +1618,10 @@ var organizationSlice = (0, import_toolkit6.createSlice)({
1529
1618
  state.auditlog.selectionState.total = total;
1530
1619
  },
1531
1620
  setAuditLogState: (state, action) => {
1532
- state.auditlog.selectionState = __spreadValues(__spreadValues({}, state.auditlog.selectionState), action.payload);
1621
+ state.auditlog.selectionState = {
1622
+ ...state.auditlog.selectionState,
1623
+ ...action.payload
1624
+ };
1533
1625
  },
1534
1626
  receiveCurrentCard: (state, action) => {
1535
1627
  state.card = action.payload;
@@ -1538,12 +1630,10 @@ var organizationSlice = (0, import_toolkit6.createSlice)({
1538
1630
  state.intentId = action.payload;
1539
1631
  },
1540
1632
  setOrganization: (state, action) => {
1541
- state.organization = __spreadProps(__spreadValues(__spreadValues({}, state.organization), action.payload), {
1542
- tenantList: __spreadValues(__spreadValues({}, state.organization.tenantList), action.payload.tenantList)
1543
- });
1633
+ state.organization = { ...state.organization, ...action.payload };
1544
1634
  },
1545
1635
  setTenantListState: (state, action) => {
1546
- state.organization.tenantList = action.payload;
1636
+ state.tenantList = action.payload;
1547
1637
  },
1548
1638
  receiveExternalDeviceIntegrations: (state, action) => {
1549
1639
  state.externalDeviceIntegrations = action.payload;
@@ -1603,7 +1693,8 @@ var initialState7 = {
1603
1693
  }
1604
1694
  */
1605
1695
  },
1606
- releasesList: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), {
1696
+ releasesList: {
1697
+ ...DEVICE_LIST_DEFAULTS,
1607
1698
  searchedIds: [],
1608
1699
  releaseIds: [],
1609
1700
  selection: [],
@@ -1617,7 +1708,7 @@ var initialState7 = {
1617
1708
  selectedTags: [],
1618
1709
  total: 0,
1619
1710
  type: ""
1620
- }),
1711
+ },
1621
1712
  tags: [],
1622
1713
  updateTypes: [],
1623
1714
  /*
@@ -1643,8 +1734,7 @@ var releaseSlice = (0, import_toolkit7.createSlice)({
1643
1734
  state.updateTypes = action.payload;
1644
1735
  },
1645
1736
  removeRelease: (state, action) => {
1646
- var _a;
1647
- const _b2 = state.byId, { [_a = action.payload]: toBeRemoved } = _b2, byId = __objRest(_b2, [__restKey(_a)]);
1737
+ const { [action.payload]: toBeRemoved, ...byId } = state.byId;
1648
1738
  state.byId = byId;
1649
1739
  state.selectedRelease = action.payload === state.selectedRelease ? null : state.selectedRelease;
1650
1740
  },
@@ -1677,8 +1767,12 @@ var initialState8 = {
1677
1767
  previousPhases: [],
1678
1768
  retries: 0
1679
1769
  },
1680
- permissionSetsById: __spreadValues({}, defaultPermissionSets),
1681
- rolesById: __spreadValues({}, rolesById),
1770
+ permissionSetsById: {
1771
+ ...defaultPermissionSets
1772
+ },
1773
+ rolesById: {
1774
+ ...rolesById
1775
+ },
1682
1776
  settingsInitialized: false,
1683
1777
  showConnectDeviceDialog: false,
1684
1778
  showFeedbackDialog: false,
@@ -1718,13 +1812,15 @@ var usersSlice = (0, import_toolkit8.createSlice)({
1718
1812
  state.byId[0] = action.payload;
1719
1813
  },
1720
1814
  removedUser: (state, action) => {
1721
- var _a;
1722
- const _b2 = state.byId, { [_a = action.payload]: removedUser } = _b2, byId = __objRest(_b2, [__restKey(_a)]);
1815
+ const { [action.payload]: removedUser, ...byId } = state.byId;
1723
1816
  state.byId = byId;
1724
1817
  state.currentUser = state.currentUser === action.payload ? null : state.currentUser;
1725
1818
  },
1726
1819
  updatedUser: (state, action) => {
1727
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id]), action.payload);
1820
+ state.byId[action.payload.id] = {
1821
+ ...state.byId[action.payload.id],
1822
+ ...action.payload
1823
+ };
1728
1824
  },
1729
1825
  receivedPermissionSets: (state, action) => {
1730
1826
  state.permissionSetsById = action.payload;
@@ -1733,11 +1829,13 @@ var usersSlice = (0, import_toolkit8.createSlice)({
1733
1829
  state.rolesById = action.payload;
1734
1830
  },
1735
1831
  createdRole: (state, action) => {
1736
- state.rolesById[action.payload.name] = __spreadValues(__spreadValues({}, state.rolesById[action.payload.name]), action.payload);
1832
+ state.rolesById[action.payload.name] = {
1833
+ ...state.rolesById[action.payload.name],
1834
+ ...action.payload
1835
+ };
1737
1836
  },
1738
1837
  removedRole: (state, action) => {
1739
- var _a;
1740
- const _b2 = state.rolesById, { [_a = action.payload]: toBeRemoved } = _b2, rolesById2 = __objRest(_b2, [__restKey(_a)]);
1838
+ const { [action.payload]: toBeRemoved, ...rolesById2 } = state.rolesById;
1741
1839
  state.rolesById = rolesById2;
1742
1840
  },
1743
1841
  setCustomColumns: (state, action) => {
@@ -1745,18 +1843,27 @@ var usersSlice = (0, import_toolkit8.createSlice)({
1745
1843
  },
1746
1844
  setGlobalSettings: (state, action) => {
1747
1845
  state.settingsInitialized = true;
1748
- state.globalSettings = __spreadValues(__spreadValues({}, state.globalSettings), action.payload);
1846
+ state.globalSettings = {
1847
+ ...state.globalSettings,
1848
+ ...action.payload
1849
+ };
1749
1850
  },
1750
1851
  setUserSettings: (state, action) => {
1751
1852
  state.userSettingsInitialized = true;
1752
- state.userSettings = __spreadValues(__spreadValues({}, state.userSettings), action.payload);
1853
+ state.userSettings = {
1854
+ ...state.userSettings,
1855
+ ...action.payload
1856
+ };
1753
1857
  },
1754
1858
  setTooltipState: (state, action) => {
1755
1859
  const { id, readState = READ_STATES.read } = action.payload;
1756
1860
  state.tooltips.byId[id].readState = readState;
1757
1861
  },
1758
1862
  setTooltipsState: (state, action) => {
1759
- state.tooltips.byId = __spreadValues(__spreadValues({}, state.tooltips.byId), action.payload);
1863
+ state.tooltips.byId = {
1864
+ ...state.tooltips.byId,
1865
+ ...action.payload
1866
+ };
1760
1867
  },
1761
1868
  setShowFeedbackDialog: (state, action) => {
1762
1869
  state.showFeedbackDialog = action.payload;
@@ -1773,7 +1880,16 @@ var actions8 = usersSlice.actions;
1773
1880
  var usersSlice_default = usersSlice.reducer;
1774
1881
 
1775
1882
  // src/actions.ts
1776
- var actions_default = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, actions), actions2), actions3), actions4), actions5), actions6), actions7), actions8);
1883
+ var actions_default = {
1884
+ ...actions,
1885
+ ...actions2,
1886
+ ...actions3,
1887
+ ...actions4,
1888
+ ...actions5,
1889
+ ...actions6,
1890
+ ...actions7,
1891
+ ...actions8
1892
+ };
1777
1893
 
1778
1894
  // src/api/general-api.ts
1779
1895
  var import_axios = __toESM(require("axios"));
@@ -1784,18 +1900,17 @@ var cookies = new import_universal_cookie.default();
1784
1900
  var emptySession = Object.freeze({ token: "", exiresAt: void 0 });
1785
1901
  var tokenCache = "";
1786
1902
  var getSessionInfo = () => {
1787
- var _a, _b2;
1788
- let sessionInfo = __spreadValues({}, emptySession);
1903
+ let sessionInfo = { ...emptySession };
1789
1904
  try {
1790
- sessionInfo = JSON.parse((_a = window.localStorage.getItem("JWT")) != null ? _a : "");
1791
- } catch (e) {
1905
+ sessionInfo = JSON.parse(window.localStorage.getItem("JWT") ?? "");
1906
+ } catch {
1792
1907
  }
1793
1908
  if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < /* @__PURE__ */ new Date()) {
1794
1909
  cleanUp();
1795
- return __spreadValues({}, emptySession);
1910
+ return { ...emptySession };
1796
1911
  }
1797
1912
  if (!sessionInfo.token) {
1798
- let jwtTokenFromCookie = (_b2 = cookies.get("JWT", { doNotParse: true })) != null ? _b2 : "";
1913
+ let jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
1799
1914
  if (jwtTokenFromCookie) {
1800
1915
  setSessionInfo({ token: jwtTokenFromCookie, undefined: void 0 });
1801
1916
  sessionInfo.token = jwtTokenFromCookie;
@@ -1822,8 +1937,7 @@ var cleanUp = () => {
1822
1937
 
1823
1938
  // src/api/general-api.ts
1824
1939
  var unauthorizedRedirect = (error) => {
1825
- var _a;
1826
- if (!(0, import_axios.isCancel)(error) && ((_a = error.response) == null ? void 0 : _a.status) === 401 && getToken()) {
1940
+ if (!(0, import_axios.isCancel)(error) && error.response?.status === 401 && getToken()) {
1827
1941
  cleanUp();
1828
1942
  window.location.replace("/ui/");
1829
1943
  }
@@ -1833,7 +1947,7 @@ var commonRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { "Conten
1833
1947
  var authenticatedRequest = import_axios.default.create(commonRequestConfig);
1834
1948
  authenticatedRequest.interceptors.response.use((res) => res, unauthorizedRedirect);
1835
1949
  authenticatedRequest.interceptors.request.use(
1836
- (config) => __spreadProps(__spreadValues({}, config), { headers: __spreadProps(__spreadValues({}, config.headers), { Authorization: `Bearer ${getToken()}` }) }),
1950
+ (config) => ({ ...config, headers: { ...config.headers, Authorization: `Bearer ${getToken()}` } }),
1837
1951
  (error) => Promise.reject(error)
1838
1952
  );
1839
1953
  var Api = {
@@ -1841,7 +1955,7 @@ var Api = {
1841
1955
  delete: (url, data) => authenticatedRequest.request({ method: "delete", url, data }),
1842
1956
  patch: authenticatedRequest.patch,
1843
1957
  post: authenticatedRequest.post,
1844
- postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, __spreadValues(__spreadValues({}, commonRequestConfig), config)),
1958
+ postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, { ...commonRequestConfig, ...config }),
1845
1959
  put: authenticatedRequest.put,
1846
1960
  upload: (url, formData, progress2, cancelSignal) => authenticatedRequest.post(url, formData, {
1847
1961
  headers: { "Content-Type": "multipart/form-data" },
@@ -1872,10 +1986,7 @@ var getSearchState = (state) => state.app.searchState;
1872
1986
  var getSearchedDevices = (0, import_toolkit9.createSelector)([getSearchState], ({ deviceIds }) => deviceIds);
1873
1987
  var getVersionInformation = (0, import_toolkit9.createSelector)(
1874
1988
  [getFullVersionInformation, getFeatures],
1875
- (_a, { isHosted }) => {
1876
- var _b2 = _a, { Integration } = _b2, remainder = __objRest(_b2, ["Integration"]);
1877
- return isHosted && Integration !== "next" ? remainder : __spreadProps(__spreadValues({}, remainder), { Integration });
1878
- }
1989
+ ({ Integration, ...remainder }, { isHosted }) => isHosted && Integration !== "next" ? remainder : { ...remainder, Integration }
1879
1990
  );
1880
1991
  var getIsPreview = (0, import_toolkit9.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers2.versionCompare)(Integration, "next") > -1);
1881
1992
 
@@ -1892,8 +2003,7 @@ var getDeploymentsSelectionState = (state) => state.deployments.selectionState;
1892
2003
  var getMappedDeploymentSelection = (0, import_toolkit10.createSelector)(
1893
2004
  [getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],
1894
2005
  (selectionState, deploymentsState, deploymentsById) => {
1895
- var _a;
1896
- const { selection = [] } = (_a = selectionState[deploymentsState]) != null ? _a : {};
2006
+ const { selection = [] } = selectionState[deploymentsState] ?? {};
1897
2007
  return selection.reduce((accu, id) => {
1898
2008
  if (deploymentsById[id]) {
1899
2009
  accu.push(deploymentsById[id]);
@@ -1935,7 +2045,8 @@ var getSelectedGroup = (state) => state.devices.groups.selectedGroup;
1935
2045
  var getListedDevices = (state) => state.devices.deviceList.deviceIds;
1936
2046
  var getFilteringAttributes = (state) => state.devices.filteringAttributes;
1937
2047
  var getFilteringAttributesFromConfig = (state) => state.devices.filteringAttributesConfig.attributes;
1938
- var getSortedFilteringAttributes = (0, import_toolkit11.createSelector)([getFilteringAttributes], (filteringAttributes) => __spreadProps(__spreadValues({}, filteringAttributes), {
2048
+ var getSortedFilteringAttributes = (0, import_toolkit11.createSelector)([getFilteringAttributes], (filteringAttributes) => ({
2049
+ ...filteringAttributes,
1939
2050
  identityAttributes: [...filteringAttributes.identityAttributes, "id"]
1940
2051
  }));
1941
2052
  var getDeviceLimit = (state) => state.devices.limit;
@@ -1963,10 +2074,7 @@ var getDeviceCountsByStatus = (0, import_toolkit11.createSelector)(
1963
2074
  return accu;
1964
2075
  }, {})
1965
2076
  );
1966
- var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => {
1967
- var _a;
1968
- return (_a = devicesById[deviceId]) != null ? _a : {};
1969
- });
2077
+ var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
1970
2078
  var getSelectedGroupInfo = (0, import_toolkit11.createSelector)(
1971
2079
  [getAcceptedDevices, getGroupsById, getSelectedGroup],
1972
2080
  ({ total: acceptedDeviceTotal }, groupsById, selectedGroup) => {
@@ -1983,17 +2091,13 @@ var getLimitMaxed = (0, import_toolkit11.createSelector)(
1983
2091
  [getAcceptedDevices, getDeviceLimit],
1984
2092
  ({ total: acceptedDevices = 0 }, deviceLimit) => Boolean(deviceLimit && deviceLimit <= acceptedDevices)
1985
2093
  );
1986
- var _b;
1987
- var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], (_a) => {
1988
- var _c = _a, { [_b = UNGROUPED_GROUP.id]: ungrouped } = _c, groups = __objRest(_c, [__restKey(_b)]);
1989
- return groups;
1990
- });
2094
+ var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
1991
2095
  var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsById) => {
1992
2096
  const groupNames = Object.keys(groupsById).sort();
1993
2097
  const groupedGroups = Object.entries(groupsById).sort((a, b) => a[0].localeCompare(b[0])).reduce(
1994
2098
  (accu, [groupname, group]) => {
1995
2099
  const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;
1996
- const groupItem = __spreadProps(__spreadValues({}, group), { groupId: name, name: groupname });
2100
+ const groupItem = { ...group, groupId: name, name: groupname };
1997
2101
  if (group.filters.length > 0) {
1998
2102
  if (groupname !== UNGROUPED_GROUP.id) {
1999
2103
  accu.dynamic.push(groupItem);
@@ -2007,7 +2111,7 @@ var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsByI
2007
2111
  },
2008
2112
  { dynamic: [], static: [], ungrouped: [] }
2009
2113
  );
2010
- return __spreadValues({ groupNames }, groupedGroups);
2114
+ return { groupNames, ...groupedGroups };
2011
2115
  });
2012
2116
  var getAttributesList = (0, import_toolkit11.createSelector)(
2013
2117
  [getFilteringAttributes, getFilteringAttributesFromConfig],
@@ -2045,10 +2149,7 @@ var getWebhookEvents = (state) => state.organization.webhooks.events;
2045
2149
  var getWebhookEventTotal = (state) => state.organization.webhooks.eventTotal;
2046
2150
  var getDeviceTwinIntegrations = (0, import_toolkit12.createSelector)(
2047
2151
  [getExternalIntegrations],
2048
- (integrations) => integrations.filter((integration) => {
2049
- var _a;
2050
- return integration.id && ((_a = EXTERNAL_PROVIDER[integration.provider]) == null ? void 0 : _a.deviceTwin);
2051
- })
2152
+ (integrations) => integrations.filter((integration) => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)
2052
2153
  );
2053
2154
  var getIsServiceProvider = (state) => state.organization.organization.service_provider;
2054
2155
  var getWebhooks = (0, import_toolkit12.createSelector)(
@@ -2082,25 +2183,21 @@ var filterProcessors = {
2082
2183
  var filterAliases = {
2083
2184
  $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
2084
2185
  };
2085
- var mapFiltersToTerms = (filters) => filters.map((filter) => {
2086
- var _a;
2087
- return {
2088
- scope: filter.scope,
2089
- attribute: filter.key,
2090
- type: ((_a = filterAliases[filter.operator]) == null ? void 0 : _a.alias) || filter.operator,
2091
- value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
2092
- };
2093
- });
2186
+ var mapFiltersToTerms = (filters) => filters.map((filter) => ({
2187
+ scope: filter.scope,
2188
+ attribute: filter.key,
2189
+ type: filterAliases[filter.operator]?.alias || filter.operator,
2190
+ value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
2191
+ }));
2094
2192
  var convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) => issuesSelection.map((item) => {
2095
2193
  if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === "function") {
2096
- return __spreadProps(__spreadValues({}, DEVICE_ISSUE_OPTIONS[item].filterRule), { value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) });
2194
+ return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };
2097
2195
  }
2098
2196
  return DEVICE_ISSUE_OPTIONS[item].filterRule;
2099
2197
  });
2100
2198
  var convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {} }, offlineThreshold, selectedIssues = [], status }) => {
2101
- var _a;
2102
2199
  let applicableFilters = [...filters];
2103
- if (typeof group === "string" && !(((_a = groups.byId[group]) == null ? void 0 : _a.filters) || applicableFilters).length) {
2200
+ if (typeof group === "string" && !(groups.byId[group]?.filters || applicableFilters).length) {
2104
2201
  applicableFilters.push({ key: "group", value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "system" });
2105
2202
  }
2106
2203
  const nonMonitorFilters = applicableFilters.filter(
@@ -2116,12 +2213,12 @@ var convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {
2116
2213
  var listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => {
2117
2214
  return ids.slice(0, cutOffSize).reduce((accu, id) => {
2118
2215
  if (id && byId[id]) {
2119
- accu.push(__spreadValues(__spreadValues({}, defaultObject), byId[id]));
2216
+ accu.push({ ...defaultObject, ...byId[id] });
2120
2217
  }
2121
2218
  return accu;
2122
2219
  }, []);
2123
2220
  };
2124
- var mergePermissions = (existingPermissions = __spreadValues({}, emptyUiPermissions), addedPermissions) => Object.entries(existingPermissions).reduce(
2221
+ var mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) => Object.entries(existingPermissions).reduce(
2125
2222
  (accu, [key, value]) => {
2126
2223
  let values;
2127
2224
  if (!accu[key]) {
@@ -2131,12 +2228,12 @@ var mergePermissions = (existingPermissions = __spreadValues({}, emptyUiPermissi
2131
2228
  if (Array.isArray(value)) {
2132
2229
  values = [...value, ...accu[key]].filter(import_helpers4.duplicateFilter);
2133
2230
  } else {
2134
- values = mergePermissions(accu[key], __spreadValues({}, value));
2231
+ values = mergePermissions(accu[key], { ...value });
2135
2232
  }
2136
2233
  accu[key] = values;
2137
2234
  return accu;
2138
2235
  },
2139
- __spreadValues({}, addedPermissions)
2236
+ { ...addedPermissions }
2140
2237
  );
2141
2238
  var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
2142
2239
  (accu, roleId) => {
@@ -2145,20 +2242,17 @@ var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
2145
2242
  }
2146
2243
  return mergePermissions(accu, roles[roleId].uiPermissions);
2147
2244
  },
2148
- __spreadValues({}, emptyUiPermissions)
2245
+ { ...emptyUiPermissions }
2149
2246
  );
2150
2247
  var progress = ({ loaded, total }) => {
2151
2248
  let uploadProgress3 = loaded / total * 100;
2152
2249
  return uploadProgress3 = uploadProgress3 < 50 ? Math.ceil(uploadProgress3) : Math.round(uploadProgress3);
2153
2250
  };
2154
- var extractErrorMessage = (err, fallback = "") => {
2155
- var _a, _b2, _c, _d, _e;
2156
- 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;
2157
- };
2251
+ var extractErrorMessage = (err, fallback = "") => err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;
2158
2252
  var preformatWithRequestID = (res, failMsg) => {
2159
2253
  if (failMsg.length > 100) failMsg = `${failMsg.substring(0, 220)}...`;
2160
2254
  try {
2161
- if ((res == null ? void 0 : res.data) && Object.keys(res.data).includes("request_id")) {
2255
+ if (res?.data && Object.keys(res.data).includes("request_id")) {
2162
2256
  let shortRequestUUID = res.data["request_id"].substring(0, 8);
2163
2257
  return `${failMsg} [Request ID: ${shortRequestUUID}]`;
2164
2258
  }
@@ -2178,15 +2272,12 @@ var getReleaseListState = (state) => state.releases.releasesList;
2178
2272
  var getListedReleases = (state) => state.releases.releasesList.releaseIds;
2179
2273
  var getReleaseMappingDefaults = () => ({});
2180
2274
  var getReleasesList = (0, import_toolkit13.createSelector)([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);
2181
- var getReleaseTagsById = (0, import_toolkit13.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => __spreadProps(__spreadValues({}, accu), { [key]: key }), {}));
2275
+ var getReleaseTagsById = (0, import_toolkit13.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));
2182
2276
  var getHasReleases = (0, import_toolkit13.createSelector)(
2183
2277
  [getReleaseListState, getReleasesById],
2184
2278
  ({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)
2185
2279
  );
2186
- var getSelectedRelease = (0, import_toolkit13.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => {
2187
- var _a;
2188
- return (_a = byId[id]) != null ? _a : {};
2189
- });
2280
+ var getSelectedRelease = (0, import_toolkit13.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id] ?? {});
2190
2281
 
2191
2282
  // src/usersSlice/selectors.ts
2192
2283
  var import_toolkit14 = require("@reduxjs/toolkit");
@@ -2195,10 +2286,7 @@ var getTooltipsById = (state) => state.users.tooltips.byId;
2195
2286
  var getGlobalSettings = (state) => state.users.globalSettings;
2196
2287
  var getCurrentUserId = (state) => state.users.currentUser;
2197
2288
  var getUsersById = (state) => state.users.byId;
2198
- var getCurrentUser = (0, import_toolkit14.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => {
2199
- var _a;
2200
- return (_a = usersById[userId]) != null ? _a : {};
2201
- });
2289
+ var getCurrentUser = (0, import_toolkit14.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => usersById[userId] ?? {});
2202
2290
  var getUserSettings = (state) => state.users.userSettings;
2203
2291
  var getIsDarkMode = (0, import_toolkit14.createSelector)([getUserSettings], ({ mode }) => isDarkMode(mode));
2204
2292
  var getShowHelptips = (0, import_toolkit14.createSelector)(
@@ -2209,22 +2297,22 @@ var getTooltipsState = (0, import_toolkit14.createSelector)(
2209
2297
  [getTooltipsById, getUserSettings],
2210
2298
  (byId, { tooltips = {} }) => Object.entries(byId).reduce(
2211
2299
  (accu, [id, value]) => {
2212
- accu[id] = __spreadValues(__spreadValues({}, accu[id]), value);
2300
+ accu[id] = { ...accu[id], ...value };
2213
2301
  return accu;
2214
2302
  },
2215
- __spreadValues({}, tooltips)
2303
+ { ...tooltips }
2216
2304
  )
2217
2305
  );
2218
2306
  var getHas2FA = (0, import_toolkit14.createSelector)(
2219
2307
  [getCurrentUser],
2220
2308
  (currentUser) => currentUser.hasOwnProperty("tfa_status") && currentUser.tfa_status === twoFAStates.enabled
2221
2309
  );
2222
- var getIdAttribute = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ id_attribute = __spreadValues({}, defaultIdAttribute) }) => id_attribute);
2310
+ var getIdAttribute = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);
2223
2311
  var getOfflineThresholdSettings = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ offlineThreshold }) => ({
2224
- interval: (offlineThreshold == null ? void 0 : offlineThreshold.interval) || DEVICE_ONLINE_CUTOFF.interval,
2225
- intervalUnit: (offlineThreshold == null ? void 0 : offlineThreshold.intervalUnit) || DEVICE_ONLINE_CUTOFF.intervalName
2312
+ interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,
2313
+ intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
2226
2314
  }));
2227
- var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([id, role]) => __spreadValues({ id }, role)));
2315
+ var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([id, role]) => ({ id, ...role })));
2228
2316
 
2229
2317
  // src/commonSelectors.ts
2230
2318
  var getIsEnterprise = (0, import_toolkit15.createSelector)(
@@ -2242,8 +2330,7 @@ var getSearchEndpoint = (0, import_toolkit15.createSelector)(
2242
2330
  var getUserRoles = (0, import_toolkit15.createSelector)(
2243
2331
  [getCurrentUser, getRolesById, getIsEnterprise, getFeatures, getOrganization],
2244
2332
  (currentUser, rolesById2, isEnterprise, { isHosted, hasMultitenancy }, { plan = PLANS.os.id }) => {
2245
- var _a;
2246
- const isAdmin = ((_a = currentUser.roles) == null ? void 0 : _a.length) ? currentUser.roles.some((role) => role === rolesByName.admin) : !(hasMultitenancy || isEnterprise || isHosted && plan !== PLANS.os.id);
2333
+ const isAdmin = currentUser.roles?.length ? currentUser.roles.some((role) => role === rolesByName.admin) : !(hasMultitenancy || isEnterprise || isHosted && plan !== PLANS.os.id);
2247
2334
  const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById2) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById2);
2248
2335
  return { isAdmin, uiPermissions };
2249
2336
  }
@@ -2312,10 +2399,11 @@ var getFilterAttributes = (0, import_toolkit15.createSelector)(
2312
2399
  const deviceNameAttribute = { key: "name", value: "Name", scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };
2313
2400
  const deviceIdAttribute = { key: "id", value: "Device ID", scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };
2314
2401
  const checkInAttribute = { key: "check_in_time", value: "Latest activity", scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };
2315
- const updateAttribute = __spreadProps(__spreadValues({}, checkInAttribute), { key: "updated_ts", value: "Last inventory update" });
2402
+ const updateAttribute = { ...checkInAttribute, key: "updated_ts", value: "Last inventory update" };
2316
2403
  const firstRequestAttribute = { key: "created_ts", value: "First request", scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };
2317
2404
  const attributes = [
2318
- ...previousFilters.map((item) => __spreadProps(__spreadValues({}, item), {
2405
+ ...previousFilters.map((item) => ({
2406
+ ...item,
2319
2407
  value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,
2320
2408
  category: "recently used",
2321
2409
  priority: 0
@@ -2333,14 +2421,13 @@ var getFilterAttributes = (0, import_toolkit15.createSelector)(
2333
2421
  return (0, import_helpers5.attributeDuplicateFilter)(attributes, "key");
2334
2422
  }
2335
2423
  );
2336
- var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], (_a, { onboarding = {} }) => {
2337
- var _b2 = _a, { complete, progress: progress2, showTips } = _b2, remainder = __objRest(_b2, ["complete", "progress", "showTips"]);
2338
- return __spreadProps(__spreadValues(__spreadValues({}, remainder), onboarding), {
2339
- complete: onboarding.complete || complete,
2340
- progress: Object.keys(onboardingSteps).findIndex((step) => step === progress2) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress2 : onboarding.progress,
2341
- showTips: !onboarding.showTips ? onboarding.showTips : showTips
2342
- });
2343
- });
2424
+ var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], ({ complete, progress: progress2, showTips, ...remainder }, { onboarding = {} }) => ({
2425
+ ...remainder,
2426
+ ...onboarding,
2427
+ complete: onboarding.complete || complete,
2428
+ progress: Object.keys(onboardingSteps).findIndex((step) => step === progress2) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress2 : onboarding.progress,
2429
+ showTips: !onboarding.showTips ? onboarding.showTips : showTips
2430
+ }));
2344
2431
  var getDemoDeviceAddress = (0, import_toolkit15.createSelector)([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {
2345
2432
  const demoDeviceAddress = `http://${(0, import_helpers5.getDemoDeviceAddress)(Object.values(devicesById), approach)}`;
2346
2433
  return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;
@@ -2361,12 +2448,11 @@ var getDeploymentRelease = (0, import_toolkit15.createSelector)(
2361
2448
  var getSelectedDeploymentData = (0, import_toolkit15.createSelector)(
2362
2449
  [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],
2363
2450
  (deploymentsById, { selectedId }, devicesById, selectedDeviceIds) => {
2364
- var _a;
2365
- const deployment = (_a = deploymentsById[selectedId]) != null ? _a : {};
2451
+ const deployment = deploymentsById[selectedId] ?? {};
2366
2452
  const { devices = {} } = deployment;
2367
2453
  return {
2368
2454
  deployment,
2369
- selectedDevices: selectedDeviceIds.map((deviceId) => __spreadValues(__spreadValues({}, devicesById[deviceId]), devices[deviceId]))
2455
+ selectedDevices: selectedDeviceIds.map((deviceId) => ({ ...devicesById[deviceId], ...devices[deviceId] }))
2370
2456
  };
2371
2457
  }
2372
2458
  );
@@ -2381,8 +2467,7 @@ var getAvailableIssueOptionsByType = (0, import_toolkit15.createSelector)(
2381
2467
  }, {})
2382
2468
  );
2383
2469
  var getGroupNames = (0, import_toolkit15.createSelector)([getGroupsById, getUserRoles, (_, options = {}) => options], (groupsById, { uiPermissions }, { staticOnly }) => {
2384
- var _a;
2385
- const _b2 = groupsById, { [_a = UNGROUPED_GROUP.id]: ungrouped } = _b2, groups = __objRest(_b2, [__restKey(_a)]);
2470
+ const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;
2386
2471
  if (staticOnly) {
2387
2472
  return Object.keys(uiPermissions.groups).sort();
2388
2473
  }
@@ -2416,9 +2501,25 @@ var getAuditlogDevice = (0, import_toolkit15.createSelector)([getAuditLogEntry,
2416
2501
  if (auditlogEvent) {
2417
2502
  const { object = {} } = auditlogEvent;
2418
2503
  const { device = {}, id, type } = object;
2419
- auditlogDevice = type === "device" ? __spreadValues({ id }, device) : auditlogDevice;
2504
+ auditlogDevice = type === "device" ? { id, ...device } : auditlogDevice;
2420
2505
  }
2421
- return __spreadValues(__spreadValues({}, auditlogDevice), devicesById[auditlogDevice.id]);
2506
+ return { ...auditlogDevice, ...devicesById[auditlogDevice.id] };
2507
+ });
2508
+ var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, getRolesList], ({ service_provider }, roles) => {
2509
+ if (service_provider) {
2510
+ return roles.reduce((accu, role) => {
2511
+ if (rolesById[role.id]) {
2512
+ return accu;
2513
+ }
2514
+ accu.push(role);
2515
+ return accu;
2516
+ }, Object.values(serviceProviderRolesById));
2517
+ }
2518
+ return Object.keys(rolesById).reverse().reduce((accu, key) => {
2519
+ const index = accu.findIndex(({ id }) => id === key);
2520
+ accu = [accu[index], ...accu.filter((item, itemIndex) => index !== itemIndex)];
2521
+ return accu;
2522
+ }, roles);
2422
2523
  });
2423
2524
 
2424
2525
  // src/store.ts
@@ -2454,8 +2555,9 @@ var sessionReducer = (state, action) => {
2454
2555
  return rootReducer(state, action);
2455
2556
  };
2456
2557
  var getConfiguredStore = (options = {}) => {
2457
- const _a = options, { preloadedState = {} } = _a, config = __objRest(_a, ["preloadedState"]);
2458
- return (0, import_toolkit16.configureStore)(__spreadProps(__spreadValues({}, config), {
2558
+ const { preloadedState = {}, ...config } = options;
2559
+ return (0, import_toolkit16.configureStore)({
2560
+ ...config,
2459
2561
  preloadedState,
2460
2562
  reducer: sessionReducer,
2461
2563
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
@@ -2468,7 +2570,7 @@ var getConfiguredStore = (options = {}) => {
2468
2570
  ignoredPaths: ["app.uploadsById", "app.snackbar", "organization.externalDeviceIntegrations"]
2469
2571
  }
2470
2572
  })
2471
- }));
2573
+ });
2472
2574
  };
2473
2575
  var store = getConfiguredStore({
2474
2576
  preloadedState: {}
@@ -2480,19 +2582,20 @@ var import_locationutils = require("@northern.tech/utils/locationutils");
2480
2582
  var import_toolkit17 = require("@reduxjs/toolkit");
2481
2583
  var import_axios2 = require("axios");
2482
2584
 
2483
- // ../../node_modules/uuid/dist/esm-node/rng.js
2484
- var import_crypto = __toESM(require("crypto"));
2485
- var rnds8Pool = new Uint8Array(256);
2486
- var poolPtr = rnds8Pool.length;
2585
+ // ../../node_modules/uuid/dist/esm-browser/rng.js
2586
+ var getRandomValues;
2587
+ var rnds8 = new Uint8Array(16);
2487
2588
  function rng() {
2488
- if (poolPtr > rnds8Pool.length - 16) {
2489
- import_crypto.default.randomFillSync(rnds8Pool);
2490
- poolPtr = 0;
2589
+ if (!getRandomValues) {
2590
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
2591
+ if (!getRandomValues) {
2592
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2593
+ }
2491
2594
  }
2492
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
2595
+ return getRandomValues(rnds8);
2493
2596
  }
2494
2597
 
2495
- // ../../node_modules/uuid/dist/esm-node/stringify.js
2598
+ // ../../node_modules/uuid/dist/esm-browser/stringify.js
2496
2599
  var byteToHex = [];
2497
2600
  for (let i = 0; i < 256; ++i) {
2498
2601
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -2501,13 +2604,13 @@ function unsafeStringify(arr, offset = 0) {
2501
2604
  return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
2502
2605
  }
2503
2606
 
2504
- // ../../node_modules/uuid/dist/esm-node/native.js
2505
- var import_crypto2 = __toESM(require("crypto"));
2607
+ // ../../node_modules/uuid/dist/esm-browser/native.js
2608
+ var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2506
2609
  var native_default = {
2507
- randomUUID: import_crypto2.default.randomUUID
2610
+ randomUUID
2508
2611
  };
2509
2612
 
2510
- // ../../node_modules/uuid/dist/esm-node/v4.js
2613
+ // ../../node_modules/uuid/dist/esm-browser/v4.js
2511
2614
  function v4(options, buf, offset) {
2512
2615
  if (native_default.randomUUID && !buf && !options) {
2513
2616
  return native_default.randomUUID();
@@ -2532,20 +2635,21 @@ var { setSnackbar: setSnackbar2, initUpload, uploadProgress: uploadProgress2, cl
2532
2635
  var { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;
2533
2636
  var sortingDefaults = { direction: SORTING_OPTIONS.desc, key: "modified" };
2534
2637
  var flattenRelease = (release, stateRelease) => {
2535
- var _a;
2536
- const updatedArtifacts = ((_a = release.artifacts) == null ? void 0 : _a.sort((0, import_helpers6.customSort)(1, "modified"))) || [];
2638
+ const updatedArtifacts = release.artifacts?.sort((0, import_helpers6.customSort)(1, "modified")) || [];
2537
2639
  const { artifacts, deviceTypes, modified } = updatedArtifacts.reduce(
2538
2640
  (accu, item) => {
2539
- var _a2;
2540
2641
  accu.deviceTypes.push(...item.device_types_compatible);
2541
- const stateArtifact = ((_a2 = stateRelease.artifacts) == null ? void 0 : _a2.find((releaseArtifact) => releaseArtifact.id === item.id)) || {};
2642
+ const stateArtifact = stateRelease.artifacts?.find((releaseArtifact) => releaseArtifact.id === item.id) || {};
2542
2643
  accu.modified = accu.modified ? accu.modified : item.modified;
2543
- accu.artifacts.push(__spreadValues(__spreadValues({}, stateArtifact), item));
2644
+ accu.artifacts.push({
2645
+ ...stateArtifact,
2646
+ ...item
2647
+ });
2544
2648
  return accu;
2545
2649
  },
2546
2650
  { artifacts: [], deviceTypes: [], modified: void 0 }
2547
2651
  );
2548
- return __spreadProps(__spreadValues(__spreadValues({}, stateRelease), release), { artifacts, device_types_compatible: deviceTypes.filter(import_helpers6.duplicateFilter), modified });
2652
+ return { ...stateRelease, ...release, artifacts, device_types_compatible: deviceTypes.filter(import_helpers6.duplicateFilter), modified };
2549
2653
  };
2550
2654
  var reduceReceivedReleases = (releases, stateReleasesById) => releases.reduce((accu, release) => {
2551
2655
  const stateRelease = stateReleasesById[release.name] || {};
@@ -2563,17 +2667,16 @@ var findArtifactIndexInRelease = (releases, id) => Object.values(releases).reduc
2563
2667
  { release: null, index: -1 }
2564
2668
  );
2565
2669
  var getArtifactInstallCount = (0, import_toolkit17.createAsyncThunk)(`${sliceName7}/getArtifactInstallCount`, (id, { dispatch, getState }) => {
2566
- var _a;
2567
2670
  let { release, index } = findArtifactIndexInRelease(getReleasesById(getState()), id);
2568
2671
  if (!release || index === -1) {
2569
2672
  return;
2570
2673
  }
2571
2674
  const releaseArtifacts = [...release.artifacts];
2572
2675
  const artifact = releaseArtifacts[index];
2573
- const { key, name, version } = (_a = (0, import_helpers6.extractSoftwareItem)(artifact.artifact_provides)) != null ? _a : {};
2676
+ const { key, name, version } = (0, import_helpers6.extractSoftwareItem)(artifact.artifact_provides) ?? {};
2574
2677
  const attribute = `${key}${name ? `.${name}` : ""}.version`;
2575
2678
  const { filterTerms } = convertDeviceListStateToFilters({
2576
- filters: [__spreadProps(__spreadValues({}, emptyFilter), { key: attribute, value: version, scope: "inventory" })]
2679
+ filters: [{ ...emptyFilter, key: attribute, value: version, scope: "inventory" }]
2577
2680
  });
2578
2681
  return general_api_default.post(getSearchEndpoint(getState()), {
2579
2682
  page: 1,
@@ -2587,10 +2690,11 @@ var getArtifactInstallCount = (0, import_toolkit17.createAsyncThunk)(`${sliceNam
2587
2690
  }
2588
2691
  const installCount = Number(headers[headerNames.total]);
2589
2692
  const releaseArtifacts2 = [...release2.artifacts];
2590
- releaseArtifacts2[index2] = __spreadProps(__spreadValues({}, releaseArtifacts2[index2]), { installCount });
2591
- release2 = __spreadProps(__spreadValues({}, release2), {
2693
+ releaseArtifacts2[index2] = { ...releaseArtifacts2[index2], installCount };
2694
+ release2 = {
2695
+ ...release2,
2592
2696
  artifacts: releaseArtifacts2
2593
- });
2697
+ };
2594
2698
  return dispatch(actions7.receiveRelease(release2));
2595
2699
  });
2596
2700
  });
@@ -2602,12 +2706,14 @@ var getArtifactUrl = (0, import_toolkit17.createAsyncThunk)(
2602
2706
  return dispatch(getReleases());
2603
2707
  }
2604
2708
  const releaseArtifacts = [...release.artifacts];
2605
- releaseArtifacts[index] = __spreadProps(__spreadValues({}, releaseArtifacts[index]), {
2709
+ releaseArtifacts[index] = {
2710
+ ...releaseArtifacts[index],
2606
2711
  url: response.data.uri
2607
- });
2608
- release = __spreadProps(__spreadValues({}, release), {
2712
+ };
2713
+ release = {
2714
+ ...release,
2609
2715
  artifacts: releaseArtifacts
2610
- });
2716
+ };
2611
2717
  return dispatch(actions7.receiveRelease(release));
2612
2718
  })
2613
2719
  );
@@ -2732,12 +2838,14 @@ var selectRelease = (0, import_toolkit17.createAsyncThunk)(`${sliceName7}/select
2732
2838
  });
2733
2839
  var setReleasesListState = (0, import_toolkit17.createAsyncThunk)(`${sliceName7}/setReleasesListState`, (selectionState, { dispatch, getState }) => {
2734
2840
  const currentState = getState().releases.releasesList;
2735
- let nextState = __spreadProps(__spreadValues(__spreadValues({}, currentState), selectionState), {
2736
- sort: __spreadValues(__spreadValues({}, currentState.sort), selectionState.sort)
2737
- });
2841
+ let nextState = {
2842
+ ...currentState,
2843
+ ...selectionState,
2844
+ sort: { ...currentState.sort, ...selectionState.sort }
2845
+ };
2738
2846
  let tasks = [];
2739
- const _a = currentState, { isLoading: currentLoading } = _a, currentRequestState = __objRest(_a, ["isLoading"]);
2740
- const _b2 = nextState, { isLoading: selectionLoading } = _b2, selectionRequestState = __objRest(_b2, ["isLoading"]);
2847
+ const { isLoading: currentLoading, ...currentRequestState } = currentState;
2848
+ const { isLoading: selectionLoading, ...selectionRequestState } = nextState;
2741
2849
  if (!(0, import_helpers6.deepCompare)(currentRequestState, selectionRequestState)) {
2742
2850
  nextState.isLoading = true;
2743
2851
  tasks.push(dispatch(getReleases(nextState)).finally(() => dispatch(setReleasesListState({ isLoading: false }))));
@@ -2756,29 +2864,30 @@ var releaseListRetrieval = (config) => {
2756
2864
  );
2757
2865
  };
2758
2866
  var deductSearchState = (receivedReleases, config, total, state) => {
2759
- let releaseListState = __spreadValues({}, state.releasesList);
2867
+ let releaseListState = { ...state.releasesList };
2760
2868
  const { searchTerm, searchOnly, sort = {}, selectedTags = [], type } = config;
2761
2869
  const flattenedReleases = Object.values(receivedReleases).sort((0, import_helpers6.customSort)(sort.direction === SORTING_OPTIONS.desc, sort.key));
2762
2870
  const releaseIds = flattenedReleases.map((item) => item.name);
2763
2871
  const isFiltering = !!(selectedTags.length || type || searchTerm);
2764
2872
  if (searchOnly) {
2765
- releaseListState = __spreadProps(__spreadValues({}, releaseListState), { searchedIds: releaseIds });
2873
+ releaseListState = { ...releaseListState, searchedIds: releaseIds };
2766
2874
  } else {
2767
- releaseListState = __spreadProps(__spreadValues({}, releaseListState), {
2875
+ releaseListState = {
2876
+ ...releaseListState,
2768
2877
  releaseIds,
2769
2878
  searchTotal: isFiltering ? total : state.releasesList.searchTotal,
2770
2879
  total: !isFiltering ? total : state.releasesList.total
2771
- });
2880
+ };
2772
2881
  }
2773
2882
  return releaseListState;
2774
2883
  };
2775
2884
  var getReleases = (0, import_toolkit17.createAsyncThunk)(`${sliceName7}/getReleases`, (passedConfig = {}, { dispatch, getState }) => {
2776
- const config = __spreadValues(__spreadValues({}, getState().releases.releasesList), passedConfig);
2885
+ const config = { ...getState().releases.releasesList, ...passedConfig };
2777
2886
  return releaseListRetrieval(config).then(({ data: receivedReleases = [], headers = {} }) => {
2778
2887
  const total = headers[headerNames.total] ? Number(headers[headerNames.total]) : 0;
2779
2888
  const state = getState().releases;
2780
2889
  const flatReleases = reduceReceivedReleases(receivedReleases, state.byId);
2781
- const combinedReleases = __spreadValues(__spreadValues({}, state.byId), flatReleases);
2890
+ const combinedReleases = { ...state.byId, ...flatReleases };
2782
2891
  let tasks = [dispatch(actions7.receiveReleases(combinedReleases))];
2783
2892
  const releaseListState = deductSearchState(receivedReleases, config, total, state);
2784
2893
  tasks.push(dispatch(actions7.setReleaseListState(releaseListState)));
@@ -2799,7 +2908,7 @@ var updateReleaseInfo = (0, import_toolkit17.createAsyncThunk)(
2799
2908
  `${sliceName7}/updateReleaseInfo`,
2800
2909
  ({ name, info }, { dispatch, getState }) => general_api_default.patch(`${deploymentsApiUrlV2}/deployments/releases/${name}`, info).catch((err) => commonErrorHandler(err, `Release details couldn't be updated.`, dispatch)).then(() => {
2801
2910
  return Promise.all([
2802
- dispatch(actions7.receiveRelease(__spreadProps(__spreadValues(__spreadValues({}, getReleasesById(getState())[name]), info), { name }))),
2911
+ dispatch(actions7.receiveRelease({ ...getReleasesById(getState())[name], ...info, name })),
2803
2912
  dispatch(setSnackbar2("Release details were updated successfully.", TIMEOUTS.fiveSeconds, ""))
2804
2913
  ]);
2805
2914
  })
@@ -2808,7 +2917,7 @@ var setReleaseTags = (0, import_toolkit17.createAsyncThunk)(
2808
2917
  `${sliceName7}/setReleaseTags`,
2809
2918
  ({ name, tags = [] }, { dispatch, getState }) => general_api_default.put(`${deploymentsApiUrlV2}/deployments/releases/${name}/tags`, tags).catch((err) => commonErrorHandler(err, `Release tags couldn't be set.`, dispatch)).then(() => {
2810
2919
  return Promise.all([
2811
- dispatch(actions7.receiveRelease(__spreadProps(__spreadValues({}, getReleasesById(getState())[name]), { name, tags }))),
2920
+ dispatch(actions7.receiveRelease({ ...getReleasesById(getState())[name], name, tags })),
2812
2921
  dispatch(setSnackbar2("Release tags were set successfully.", TIMEOUTS.fiveSeconds, ""))
2813
2922
  ]);
2814
2923
  })
@@ -2821,23 +2930,4 @@ var getUpdateTypes = (0, import_toolkit17.createAsyncThunk)(
2821
2930
  `${sliceName7}/getReleaseTypes`,
2822
2931
  (_, { dispatch }) => general_api_default.get(`${deploymentsApiUrlV2}/releases/all/types`).catch((err) => commonErrorHandler(err, `Existing update types couldn't be retrieved.`, dispatch)).then(({ data: types }) => Promise.resolve(dispatch(actions7.receiveReleaseTypes(types))))
2823
2932
  );
2824
- // Annotate the CommonJS export names for ESM import in node:
2825
- 0 && (module.exports = {
2826
- cancelFileUpload,
2827
- createArtifact,
2828
- editArtifact,
2829
- getArtifactInstallCount,
2830
- getArtifactUrl,
2831
- getExistingReleaseTags,
2832
- getRelease,
2833
- getReleases,
2834
- getUpdateTypes,
2835
- removeArtifact,
2836
- removeRelease,
2837
- selectRelease,
2838
- setReleaseTags,
2839
- setReleasesListState,
2840
- updateReleaseInfo,
2841
- uploadArtifact
2842
- });
2843
2933
  //# sourceMappingURL=thunks.js.map