@northern.tech/testing 0.8.0 → 0.8.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.
- package/package.json +2 -4
- package/dist/baseTestConfig.json +0 -17
- package/dist/chunk-5ESUU7GT.js +0 -266
- package/dist/chunk-5ESUU7GT.js.map +0 -1
- package/dist/chunk-CGSW2XF4.js +0 -318
- package/dist/chunk-CGSW2XF4.js.map +0 -1
- package/dist/chunk-GPKMKZ6O.js +0 -161
- package/dist/chunk-GPKMKZ6O.js.map +0 -1
- package/dist/chunk-GQLNLYEI.js +0 -934
- package/dist/chunk-GQLNLYEI.js.map +0 -1
- package/dist/chunk-HRGVXWMH.js +0 -17
- package/dist/chunk-HRGVXWMH.js.map +0 -1
- package/dist/chunk-KCLTR6QS.js +0 -34
- package/dist/chunk-KCLTR6QS.js.map +0 -1
- package/dist/chunk-T3BKBWUF.js +0 -239
- package/dist/chunk-T3BKBWUF.js.map +0 -1
- package/dist/chunk-TSEGY3EV.js +0 -29
- package/dist/chunk-TSEGY3EV.js.map +0 -1
- package/dist/chunk-Y4IJBU7U.js +0 -188
- package/dist/chunk-Y4IJBU7U.js.map +0 -1
- package/dist/mockData.cjs +0 -968
- package/dist/mockData.cjs.map +0 -1
- package/dist/mockData.d.cts +0 -636
- package/dist/mockData.d.ts +0 -636
- package/dist/mockData.js +0 -47
- package/dist/mockData.js.map +0 -1
- package/dist/requestHandlers/deploymentHandlers.cjs +0 -1045
- package/dist/requestHandlers/deploymentHandlers.cjs.map +0 -1
- package/dist/requestHandlers/deploymentHandlers.d.cts +0 -5
- package/dist/requestHandlers/deploymentHandlers.d.ts +0 -5
- package/dist/requestHandlers/deploymentHandlers.js +0 -8
- package/dist/requestHandlers/deploymentHandlers.js.map +0 -1
- package/dist/requestHandlers/deviceHandlers.cjs +0 -1113
- package/dist/requestHandlers/deviceHandlers.cjs.map +0 -1
- package/dist/requestHandlers/deviceHandlers.d.cts +0 -20
- package/dist/requestHandlers/deviceHandlers.d.ts +0 -20
- package/dist/requestHandlers/deviceHandlers.js +0 -12
- package/dist/requestHandlers/deviceHandlers.js.map +0 -1
- package/dist/requestHandlers/monitorHandlers.cjs +0 -835
- package/dist/requestHandlers/monitorHandlers.cjs.map +0 -1
- package/dist/requestHandlers/monitorHandlers.d.cts +0 -5
- package/dist/requestHandlers/monitorHandlers.d.ts +0 -5
- package/dist/requestHandlers/monitorHandlers.js +0 -8
- package/dist/requestHandlers/monitorHandlers.js.map +0 -1
- package/dist/requestHandlers/organizationHandlers.cjs +0 -1130
- package/dist/requestHandlers/organizationHandlers.cjs.map +0 -1
- package/dist/requestHandlers/organizationHandlers.d.cts +0 -5
- package/dist/requestHandlers/organizationHandlers.d.ts +0 -5
- package/dist/requestHandlers/organizationHandlers.js +0 -8
- package/dist/requestHandlers/organizationHandlers.js.map +0 -1
- package/dist/requestHandlers/releaseHandlers.cjs +0 -966
- package/dist/requestHandlers/releaseHandlers.cjs.map +0 -1
- package/dist/requestHandlers/releaseHandlers.d.cts +0 -5
- package/dist/requestHandlers/releaseHandlers.d.ts +0 -5
- package/dist/requestHandlers/releaseHandlers.js +0 -8
- package/dist/requestHandlers/releaseHandlers.js.map +0 -1
- package/dist/requestHandlers/requestHandlers.cjs +0 -2019
- package/dist/requestHandlers/requestHandlers.cjs.map +0 -1
- package/dist/requestHandlers/requestHandlers.d.cts +0 -5
- package/dist/requestHandlers/requestHandlers.d.ts +0 -5
- package/dist/requestHandlers/requestHandlers.js +0 -35
- package/dist/requestHandlers/requestHandlers.js.map +0 -1
- package/dist/requestHandlers/userHandlers.cjs +0 -994
- package/dist/requestHandlers/userHandlers.cjs.map +0 -1
- package/dist/requestHandlers/userHandlers.d.cts +0 -5
- package/dist/requestHandlers/userHandlers.d.ts +0 -5
- package/dist/requestHandlers/userHandlers.js +0 -8
- package/dist/requestHandlers/userHandlers.js.map +0 -1
- package/dist/setupTests.cjs +0 -996
- package/dist/setupTests.cjs.map +0 -1
- package/dist/setupTests.d.cts +0 -77
- package/dist/setupTests.d.ts +0 -77
- package/dist/setupTests.js +0 -138
- package/dist/setupTests.js.map +0 -1
- package/dist/theme/light.cjs +0 -41
- package/dist/theme/light.cjs.map +0 -1
- package/dist/theme/light.d.cts +0 -12
- package/dist/theme/light.d.ts +0 -12
- package/dist/theme/light.js +0 -7
- package/dist/theme/light.js.map +0 -1
- package/dist/utils.cjs +0 -71
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.d.cts +0 -69
- package/dist/utils.d.ts +0 -69
- package/dist/utils.js +0 -12
- package/dist/utils.js.map +0 -1
|
@@ -1,835 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/requestHandlers/monitorHandlers.ts
|
|
21
|
-
var monitorHandlers_exports = {};
|
|
22
|
-
__export(monitorHandlers_exports, {
|
|
23
|
-
monitorHandlers: () => monitorHandlers
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(monitorHandlers_exports);
|
|
26
|
-
var import_constants2 = require("@northern.tech/utils/constants");
|
|
27
|
-
var import_msw = require("msw");
|
|
28
|
-
|
|
29
|
-
// src/mockData.ts
|
|
30
|
-
var import_constants = require("@northern.tech/utils/constants");
|
|
31
|
-
var TEST_SESSION_DATETIME = "2019-01-13T13:00:00.000Z";
|
|
32
|
-
var testDate = new Date(TEST_SESSION_DATETIME);
|
|
33
|
-
var mockDate = new Date(testDate.setMilliseconds(testDate.getMilliseconds() + import_constants.maxSessionAge));
|
|
34
|
-
var defaultCreationDate = "2019-01-13T06:25:00.000Z";
|
|
35
|
-
var defaultMacAddress = "dc:a6:32:12:ad:bf";
|
|
36
|
-
var permissionSetObjectTypes = {
|
|
37
|
-
any: "Any",
|
|
38
|
-
artifacts: "Artifacts",
|
|
39
|
-
empty: "",
|
|
40
|
-
groups: "Device groups",
|
|
41
|
-
releases: "Releases",
|
|
42
|
-
tenantManagement: "Tenant management",
|
|
43
|
-
userManagement: "User management"
|
|
44
|
-
};
|
|
45
|
-
var commonEndpoints = {
|
|
46
|
-
artifacts: "^/api/management/v1/deployments/artifacts",
|
|
47
|
-
artifactDetails: "^/api/management/v1/deployments/artifacts/[^/]+",
|
|
48
|
-
deviceManagement: "^/api/management/(v[1-9])/(devauth|inventory)/"
|
|
49
|
-
};
|
|
50
|
-
var userId = "a30a780b-b843-5344-80e3-0fd95a4f6fc3";
|
|
51
|
-
var defaultUser = {
|
|
52
|
-
created_ts: "2019-01-01T10:30:00.000Z",
|
|
53
|
-
email: "a@b.com",
|
|
54
|
-
id: "a1",
|
|
55
|
-
roles: ["RBAC_ROLE_PERMIT_ALL"],
|
|
56
|
-
tfa_status: "enabled",
|
|
57
|
-
verified: true
|
|
58
|
-
};
|
|
59
|
-
var deviceTypes = { qemu: "qemux86-64" };
|
|
60
|
-
var checkInTimeRounded = "2019-01-01T00:00:00.000Z";
|
|
61
|
-
var checkInTimeExact = "2019-01-01T10:25:00.000Z";
|
|
62
|
-
var mockApiResponses = {
|
|
63
|
-
deployments: {
|
|
64
|
-
byId: {
|
|
65
|
-
d1: {
|
|
66
|
-
id: "d1",
|
|
67
|
-
name: "test deployment",
|
|
68
|
-
created: "2019-01-01T12:30:00.000Z",
|
|
69
|
-
devices: {
|
|
70
|
-
a1: {
|
|
71
|
-
id: "a1",
|
|
72
|
-
status: "installing",
|
|
73
|
-
attributes: {},
|
|
74
|
-
image: { size: 123 }
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
statistics: {
|
|
78
|
-
status: {
|
|
79
|
-
"already-installed": 0,
|
|
80
|
-
decommissioned: 0,
|
|
81
|
-
downloading: 0,
|
|
82
|
-
failure: 0,
|
|
83
|
-
installing: 1,
|
|
84
|
-
noartifact: 0,
|
|
85
|
-
pending: 0,
|
|
86
|
-
rebooting: 0,
|
|
87
|
-
success: 0
|
|
88
|
-
},
|
|
89
|
-
total_size: 1234
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
d2: {
|
|
93
|
-
id: "d2",
|
|
94
|
-
name: "test deployment 2",
|
|
95
|
-
artifact_name: "r1",
|
|
96
|
-
artifacts: ["123"],
|
|
97
|
-
created: "2019-01-01T12:25:00.000Z",
|
|
98
|
-
device_count: 1,
|
|
99
|
-
devices: {
|
|
100
|
-
b1: {
|
|
101
|
-
attributes: {},
|
|
102
|
-
id: "b1",
|
|
103
|
-
status: "pending"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
filter: void 0,
|
|
107
|
-
group: void 0,
|
|
108
|
-
statistics: {
|
|
109
|
-
status: {
|
|
110
|
-
downloading: 0,
|
|
111
|
-
decommissioned: 0,
|
|
112
|
-
failure: 0,
|
|
113
|
-
installing: 0,
|
|
114
|
-
noartifact: 0,
|
|
115
|
-
pending: 1,
|
|
116
|
-
rebooting: 0,
|
|
117
|
-
success: 0,
|
|
118
|
-
"already-installed": 0
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
d3: {
|
|
123
|
-
id: "d3",
|
|
124
|
-
name: "Test",
|
|
125
|
-
phases: [
|
|
126
|
-
{ id: "0", batch_size: 2, device_count: 2 },
|
|
127
|
-
{ id: "1", start_ts: "2019-02-04T11:45:10.002Z", batch_size: 3, device_count: 3 },
|
|
128
|
-
{ id: "2", start_ts: "2019-02-05T11:45:10.002Z", batch_size: 5, device_count: 5 },
|
|
129
|
-
{ id: "3", start_ts: "2019-02-06T11:45:10.002Z", batch_size: 5, device_count: 5 },
|
|
130
|
-
{ id: "4", start_ts: "2019-02-21T11:45:10.002Z", batch_size: 5, device_count: 0 }
|
|
131
|
-
],
|
|
132
|
-
max_devices: 0,
|
|
133
|
-
created: "2019-01-31T12:59:30.020Z",
|
|
134
|
-
devices: {},
|
|
135
|
-
filter: void 0,
|
|
136
|
-
group: void 0,
|
|
137
|
-
stats: {
|
|
138
|
-
pending: 3,
|
|
139
|
-
decommissioned: 0,
|
|
140
|
-
failure: 23,
|
|
141
|
-
pause_before_committing: 0,
|
|
142
|
-
pause_before_rebooting: 0,
|
|
143
|
-
installing: 0,
|
|
144
|
-
rebooting: 0,
|
|
145
|
-
"already-installed": 0,
|
|
146
|
-
pause_before_installing: 0,
|
|
147
|
-
downloading: 0,
|
|
148
|
-
success: 6,
|
|
149
|
-
aborted: 0,
|
|
150
|
-
noartifact: 0
|
|
151
|
-
},
|
|
152
|
-
statistics: { total_size: "1234" },
|
|
153
|
-
status: "inprogress",
|
|
154
|
-
active: true,
|
|
155
|
-
device_count: 100,
|
|
156
|
-
retries: "0",
|
|
157
|
-
type: "software"
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
byStatus: {
|
|
161
|
-
pending: { deploymentIds: ["d2"] },
|
|
162
|
-
inprogress: { deploymentIds: ["d3"] }
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
devices: {
|
|
166
|
-
byId: {
|
|
167
|
-
a1: {
|
|
168
|
-
id: "a1",
|
|
169
|
-
auth_sets: [
|
|
170
|
-
{
|
|
171
|
-
id: "auth1",
|
|
172
|
-
identity_data: { mac: defaultMacAddress },
|
|
173
|
-
pubkey: "-----BEGIN PUBLIC KEY-----\nMIIBojWELzgJ62hcXIhAfqfoNiaB1326XZByZwcnHr5BuSPAgMBAAE=\n-----END PUBLIC KEY-----\n",
|
|
174
|
-
status: "accepted",
|
|
175
|
-
ts: defaultCreationDate
|
|
176
|
-
}
|
|
177
|
-
],
|
|
178
|
-
updated_ts: "2019-01-01T09:25:00.000Z"
|
|
179
|
-
},
|
|
180
|
-
b1: {
|
|
181
|
-
id: "b1",
|
|
182
|
-
attributes: {
|
|
183
|
-
ipv4_wlan0: "192.168.10.141/24",
|
|
184
|
-
device_type: [deviceTypes.qemu]
|
|
185
|
-
},
|
|
186
|
-
system: {
|
|
187
|
-
check_in_time: checkInTimeRounded
|
|
188
|
-
},
|
|
189
|
-
check_in_time: checkInTimeExact,
|
|
190
|
-
check_in_time_exact: checkInTimeExact,
|
|
191
|
-
check_in_time_rounded: checkInTimeRounded,
|
|
192
|
-
identity_data: { mac: defaultMacAddress },
|
|
193
|
-
status: "accepted",
|
|
194
|
-
decommissioning: false,
|
|
195
|
-
created_ts: defaultCreationDate,
|
|
196
|
-
updated_ts: "2019-01-01T09:25:00.000Z",
|
|
197
|
-
auth_sets: [
|
|
198
|
-
{
|
|
199
|
-
id: "auth1",
|
|
200
|
-
identity_data: { mac: defaultMacAddress },
|
|
201
|
-
pubkey: "-----BEGIN PUBLIC KEY-----\nMIIBojWELzgJ62hcXIhAfqfoNiaB1326XZByZwcnHr5BuSPAgMBAAE=\n-----END PUBLIC KEY-----\n",
|
|
202
|
-
ts: defaultCreationDate,
|
|
203
|
-
status: "accepted"
|
|
204
|
-
}
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
groups: {
|
|
209
|
-
byId: {
|
|
210
|
-
testGroup: {
|
|
211
|
-
deviceIds: ["a1", "b1"],
|
|
212
|
-
filters: [],
|
|
213
|
-
total: 2
|
|
214
|
-
},
|
|
215
|
-
testGroupDynamic: {
|
|
216
|
-
id: "filter1",
|
|
217
|
-
name: "filter1",
|
|
218
|
-
filters: [{ scope: "system", key: "group", operator: "$eq", value: "things" }]
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
limits: { standard: 500, micro: 0, system: 0 },
|
|
223
|
-
byStatus: {
|
|
224
|
-
accepted: { deviceIds: ["a1", "b1"], total: 2 },
|
|
225
|
-
active: { deviceIds: [], total: 0 },
|
|
226
|
-
inactive: { deviceIds: [], total: 0 },
|
|
227
|
-
pending: { deviceIds: ["c1"], total: 1 },
|
|
228
|
-
preauthorized: { deviceIds: [], total: 0 },
|
|
229
|
-
rejected: { deviceIds: [], total: 0 }
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
organization: {
|
|
233
|
-
organization: {
|
|
234
|
-
id: "1",
|
|
235
|
-
addons: [],
|
|
236
|
-
name: "test",
|
|
237
|
-
plan: "os",
|
|
238
|
-
trial: false
|
|
239
|
-
},
|
|
240
|
-
products: [
|
|
241
|
-
{
|
|
242
|
-
name: "mender_standard",
|
|
243
|
-
billing_unit: "devices",
|
|
244
|
-
prices: [
|
|
245
|
-
{
|
|
246
|
-
plan: "os",
|
|
247
|
-
constraints: {
|
|
248
|
-
min: 50,
|
|
249
|
-
max: 1e3,
|
|
250
|
-
div: 50
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
plan: "professional",
|
|
255
|
-
constraints: {
|
|
256
|
-
min: 250,
|
|
257
|
-
max: 1e4,
|
|
258
|
-
div: 50
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
],
|
|
262
|
-
addons: [
|
|
263
|
-
{
|
|
264
|
-
name: "troubleshoot",
|
|
265
|
-
prices: [{ plan: "os" }, { plan: "professional" }]
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
name: "configure",
|
|
269
|
-
prices: [{ plan: "os" }, { plan: "professional" }]
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
name: "monitor",
|
|
273
|
-
prices: [{ plan: "professional" }]
|
|
274
|
-
}
|
|
275
|
-
]
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
name: "mender_micro",
|
|
279
|
-
billing_unit: "devices",
|
|
280
|
-
prices: [
|
|
281
|
-
{
|
|
282
|
-
plan: "os",
|
|
283
|
-
constraints: {
|
|
284
|
-
min: 50,
|
|
285
|
-
max: 5e3,
|
|
286
|
-
div: 50
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
plan: "professional",
|
|
291
|
-
constraints: {
|
|
292
|
-
min: 500,
|
|
293
|
-
max: 1e5,
|
|
294
|
-
div: 50
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
]
|
|
298
|
-
}
|
|
299
|
-
],
|
|
300
|
-
intentId: "testIntent",
|
|
301
|
-
auditlog: {
|
|
302
|
-
events: [
|
|
303
|
-
{
|
|
304
|
-
actor: {
|
|
305
|
-
id: "string",
|
|
306
|
-
type: "user",
|
|
307
|
-
email: "string@example.com"
|
|
308
|
-
},
|
|
309
|
-
time: "2019-01-01T12:10:22.667Z",
|
|
310
|
-
action: "create",
|
|
311
|
-
object: {
|
|
312
|
-
id: "string",
|
|
313
|
-
type: "user",
|
|
314
|
-
user: {
|
|
315
|
-
email: "user@acme.com"
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
change: "change1"
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
actor: {
|
|
322
|
-
id: "string",
|
|
323
|
-
type: "user",
|
|
324
|
-
email: "string",
|
|
325
|
-
identity_data: "string"
|
|
326
|
-
},
|
|
327
|
-
time: "2019-01-01T12:16:22.667Z",
|
|
328
|
-
action: "create",
|
|
329
|
-
object: {
|
|
330
|
-
id: "string",
|
|
331
|
-
type: "deployment",
|
|
332
|
-
deployment: {
|
|
333
|
-
name: "production",
|
|
334
|
-
artifact_name: "Application 0.0.1"
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
change: "change2"
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
actor: {
|
|
341
|
-
id: "string",
|
|
342
|
-
type: "user",
|
|
343
|
-
email: "string@example.com"
|
|
344
|
-
},
|
|
345
|
-
time: "2019-01-01T12:10:22.669Z",
|
|
346
|
-
action: "open_terminal",
|
|
347
|
-
meta: {
|
|
348
|
-
session_id: ["abd313a8-ee88-48ab-9c99-fbcd80048e6e"]
|
|
349
|
-
},
|
|
350
|
-
object: {
|
|
351
|
-
id: "a1",
|
|
352
|
-
type: "device"
|
|
353
|
-
},
|
|
354
|
-
change: "change3"
|
|
355
|
-
}
|
|
356
|
-
]
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
releases: {
|
|
360
|
-
byId: {
|
|
361
|
-
r1: {
|
|
362
|
-
name: "r1",
|
|
363
|
-
artifacts: [
|
|
364
|
-
{
|
|
365
|
-
id: "art1",
|
|
366
|
-
description: "test description",
|
|
367
|
-
device_types_compatible: [deviceTypes.qemu],
|
|
368
|
-
modified: "2020-09-10T12:16:22.667Z",
|
|
369
|
-
updates: [{ type_info: { type: "testtype" } }],
|
|
370
|
-
artifact_depends: {
|
|
371
|
-
device_type: [deviceTypes.qemu]
|
|
372
|
-
},
|
|
373
|
-
artifact_provides: {
|
|
374
|
-
artifact_name: "myapp",
|
|
375
|
-
"data-partition.myapp.version": "v2020.10",
|
|
376
|
-
list_of_fancy: [deviceTypes.qemu, "x172"]
|
|
377
|
-
},
|
|
378
|
-
clears_artifact_provides: ["data-partition.myapp.*"]
|
|
379
|
-
}
|
|
380
|
-
],
|
|
381
|
-
device_types_compatible: [deviceTypes.qemu],
|
|
382
|
-
modified: "2020-09-10T12:16:22.667Z",
|
|
383
|
-
metaData: {}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
users: {
|
|
388
|
-
byId: {
|
|
389
|
-
a1: defaultUser,
|
|
390
|
-
[userId]: { ...defaultUser, id: userId, email: "a2@b.com", created_ts: "2019-01-01T12:30:00.000Z" }
|
|
391
|
-
},
|
|
392
|
-
rolesById: {
|
|
393
|
-
admin: {
|
|
394
|
-
name: "admin",
|
|
395
|
-
description: "Administrator role",
|
|
396
|
-
permissions: []
|
|
397
|
-
},
|
|
398
|
-
test: { name: "test", description: "test description", permissions: [] }
|
|
399
|
-
},
|
|
400
|
-
globalSettings: {
|
|
401
|
-
"2fa": "enabled",
|
|
402
|
-
id_attribute: void 0,
|
|
403
|
-
previousFilters: []
|
|
404
|
-
},
|
|
405
|
-
userSettings: {
|
|
406
|
-
"2fa": "disabled",
|
|
407
|
-
columnSelection: [],
|
|
408
|
-
onboarding: { something: "here" },
|
|
409
|
-
tooltips: {},
|
|
410
|
-
previousFilters: []
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
var releasesList = Array.from({ length: 5e3 }, (x, i) => ({
|
|
415
|
-
artifacts: [
|
|
416
|
-
{
|
|
417
|
-
id: "art1",
|
|
418
|
-
description: "test description",
|
|
419
|
-
device_types_compatible: [deviceTypes.qemu],
|
|
420
|
-
modified: "2020-09-10T12:16:22.667Z",
|
|
421
|
-
updates: [{ type_info: { type: "testtype" } }],
|
|
422
|
-
artifact_depends: {
|
|
423
|
-
device_type: [deviceTypes.qemu]
|
|
424
|
-
},
|
|
425
|
-
artifact_provides: {
|
|
426
|
-
artifact_name: "myapp",
|
|
427
|
-
"data-partition.myapp.version": "v2020.10",
|
|
428
|
-
list_of_fancy: [deviceTypes.qemu, "x172"]
|
|
429
|
-
},
|
|
430
|
-
clears_artifact_provides: ["data-partition.myapp.*"]
|
|
431
|
-
}
|
|
432
|
-
],
|
|
433
|
-
device_types_compatible: [deviceTypes.qemu],
|
|
434
|
-
metaData: {},
|
|
435
|
-
name: `release-${i + 1}`,
|
|
436
|
-
modified: i
|
|
437
|
-
}));
|
|
438
|
-
var permissionSets = [
|
|
439
|
-
{
|
|
440
|
-
...import_constants.defaultPermissionSets.Basic,
|
|
441
|
-
object: permissionSetObjectTypes.empty,
|
|
442
|
-
description: "Set containing basic permissions.",
|
|
443
|
-
permissions: [
|
|
444
|
-
{ action: "http", object: { type: "any", value: "^/api/management/v1/useradm/settings$" } },
|
|
445
|
-
{ action: "http", object: { type: "any", value: "^/api/management/v1/useradm/users/me$" } },
|
|
446
|
-
{ action: "http", object: { type: "any", value: "^/api/management/1.0/auth/verify$" } },
|
|
447
|
-
{ action: "http", object: { type: "PUT", value: "^/api/management/v1/useradm/2faverify$" } },
|
|
448
|
-
{ action: "http", object: { type: "POST", value: "^/api/management/v1/useradm/users/me/2fa/(enable|disable)$" } },
|
|
449
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9])/useradm/roles" } },
|
|
450
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9])/tenantadm/user/tenant" } }
|
|
451
|
-
]
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
...import_constants.defaultPermissionSets.ManageReleases,
|
|
455
|
-
action: import_constants.uiPermissionsById.manage.title,
|
|
456
|
-
object: permissionSetObjectTypes.releases,
|
|
457
|
-
description: "Set of permissions which allows user to manage releases",
|
|
458
|
-
permissions: [
|
|
459
|
-
{ action: "http", object: { type: "GET", value: commonEndpoints.artifacts } },
|
|
460
|
-
{ action: "http", object: { type: "GET", value: commonEndpoints.artifactDetails } },
|
|
461
|
-
{ action: "http", object: { type: "PUT", value: commonEndpoints.artifactDetails } },
|
|
462
|
-
{ action: "http", object: { type: "DELETE", value: commonEndpoints.artifactDetails } },
|
|
463
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/v1/deployments/artifacts/[^/]+/download" } }
|
|
464
|
-
]
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
...import_constants.defaultPermissionSets.ReadUsers,
|
|
468
|
-
action: import_constants.uiPermissionsById.read.title,
|
|
469
|
-
object: permissionSetObjectTypes.userManagement,
|
|
470
|
-
description: "Set of permissions which allows user to view other users",
|
|
471
|
-
permissions: [{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9])/useradm/" } }]
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
...import_constants.defaultPermissionSets.ManageUsers,
|
|
475
|
-
action: import_constants.uiPermissionsById.manage.title,
|
|
476
|
-
object: permissionSetObjectTypes.userManagement,
|
|
477
|
-
description: "Set of permissions which allows user manage other user accounts",
|
|
478
|
-
permissions: [{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/useradm/" } }]
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
...import_constants.defaultPermissionSets.ReadTenants,
|
|
482
|
-
action: import_constants.uiPermissionsById.read.title,
|
|
483
|
-
object: permissionSetObjectTypes.tenantManagement,
|
|
484
|
-
description: "Set of permissions which allows user to list other tenants and their config",
|
|
485
|
-
permissions: [
|
|
486
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9])/tenantadm/" } },
|
|
487
|
-
{ action: "http", object: { type: "POST", value: "^/api/management/(v[1-9])/tenantadm/" } }
|
|
488
|
-
]
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
...import_constants.defaultPermissionSets.ManageTenants,
|
|
492
|
-
action: import_constants.uiPermissionsById.manage.title,
|
|
493
|
-
object: permissionSetObjectTypes.tenantManagement,
|
|
494
|
-
description: "Set of permissions which allows user to manage other tenants and their config",
|
|
495
|
-
permissions: [
|
|
496
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9])/tenantadm/" } },
|
|
497
|
-
{ action: "http", object: { type: "POST", value: "^/api/management/(v[1-9])/tenantadm/" } },
|
|
498
|
-
{ action: "http", object: { type: "PUT", value: "^/api/management/(v[1-9])/tenantadm/" } }
|
|
499
|
-
]
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
...import_constants.defaultPermissionSets.ReadAuditLogs,
|
|
503
|
-
action: import_constants.uiPermissionsById.read.title,
|
|
504
|
-
object: "System Audit Log",
|
|
505
|
-
description: "Set of permissions which allows user to view system audit log",
|
|
506
|
-
permissions: [{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9]|0.1.0)/auditlogs/logs" } }]
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
...import_constants.defaultPermissionSets.DeployToDevices,
|
|
510
|
-
action: "Deploy",
|
|
511
|
-
object: permissionSetObjectTypes.groups,
|
|
512
|
-
description: "Set of permissions which allows user to deploy to devices",
|
|
513
|
-
permissions: [{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/(deployments|deviceconfig)/" } }],
|
|
514
|
-
supported_scope_types: [import_constants.scopedPermissionAreas.groups.scopeType]
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
...import_constants.defaultPermissionSets.ConfigureDevices,
|
|
518
|
-
action: "Configure",
|
|
519
|
-
object: permissionSetObjectTypes.groups,
|
|
520
|
-
description: "Set of permissions which allows user to manage configuration of the devices",
|
|
521
|
-
permissions: [{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/deviceconfig/" } }],
|
|
522
|
-
supported_scope_types: [import_constants.scopedPermissionAreas.groups.scopeType]
|
|
523
|
-
},
|
|
524
|
-
{
|
|
525
|
-
...import_constants.defaultPermissionSets.ConnectToDevices,
|
|
526
|
-
action: "Connect",
|
|
527
|
-
object: permissionSetObjectTypes.groups,
|
|
528
|
-
description: "Set of permissions which allows user to use remote terminal and file transfer",
|
|
529
|
-
permissions: [
|
|
530
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9]|0.1.0)/deviceconnect/devices/[^/]+/connect$" } },
|
|
531
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9]|0.1.0)/deviceconnect/devices/[^/]+/download\\?path=[^&]+$" } },
|
|
532
|
-
{ action: "http", object: { type: "PUT", value: "^/api/management/(v[1-9]|0.1.0)/deviceconnect/devices/[^/]+/upload$" } }
|
|
533
|
-
],
|
|
534
|
-
supported_scope_types: [import_constants.scopedPermissionAreas.groups.scopeType]
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
...import_constants.defaultPermissionSets.SuperUser,
|
|
538
|
-
action: "Any",
|
|
539
|
-
object: permissionSetObjectTypes.any,
|
|
540
|
-
description: "Set of permissions which allows user to do anything",
|
|
541
|
-
permissions: [{ action: "any", object: { type: "any", value: "any" } }]
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
...import_constants.defaultPermissionSets.UploadArtifacts,
|
|
545
|
-
action: "Upload",
|
|
546
|
-
object: permissionSetObjectTypes.artifacts,
|
|
547
|
-
description: "Set of permissions which allows user to upload artifacts",
|
|
548
|
-
permissions: [
|
|
549
|
-
{ action: "http", object: { type: "POST", value: commonEndpoints.artifacts } },
|
|
550
|
-
{ action: "http", object: { type: "POST", value: "^/api/management/v1/deployments/artifacts/generate" } }
|
|
551
|
-
]
|
|
552
|
-
},
|
|
553
|
-
{
|
|
554
|
-
...import_constants.defaultPermissionSets.ReadDevices,
|
|
555
|
-
action: import_constants.uiPermissionsById.read.title,
|
|
556
|
-
object: permissionSetObjectTypes.groups,
|
|
557
|
-
description: "Set of permissions which allows user to view devices",
|
|
558
|
-
permissions: [
|
|
559
|
-
{ action: "http", object: { type: "POST", value: "^/api/management/v2/inventory/filters/search" } },
|
|
560
|
-
{ action: "http", object: { type: "POST", value: "^/api/management/v1/reporting/devices/search" } },
|
|
561
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9])/(deployments|devauth|inventory|deviceconfig|devicemonitor)/" } },
|
|
562
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/(v[1-9]|0.1.0)/deviceconnect/devices/[^/]+$" } }
|
|
563
|
-
],
|
|
564
|
-
supported_scope_types: [import_constants.scopedPermissionAreas.groups.scopeType]
|
|
565
|
-
},
|
|
566
|
-
{
|
|
567
|
-
...import_constants.defaultPermissionSets.ManageDevices,
|
|
568
|
-
action: import_constants.uiPermissionsById.manage.title,
|
|
569
|
-
object: permissionSetObjectTypes.groups,
|
|
570
|
-
description: "Set of permissions which allows user to manage devices",
|
|
571
|
-
permissions: [
|
|
572
|
-
{ action: "http", object: { type: "POST", value: commonEndpoints.deviceManagement } },
|
|
573
|
-
{ action: "http", object: { type: "PUT", value: commonEndpoints.deviceManagement } },
|
|
574
|
-
{ action: "http", object: { type: "DELETE", value: commonEndpoints.deviceManagement } }
|
|
575
|
-
],
|
|
576
|
-
supported_scope_types: [import_constants.scopedPermissionAreas.groups.scopeType]
|
|
577
|
-
},
|
|
578
|
-
{
|
|
579
|
-
...import_constants.defaultPermissionSets.ReadReleases,
|
|
580
|
-
action: import_constants.uiPermissionsById.read.title,
|
|
581
|
-
object: permissionSetObjectTypes.releases,
|
|
582
|
-
description: "Set of permissions which allows user to view releases",
|
|
583
|
-
permissions: [
|
|
584
|
-
{ action: "http", object: { type: "GET", value: commonEndpoints.artifacts } },
|
|
585
|
-
{ action: "http", object: { type: "GET", value: commonEndpoints.artifactDetails } },
|
|
586
|
-
{ action: "http", object: { type: "GET", value: "^/api/management/v1/deployments/artifacts/[^/]+/download" } }
|
|
587
|
-
]
|
|
588
|
-
},
|
|
589
|
-
{
|
|
590
|
-
name: "almostAdmin",
|
|
591
|
-
object: permissionSetObjectTypes.empty,
|
|
592
|
-
description: "Set containing all the permissions.",
|
|
593
|
-
permissions: [
|
|
594
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/auditlogs/.*" } },
|
|
595
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/deployments/.*" } },
|
|
596
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/deployments/config/.*" } },
|
|
597
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/deployments/deployments/.*" } },
|
|
598
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/deployments/deployments/releases/.*" } },
|
|
599
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/devauth/.*" } },
|
|
600
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/deviceconfig/.*" } },
|
|
601
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/deviceconnect/.*" } },
|
|
602
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/deviceconnect/devices" } },
|
|
603
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/inventory/.*" } },
|
|
604
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/iot-manager/.*" } },
|
|
605
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/monitor/.*" } },
|
|
606
|
-
{ action: "http", object: { type: "any", value: "^/api/management/(v[1-9])/useradm/.*" } }
|
|
607
|
-
]
|
|
608
|
-
}
|
|
609
|
-
];
|
|
610
|
-
var rbacRoles = [
|
|
611
|
-
{
|
|
612
|
-
name: "dyn",
|
|
613
|
-
description: "",
|
|
614
|
-
permissions: [
|
|
615
|
-
{ action: "CREATE_DEPLOYMENT", object: { type: "DEVICE_GROUP", value: "dyn" } },
|
|
616
|
-
{ action: "VIEW_DEVICE", object: { type: "DEVICE_GROUP", value: "dyn" } }
|
|
617
|
-
]
|
|
618
|
-
},
|
|
619
|
-
{ name: "asdasd", description: "123", permissions: [{ action: "http", object: { type: "any", value: "/api/management/v1/useradm/.*" } }] },
|
|
620
|
-
{
|
|
621
|
-
name: "141sasd",
|
|
622
|
-
description: "1313adg",
|
|
623
|
-
permission_sets_with_scope: [
|
|
624
|
-
{ ...import_constants.defaultPermissionSets.ReadDevices, scope: { type: import_constants.scopedPermissionAreas.groups.scopeType, value: ["bestgroup"] } },
|
|
625
|
-
{ ...import_constants.defaultPermissionSets.ConnectToDevices, scope: { type: import_constants.scopedPermissionAreas.groups.scopeType, value: ["bestgroup"] } },
|
|
626
|
-
{ ...import_constants.defaultPermissionSets.ManageUsers }
|
|
627
|
-
]
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
name: "kljlkk",
|
|
631
|
-
description: "lkl",
|
|
632
|
-
permission_sets_with_scope: [{ ...import_constants.defaultPermissionSets.ConnectToDevices, scope: { type: import_constants.scopedPermissionAreas.groups.scopeType, value: ["bestgroup"] } }]
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
name: "yyyyy",
|
|
636
|
-
description: "asd",
|
|
637
|
-
permission_sets_with_scope: [
|
|
638
|
-
{ ...import_constants.defaultPermissionSets.ManageDevices, scope: { type: import_constants.scopedPermissionAreas.groups.scopeType, value: ["dockerclient"] } },
|
|
639
|
-
{ ...import_constants.defaultPermissionSets.ManageReleases }
|
|
640
|
-
]
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
name: "RBAC_ROLE_DEPLOYMENTS_MANAGER",
|
|
644
|
-
description: "Intended for users responsible for managing deployments, this role can create and abort deployments",
|
|
645
|
-
permission_sets_with_scope: [{ ...import_constants.defaultPermissionSets.DeployToDevices }]
|
|
646
|
-
},
|
|
647
|
-
{
|
|
648
|
-
name: "RBAC_ROLE_REMOTE_TERMINAL",
|
|
649
|
-
description: `Intended for tech support accounts, this role can access the devices' Remote Terminal.`,
|
|
650
|
-
permission_sets_with_scope: [{ ...import_constants.defaultPermissionSets.ConnectToDevices }]
|
|
651
|
-
},
|
|
652
|
-
{ name: "RBAC_ROLE_PERMIT_ALL", description: "", permission_sets_with_scope: [{ ...import_constants.defaultPermissionSets.SuperUser }] },
|
|
653
|
-
{
|
|
654
|
-
name: "RBAC_ROLE_OBSERVER",
|
|
655
|
-
description: "Intended for team leaders or limited tech support accounts, this role can see all Devices, Artifacts and Deployment reports but not make any changes.",
|
|
656
|
-
permission_sets_with_scope: [{ ...import_constants.defaultPermissionSets.ReadReleases }, { ...import_constants.defaultPermissionSets.ReadDevices }]
|
|
657
|
-
},
|
|
658
|
-
{
|
|
659
|
-
name: "RBAC_ROLE_CI",
|
|
660
|
-
description: "Intended for automation accounts building software (e.g. CI/CD systems), this role can only manage Artifacts, including upload new Artifacts and delete Artifacts. It does not have access to Devices or Deployments.",
|
|
661
|
-
permission_sets_with_scope: [
|
|
662
|
-
{ ...import_constants.defaultPermissionSets.ReadReleases },
|
|
663
|
-
{ ...import_constants.defaultPermissionSets.ManageReleases },
|
|
664
|
-
{ ...import_constants.defaultPermissionSets.UploadArtifacts }
|
|
665
|
-
]
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
name: "almostAdmin",
|
|
669
|
-
description: "almost admin rights",
|
|
670
|
-
permissions: permissionSets.find((item) => item.name === "almostAdmin")?.permissions
|
|
671
|
-
},
|
|
672
|
-
{
|
|
673
|
-
name: "almostAdminNew",
|
|
674
|
-
description: "almost admin rights",
|
|
675
|
-
permission_sets_with_scope: Object.values(import_constants.defaultPermissionSets)
|
|
676
|
-
}
|
|
677
|
-
];
|
|
678
|
-
var expectedParsedRoles = {
|
|
679
|
-
"141sasd": {
|
|
680
|
-
editable: true,
|
|
681
|
-
isCustom: void 0,
|
|
682
|
-
uiPermissions: {
|
|
683
|
-
...import_constants.emptyUiPermissions,
|
|
684
|
-
groups: { bestgroup: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.connect.value] },
|
|
685
|
-
userManagement: [import_constants.uiPermissionsById.manage.value]
|
|
686
|
-
}
|
|
687
|
-
},
|
|
688
|
-
asdasd: {
|
|
689
|
-
editable: false,
|
|
690
|
-
isCustom: true,
|
|
691
|
-
uiPermissions: { ...import_constants.emptyUiPermissions, userManagement: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.manage.value] }
|
|
692
|
-
},
|
|
693
|
-
dyn: {
|
|
694
|
-
editable: false,
|
|
695
|
-
isCustom: true,
|
|
696
|
-
uiPermissions: {
|
|
697
|
-
...import_constants.emptyUiPermissions,
|
|
698
|
-
deployments: [import_constants.uiPermissionsById.deploy.value],
|
|
699
|
-
groups: { dyn: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.deploy.value] }
|
|
700
|
-
}
|
|
701
|
-
},
|
|
702
|
-
kljlkk: {
|
|
703
|
-
editable: true,
|
|
704
|
-
isCustom: false,
|
|
705
|
-
uiPermissions: { ...import_constants.emptyUiPermissions, groups: { bestgroup: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.connect.value] } }
|
|
706
|
-
},
|
|
707
|
-
yyyyy: {
|
|
708
|
-
editable: true,
|
|
709
|
-
isCustom: void 0,
|
|
710
|
-
uiPermissions: {
|
|
711
|
-
...import_constants.emptyUiPermissions,
|
|
712
|
-
groups: { dockerclient: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.manage.value] },
|
|
713
|
-
releases: { [import_constants.ALL_RELEASES]: [import_constants.uiPermissionsById.manage.value] }
|
|
714
|
-
}
|
|
715
|
-
},
|
|
716
|
-
almostAdmin: {
|
|
717
|
-
editable: false,
|
|
718
|
-
isCustom: true,
|
|
719
|
-
uiPermissions: {
|
|
720
|
-
...import_constants.emptyUiPermissions,
|
|
721
|
-
auditlog: [import_constants.uiPermissionsById.read.value],
|
|
722
|
-
deployments: [import_constants.uiPermissionsById.manage.value, import_constants.uiPermissionsById.deploy.value, import_constants.uiPermissionsById.read.value],
|
|
723
|
-
groups: {
|
|
724
|
-
[import_constants.ALL_DEVICES]: [
|
|
725
|
-
import_constants.uiPermissionsById.read.value,
|
|
726
|
-
// we can't assign deployment permissions to devices here, since the old path based rbac controls don't allow the scoped permissions
|
|
727
|
-
// uiPermissionsById.deploy.value,
|
|
728
|
-
import_constants.uiPermissionsById.manage.value,
|
|
729
|
-
import_constants.uiPermissionsById.connect.value,
|
|
730
|
-
import_constants.uiPermissionsById.configure.value
|
|
731
|
-
]
|
|
732
|
-
},
|
|
733
|
-
releases: {
|
|
734
|
-
[import_constants.ALL_RELEASES]: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.upload.value, import_constants.uiPermissionsById.manage.value]
|
|
735
|
-
},
|
|
736
|
-
userManagement: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.manage.value]
|
|
737
|
-
}
|
|
738
|
-
},
|
|
739
|
-
almostAdminNew: {
|
|
740
|
-
editable: true,
|
|
741
|
-
isCustom: void 0,
|
|
742
|
-
uiPermissions: {
|
|
743
|
-
...import_constants.emptyUiPermissions,
|
|
744
|
-
auditlog: [import_constants.uiPermissionsById.read.value],
|
|
745
|
-
deployments: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.deploy.value, import_constants.uiPermissionsById.manage.value],
|
|
746
|
-
groups: {
|
|
747
|
-
[import_constants.ALL_DEVICES]: [
|
|
748
|
-
import_constants.uiPermissionsById.read.value,
|
|
749
|
-
import_constants.uiPermissionsById.manage.value,
|
|
750
|
-
import_constants.uiPermissionsById.deploy.value,
|
|
751
|
-
import_constants.uiPermissionsById.connect.value,
|
|
752
|
-
import_constants.uiPermissionsById.configure.value
|
|
753
|
-
]
|
|
754
|
-
},
|
|
755
|
-
releases: {
|
|
756
|
-
[import_constants.ALL_RELEASES]: [import_constants.uiPermissionsById.manage.value, import_constants.uiPermissionsById.upload.value, import_constants.uiPermissionsById.read.value]
|
|
757
|
-
},
|
|
758
|
-
tenantManagement: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.manage.value],
|
|
759
|
-
userManagement: [import_constants.uiPermissionsById.read.value, import_constants.uiPermissionsById.manage.value]
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
var defaultRolesById = {
|
|
764
|
-
...import_constants.rolesById,
|
|
765
|
-
test: {
|
|
766
|
-
...import_constants.emptyRole,
|
|
767
|
-
name: "test",
|
|
768
|
-
description: "test description",
|
|
769
|
-
editable: true,
|
|
770
|
-
uiPermissions: {
|
|
771
|
-
...import_constants.emptyUiPermissions,
|
|
772
|
-
groups: { testGroup: [import_constants.uiPermissionsById.read.value] },
|
|
773
|
-
releases: { bar: [import_constants.uiPermissionsById.read.value] }
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
};
|
|
777
|
-
var receivedRoles = rbacRoles.reduce(
|
|
778
|
-
(accu, role) => {
|
|
779
|
-
const { name, description, ...roleRemainder } = role;
|
|
780
|
-
if (name.startsWith("RBAC")) {
|
|
781
|
-
accu[name] = {
|
|
782
|
-
...defaultRolesById[name],
|
|
783
|
-
...roleRemainder,
|
|
784
|
-
editable: false,
|
|
785
|
-
isCustom: false,
|
|
786
|
-
description: defaultRolesById[name].description ? defaultRolesById[name].description : description
|
|
787
|
-
};
|
|
788
|
-
} else {
|
|
789
|
-
const result = expectedParsedRoles[name] ?? {};
|
|
790
|
-
accu[name] = {
|
|
791
|
-
...import_constants.emptyRole,
|
|
792
|
-
...role,
|
|
793
|
-
...result,
|
|
794
|
-
name
|
|
795
|
-
};
|
|
796
|
-
}
|
|
797
|
-
return accu;
|
|
798
|
-
},
|
|
799
|
-
{ ...defaultRolesById }
|
|
800
|
-
);
|
|
801
|
-
var receivedPermissionSets = permissionSets.reduce((accu, set) => {
|
|
802
|
-
const result = import_constants.defaultPermissionSets[set.name]?.result ?? {};
|
|
803
|
-
accu[set.name] = {
|
|
804
|
-
...set,
|
|
805
|
-
result: {
|
|
806
|
-
...import_constants.emptyUiPermissions,
|
|
807
|
-
...result
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
|
-
return accu;
|
|
811
|
-
}, {});
|
|
812
|
-
|
|
813
|
-
// src/requestHandlers/monitorHandlers.ts
|
|
814
|
-
var monitorHandlers = [
|
|
815
|
-
import_msw.http.get(`${import_constants2.monitorApiUrlv1}/devices/:id/alerts`, () => new import_msw.HttpResponse(JSON.stringify([]), { headers: { [import_constants2.headerNames.total]: 1 } })),
|
|
816
|
-
import_msw.http.get(`${import_constants2.monitorApiUrlv1}/devices/:id/alerts/latest`, () => import_msw.HttpResponse.json([])),
|
|
817
|
-
import_msw.http.get(`${import_constants2.monitorApiUrlv1}/devices/:id/config`, ({ params: { id } }) => {
|
|
818
|
-
if (id === mockApiResponses.devices.byId.a1.id) {
|
|
819
|
-
return import_msw.HttpResponse.json([{ something: "here" }]);
|
|
820
|
-
}
|
|
821
|
-
return import_msw.HttpResponse.json([]);
|
|
822
|
-
}),
|
|
823
|
-
import_msw.http.put(`${import_constants2.monitorApiUrlv1}/settings/global/channel/alerts/:channel/status`, async ({ params: { channel }, request }) => {
|
|
824
|
-
const { enabled } = await request.json();
|
|
825
|
-
if (Object.keys(import_constants2.alertChannels).includes(channel) && enabled !== void 0) {
|
|
826
|
-
return new import_msw.HttpResponse(null, { status: 200 });
|
|
827
|
-
}
|
|
828
|
-
return new import_msw.HttpResponse(null, { status: 590 });
|
|
829
|
-
})
|
|
830
|
-
];
|
|
831
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
832
|
-
0 && (module.exports = {
|
|
833
|
-
monitorHandlers
|
|
834
|
-
});
|
|
835
|
-
//# sourceMappingURL=monitorHandlers.cjs.map
|