@iblai/data-layer 1.6.3 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +110 -110
- package/dist/index.esm.js +105 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +105 -8
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/core/api-slice.d.ts +110 -109
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -40448,30 +40448,127 @@ const coreApiSlice = createApi({
|
|
|
40448
40448
|
}),
|
|
40449
40449
|
//RBAC ROLES
|
|
40450
40450
|
getRbacRoles: builder.query({
|
|
40451
|
-
...
|
|
40451
|
+
...buildEndpointFromService(SERVICES.DM, async (args) => {
|
|
40452
|
+
const queryParams = new URLSearchParams({ include_global_roles: 'true' });
|
|
40453
|
+
if (args.platformKey)
|
|
40454
|
+
queryParams.set('platform_key', args.platformKey);
|
|
40455
|
+
if (args.name)
|
|
40456
|
+
queryParams.set('name', args.name);
|
|
40457
|
+
if (args.page !== undefined)
|
|
40458
|
+
queryParams.set('page', String(args.page));
|
|
40459
|
+
if (args.pageSize !== undefined)
|
|
40460
|
+
queryParams.set('page_size', String(args.pageSize));
|
|
40461
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/?${queryParams.toString()}`;
|
|
40462
|
+
const response = await fetch(url, {
|
|
40463
|
+
method: 'GET',
|
|
40464
|
+
headers: OpenAPI.HEADERS,
|
|
40465
|
+
credentials: 'omit',
|
|
40466
|
+
});
|
|
40467
|
+
if (!response.ok) {
|
|
40468
|
+
throw Object.assign(new Error('Failed to fetch RBAC roles'), {
|
|
40469
|
+
status: response.status,
|
|
40470
|
+
body: await response.text(),
|
|
40471
|
+
});
|
|
40472
|
+
}
|
|
40473
|
+
return response.json();
|
|
40474
|
+
}),
|
|
40452
40475
|
providesTags: ['RbacRoles'],
|
|
40453
40476
|
}),
|
|
40454
40477
|
createRbacRole: builder.mutation({
|
|
40455
|
-
...
|
|
40478
|
+
...buildEndpointFromService(SERVICES.DM, async (args) => {
|
|
40479
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/?include_global_roles=true`;
|
|
40480
|
+
const response = await fetch(url, {
|
|
40481
|
+
method: 'POST',
|
|
40482
|
+
headers: {
|
|
40483
|
+
...OpenAPI.HEADERS,
|
|
40484
|
+
'Content-Type': 'application/json',
|
|
40485
|
+
},
|
|
40486
|
+
credentials: 'omit',
|
|
40487
|
+
body: JSON.stringify(args.requestBody),
|
|
40488
|
+
});
|
|
40489
|
+
if (!response.ok) {
|
|
40490
|
+
throw Object.assign(new Error('Failed to create RBAC role'), {
|
|
40491
|
+
status: response.status,
|
|
40492
|
+
body: await response.text(),
|
|
40493
|
+
});
|
|
40494
|
+
}
|
|
40495
|
+
return response.json();
|
|
40496
|
+
}),
|
|
40456
40497
|
invalidatesTags: ['RbacRoles'],
|
|
40457
40498
|
}),
|
|
40458
40499
|
updateRbacRole: builder.mutation({
|
|
40459
|
-
...
|
|
40500
|
+
...buildEndpointFromService(SERVICES.DM, async (args) => {
|
|
40501
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/${args.id}/?include_global_roles=true`;
|
|
40502
|
+
const response = await fetch(url, {
|
|
40503
|
+
method: 'PUT',
|
|
40504
|
+
headers: {
|
|
40505
|
+
...OpenAPI.HEADERS,
|
|
40506
|
+
'Content-Type': 'application/json',
|
|
40507
|
+
},
|
|
40508
|
+
credentials: 'omit',
|
|
40509
|
+
body: JSON.stringify(args.requestBody),
|
|
40510
|
+
});
|
|
40511
|
+
if (!response.ok) {
|
|
40512
|
+
throw Object.assign(new Error('Failed to update RBAC role'), {
|
|
40513
|
+
status: response.status,
|
|
40514
|
+
body: await response.text(),
|
|
40515
|
+
});
|
|
40516
|
+
}
|
|
40517
|
+
return response.json();
|
|
40518
|
+
}),
|
|
40460
40519
|
invalidatesTags: ['RbacRoles'],
|
|
40461
40520
|
}),
|
|
40462
40521
|
partialUpdateRbacRole: builder.mutation({
|
|
40463
|
-
...
|
|
40522
|
+
...buildEndpointFromService(SERVICES.DM, async (args) => {
|
|
40523
|
+
var _a;
|
|
40524
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/${args.id}/?include_global_roles=true`;
|
|
40525
|
+
const response = await fetch(url, {
|
|
40526
|
+
method: 'PATCH',
|
|
40527
|
+
headers: {
|
|
40528
|
+
...OpenAPI.HEADERS,
|
|
40529
|
+
'Content-Type': 'application/json',
|
|
40530
|
+
},
|
|
40531
|
+
credentials: 'omit',
|
|
40532
|
+
body: JSON.stringify((_a = args.requestBody) !== null && _a !== void 0 ? _a : {}),
|
|
40533
|
+
});
|
|
40534
|
+
if (!response.ok) {
|
|
40535
|
+
throw Object.assign(new Error('Failed to partially update RBAC role'), {
|
|
40536
|
+
status: response.status,
|
|
40537
|
+
body: await response.text(),
|
|
40538
|
+
});
|
|
40539
|
+
}
|
|
40540
|
+
return response.json();
|
|
40541
|
+
}),
|
|
40464
40542
|
invalidatesTags: ['RbacRoles'],
|
|
40465
40543
|
}),
|
|
40466
40544
|
deleteRbacRole: builder.mutation({
|
|
40467
|
-
...
|
|
40545
|
+
...buildEndpointFromService(SERVICES.DM, async (args) => {
|
|
40546
|
+
const queryParams = new URLSearchParams({
|
|
40547
|
+
include_global_roles: 'true',
|
|
40548
|
+
platform_key: args.platformKey,
|
|
40549
|
+
});
|
|
40550
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/${args.id}/?${queryParams.toString()}`;
|
|
40551
|
+
const response = await fetch(url, {
|
|
40552
|
+
method: 'DELETE',
|
|
40553
|
+
headers: OpenAPI.HEADERS,
|
|
40554
|
+
credentials: 'omit',
|
|
40555
|
+
});
|
|
40556
|
+
if (!response.ok) {
|
|
40557
|
+
throw Object.assign(new Error('Failed to delete RBAC role'), {
|
|
40558
|
+
status: response.status,
|
|
40559
|
+
body: await response.text(),
|
|
40560
|
+
});
|
|
40561
|
+
}
|
|
40562
|
+
}),
|
|
40468
40563
|
invalidatesTags: ['RbacRoles'],
|
|
40469
40564
|
}),
|
|
40470
40565
|
getRbacRoleDetails: builder.query({
|
|
40471
40566
|
...buildEndpointFromService(SERVICES.DM, async (args) => {
|
|
40472
|
-
const queryParams = new URLSearchParams({
|
|
40473
|
-
|
|
40474
|
-
|
|
40567
|
+
const queryParams = new URLSearchParams({
|
|
40568
|
+
include_global_roles: 'true',
|
|
40569
|
+
platform_key: args.platform_key,
|
|
40570
|
+
});
|
|
40571
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/${args.id}/?${queryParams.toString()}`;
|
|
40475
40572
|
const response = await fetch(url, {
|
|
40476
40573
|
method: 'GET',
|
|
40477
40574
|
headers: OpenAPI.HEADERS,
|