@iblai/data-layer 1.6.3 → 1.7.2
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 +1317 -1309
- package/dist/index.esm.js +118 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +118 -9
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/chat/api-slice.d.ts +25 -16
- package/dist/src/features/core/api-slice.d.ts +110 -109
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39470,7 +39470,19 @@ const chatApiSlice = react.createApi({
|
|
|
39470
39470
|
providesTags: ['pinnedMessages'],
|
|
39471
39471
|
}),
|
|
39472
39472
|
unPinMessage: builder.mutation({
|
|
39473
|
-
|
|
39473
|
+
// The generated `aiMentorOrgsUsersPinMessageDestroy` only sends org/user
|
|
39474
|
+
// path params and omits the body, but the DELETE pin-message endpoint
|
|
39475
|
+
// needs `{ session_id }` to know which pinned message to remove.
|
|
39476
|
+
queryFn: async (args, api, extraOptions) => {
|
|
39477
|
+
const url = `/api/ai-mentor/orgs/${args.org}/users/${args.userId}/pin-message/`;
|
|
39478
|
+
return iblFetchBaseQuery({
|
|
39479
|
+
url,
|
|
39480
|
+
method: 'DELETE',
|
|
39481
|
+
body: args.requestBody,
|
|
39482
|
+
service: exports.SERVICES.DM,
|
|
39483
|
+
}, api, extraOptions);
|
|
39484
|
+
},
|
|
39485
|
+
invalidatesTags: ['pinnedMessages'],
|
|
39474
39486
|
}),
|
|
39475
39487
|
addPinnedMessage: builder.mutation({
|
|
39476
39488
|
...buildEndpointFromDmService(AiMentorService.aiMentorOrgsUsersPinMessageCreate),
|
|
@@ -40450,30 +40462,127 @@ const coreApiSlice = react.createApi({
|
|
|
40450
40462
|
}),
|
|
40451
40463
|
//RBAC ROLES
|
|
40452
40464
|
getRbacRoles: builder.query({
|
|
40453
|
-
...
|
|
40465
|
+
...buildEndpointFromService(exports.SERVICES.DM, async (args) => {
|
|
40466
|
+
const queryParams = new URLSearchParams({ include_global_roles: 'true' });
|
|
40467
|
+
if (args.platformKey)
|
|
40468
|
+
queryParams.set('platform_key', args.platformKey);
|
|
40469
|
+
if (args.name)
|
|
40470
|
+
queryParams.set('name', args.name);
|
|
40471
|
+
if (args.page !== undefined)
|
|
40472
|
+
queryParams.set('page', String(args.page));
|
|
40473
|
+
if (args.pageSize !== undefined)
|
|
40474
|
+
queryParams.set('page_size', String(args.pageSize));
|
|
40475
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/?${queryParams.toString()}`;
|
|
40476
|
+
const response = await fetch(url, {
|
|
40477
|
+
method: 'GET',
|
|
40478
|
+
headers: OpenAPI.HEADERS,
|
|
40479
|
+
credentials: 'omit',
|
|
40480
|
+
});
|
|
40481
|
+
if (!response.ok) {
|
|
40482
|
+
throw Object.assign(new Error('Failed to fetch RBAC roles'), {
|
|
40483
|
+
status: response.status,
|
|
40484
|
+
body: await response.text(),
|
|
40485
|
+
});
|
|
40486
|
+
}
|
|
40487
|
+
return response.json();
|
|
40488
|
+
}),
|
|
40454
40489
|
providesTags: ['RbacRoles'],
|
|
40455
40490
|
}),
|
|
40456
40491
|
createRbacRole: builder.mutation({
|
|
40457
|
-
...
|
|
40492
|
+
...buildEndpointFromService(exports.SERVICES.DM, async (args) => {
|
|
40493
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/?include_global_roles=true`;
|
|
40494
|
+
const response = await fetch(url, {
|
|
40495
|
+
method: 'POST',
|
|
40496
|
+
headers: {
|
|
40497
|
+
...OpenAPI.HEADERS,
|
|
40498
|
+
'Content-Type': 'application/json',
|
|
40499
|
+
},
|
|
40500
|
+
credentials: 'omit',
|
|
40501
|
+
body: JSON.stringify(args.requestBody),
|
|
40502
|
+
});
|
|
40503
|
+
if (!response.ok) {
|
|
40504
|
+
throw Object.assign(new Error('Failed to create RBAC role'), {
|
|
40505
|
+
status: response.status,
|
|
40506
|
+
body: await response.text(),
|
|
40507
|
+
});
|
|
40508
|
+
}
|
|
40509
|
+
return response.json();
|
|
40510
|
+
}),
|
|
40458
40511
|
invalidatesTags: ['RbacRoles'],
|
|
40459
40512
|
}),
|
|
40460
40513
|
updateRbacRole: builder.mutation({
|
|
40461
|
-
...
|
|
40514
|
+
...buildEndpointFromService(exports.SERVICES.DM, async (args) => {
|
|
40515
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/${args.id}/?include_global_roles=true`;
|
|
40516
|
+
const response = await fetch(url, {
|
|
40517
|
+
method: 'PUT',
|
|
40518
|
+
headers: {
|
|
40519
|
+
...OpenAPI.HEADERS,
|
|
40520
|
+
'Content-Type': 'application/json',
|
|
40521
|
+
},
|
|
40522
|
+
credentials: 'omit',
|
|
40523
|
+
body: JSON.stringify(args.requestBody),
|
|
40524
|
+
});
|
|
40525
|
+
if (!response.ok) {
|
|
40526
|
+
throw Object.assign(new Error('Failed to update RBAC role'), {
|
|
40527
|
+
status: response.status,
|
|
40528
|
+
body: await response.text(),
|
|
40529
|
+
});
|
|
40530
|
+
}
|
|
40531
|
+
return response.json();
|
|
40532
|
+
}),
|
|
40462
40533
|
invalidatesTags: ['RbacRoles'],
|
|
40463
40534
|
}),
|
|
40464
40535
|
partialUpdateRbacRole: builder.mutation({
|
|
40465
|
-
...
|
|
40536
|
+
...buildEndpointFromService(exports.SERVICES.DM, async (args) => {
|
|
40537
|
+
var _a;
|
|
40538
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/${args.id}/?include_global_roles=true`;
|
|
40539
|
+
const response = await fetch(url, {
|
|
40540
|
+
method: 'PATCH',
|
|
40541
|
+
headers: {
|
|
40542
|
+
...OpenAPI.HEADERS,
|
|
40543
|
+
'Content-Type': 'application/json',
|
|
40544
|
+
},
|
|
40545
|
+
credentials: 'omit',
|
|
40546
|
+
body: JSON.stringify((_a = args.requestBody) !== null && _a !== void 0 ? _a : {}),
|
|
40547
|
+
});
|
|
40548
|
+
if (!response.ok) {
|
|
40549
|
+
throw Object.assign(new Error('Failed to partially update RBAC role'), {
|
|
40550
|
+
status: response.status,
|
|
40551
|
+
body: await response.text(),
|
|
40552
|
+
});
|
|
40553
|
+
}
|
|
40554
|
+
return response.json();
|
|
40555
|
+
}),
|
|
40466
40556
|
invalidatesTags: ['RbacRoles'],
|
|
40467
40557
|
}),
|
|
40468
40558
|
deleteRbacRole: builder.mutation({
|
|
40469
|
-
...
|
|
40559
|
+
...buildEndpointFromService(exports.SERVICES.DM, async (args) => {
|
|
40560
|
+
const queryParams = new URLSearchParams({
|
|
40561
|
+
include_global_roles: 'true',
|
|
40562
|
+
platform_key: args.platformKey,
|
|
40563
|
+
});
|
|
40564
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/${args.id}/?${queryParams.toString()}`;
|
|
40565
|
+
const response = await fetch(url, {
|
|
40566
|
+
method: 'DELETE',
|
|
40567
|
+
headers: OpenAPI.HEADERS,
|
|
40568
|
+
credentials: 'omit',
|
|
40569
|
+
});
|
|
40570
|
+
if (!response.ok) {
|
|
40571
|
+
throw Object.assign(new Error('Failed to delete RBAC role'), {
|
|
40572
|
+
status: response.status,
|
|
40573
|
+
body: await response.text(),
|
|
40574
|
+
});
|
|
40575
|
+
}
|
|
40576
|
+
}),
|
|
40470
40577
|
invalidatesTags: ['RbacRoles'],
|
|
40471
40578
|
}),
|
|
40472
40579
|
getRbacRoleDetails: builder.query({
|
|
40473
40580
|
...buildEndpointFromService(exports.SERVICES.DM, async (args) => {
|
|
40474
|
-
const queryParams = new URLSearchParams({
|
|
40475
|
-
|
|
40476
|
-
|
|
40581
|
+
const queryParams = new URLSearchParams({
|
|
40582
|
+
include_global_roles: 'true',
|
|
40583
|
+
platform_key: args.platform_key,
|
|
40584
|
+
});
|
|
40585
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/roles/${args.id}/?${queryParams.toString()}`;
|
|
40477
40586
|
const response = await fetch(url, {
|
|
40478
40587
|
method: 'GET',
|
|
40479
40588
|
headers: OpenAPI.HEADERS,
|