@iblai/iblai-api 4.39.0-core → 4.39.0-test-core
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.cjs.js +95 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +95 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +95 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/MentorPolicy.d.ts +47 -0
- package/dist/types/models/PatchedRbacGroup.d.ts +1 -0
- package/dist/types/models/RbacGroup.d.ts +1 -0
- package/dist/types/models/UserGroupAccess.d.ts +34 -0
- package/dist/types/models/UserGroupAccessInfo.d.ts +21 -0
- package/dist/types/services/CoreService.d.ts +64 -8
- package/package.json +1 -1
- package/sdk_schema.yml +317 -0
- package/src/index.ts +3 -0
- package/src/models/MentorPolicy.ts +52 -0
- package/src/models/PatchedRbacGroup.ts +1 -0
- package/src/models/RbacGroup.ts +1 -0
- package/src/models/UserGroupAccess.ts +39 -0
- package/src/models/UserGroupAccessInfo.ts +26 -0
- package/src/services/CoreService.ts +129 -8
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { RbacPolicyGroup } from './RbacPolicyGroup';
|
|
6
|
+
import type { RbacUser } from './RbacUser';
|
|
7
|
+
/**
|
|
8
|
+
* Serializer for mentor-specific RBAC policies using ModelSerializer pattern.
|
|
9
|
+
* Accepts mentor_id and role, generates resources and role internally.
|
|
10
|
+
*/
|
|
11
|
+
export type MentorPolicy = {
|
|
12
|
+
readonly id: number;
|
|
13
|
+
/**
|
|
14
|
+
* Policy name. If not supplied, defaults to a UUID4
|
|
15
|
+
*/
|
|
16
|
+
readonly name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Platform key where the mentor belongs
|
|
19
|
+
*/
|
|
20
|
+
platform_key: string;
|
|
21
|
+
/**
|
|
22
|
+
* ID of the mentor to manage access for
|
|
23
|
+
*/
|
|
24
|
+
mentor_id: number;
|
|
25
|
+
/**
|
|
26
|
+
* Role for accessing this mentor (viewer or editor)
|
|
27
|
+
*/
|
|
28
|
+
role: string;
|
|
29
|
+
/**
|
|
30
|
+
* List of resources this policy applies to
|
|
31
|
+
*/
|
|
32
|
+
readonly resources: any;
|
|
33
|
+
readonly users: Array<RbacUser>;
|
|
34
|
+
readonly groups: Array<RbacPolicyGroup>;
|
|
35
|
+
/**
|
|
36
|
+
* List of group IDs to grant access to this mentor
|
|
37
|
+
*/
|
|
38
|
+
groups_to_add?: Array<number>;
|
|
39
|
+
/**
|
|
40
|
+
* List of group IDs to revoke access from this mentor
|
|
41
|
+
*/
|
|
42
|
+
groups_to_remove?: Array<number>;
|
|
43
|
+
/**
|
|
44
|
+
* List of user IDs to grant access to this mentor
|
|
45
|
+
*/
|
|
46
|
+
users_to_add?: Array<number>;
|
|
47
|
+
/**
|
|
48
|
+
* List of user IDs to revoke access from this mentor
|
|
49
|
+
*/
|
|
50
|
+
users_to_remove?: Array<number>;
|
|
51
|
+
};
|
|
52
|
+
|
package/src/models/RbacGroup.ts
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { UserGroupAccessInfo } from './UserGroupAccessInfo';
|
|
6
|
+
/**
|
|
7
|
+
* ModelSerializer for user group access policies
|
|
8
|
+
*/
|
|
9
|
+
export type UserGroupAccess = {
|
|
10
|
+
/**
|
|
11
|
+
* Platform key where the groups exist
|
|
12
|
+
*/
|
|
13
|
+
platform_key: string;
|
|
14
|
+
/**
|
|
15
|
+
* ID of the user to manage group access for
|
|
16
|
+
*/
|
|
17
|
+
user_id: number;
|
|
18
|
+
/**
|
|
19
|
+
* List of group IDs to grant access to
|
|
20
|
+
*/
|
|
21
|
+
groups_to_add?: Array<number>;
|
|
22
|
+
/**
|
|
23
|
+
* List of group IDs to revoke access from
|
|
24
|
+
*/
|
|
25
|
+
groups_to_remove?: Array<number>;
|
|
26
|
+
/**
|
|
27
|
+
* Policy ID
|
|
28
|
+
*/
|
|
29
|
+
readonly policy_id: number;
|
|
30
|
+
/**
|
|
31
|
+
* Policy name
|
|
32
|
+
*/
|
|
33
|
+
readonly policy_name: string;
|
|
34
|
+
/**
|
|
35
|
+
* Groups with access
|
|
36
|
+
*/
|
|
37
|
+
readonly groups_with_access: Array<UserGroupAccessInfo>;
|
|
38
|
+
};
|
|
39
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Serializer for group access information in responses
|
|
7
|
+
*/
|
|
8
|
+
export type UserGroupAccessInfo = {
|
|
9
|
+
/**
|
|
10
|
+
* Group ID
|
|
11
|
+
*/
|
|
12
|
+
id: number;
|
|
13
|
+
/**
|
|
14
|
+
* Group name
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Group description
|
|
19
|
+
*/
|
|
20
|
+
description: string;
|
|
21
|
+
/**
|
|
22
|
+
* List of permissions user has for this group (e.g., ['read', 'manageMentors'])
|
|
23
|
+
*/
|
|
24
|
+
permissions: Array<string>;
|
|
25
|
+
};
|
|
26
|
+
|
|
@@ -11,6 +11,7 @@ import type { LauncherViewPostRequest } from '../models/LauncherViewPostRequest'
|
|
|
11
11
|
import type { LtiKey } from '../models/LtiKey';
|
|
12
12
|
import type { LtiMentor } from '../models/LtiMentor';
|
|
13
13
|
import type { LtiTool } from '../models/LtiTool';
|
|
14
|
+
import type { MentorPolicy } from '../models/MentorPolicy';
|
|
14
15
|
import type { PaginatedRbacGroupList } from '../models/PaginatedRbacGroupList';
|
|
15
16
|
import type { PaginatedRbacPolicyList } from '../models/PaginatedRbacPolicyList';
|
|
16
17
|
import type { PaginatedRbacRoleList } from '../models/PaginatedRbacRoleList';
|
|
@@ -42,6 +43,7 @@ import type { TokenProxyInput } from '../models/TokenProxyInput';
|
|
|
42
43
|
import type { TokenProxyOutput } from '../models/TokenProxyOutput';
|
|
43
44
|
import type { UserDeleteAPIRequest } from '../models/UserDeleteAPIRequest';
|
|
44
45
|
import type { UserDeleteAPIResponse } from '../models/UserDeleteAPIResponse';
|
|
46
|
+
import type { UserGroupAccess } from '../models/UserGroupAccess';
|
|
45
47
|
import type { UserPlatformLink } from '../models/UserPlatformLink';
|
|
46
48
|
import type { UserPlatformManagementListViewGetResponse } from '../models/UserPlatformManagementListViewGetResponse';
|
|
47
49
|
import type { UserPlatformSelfLinkRequest } from '../models/UserPlatformSelfLinkRequest';
|
|
@@ -1209,10 +1211,19 @@ export class CoreService {
|
|
|
1209
1211
|
* @throws ApiError
|
|
1210
1212
|
*/
|
|
1211
1213
|
public static coreRbacGroupsList({
|
|
1214
|
+
platformKey,
|
|
1215
|
+
owner,
|
|
1212
1216
|
page,
|
|
1213
1217
|
pageSize,
|
|
1214
|
-
platformKey,
|
|
1215
1218
|
}: {
|
|
1219
|
+
/**
|
|
1220
|
+
* Filter groups by platform key
|
|
1221
|
+
*/
|
|
1222
|
+
platformKey: string,
|
|
1223
|
+
/**
|
|
1224
|
+
* Filter groups by owner username
|
|
1225
|
+
*/
|
|
1226
|
+
owner?: string,
|
|
1216
1227
|
/**
|
|
1217
1228
|
* A page number within the paginated result set.
|
|
1218
1229
|
*/
|
|
@@ -1221,15 +1232,12 @@ export class CoreService {
|
|
|
1221
1232
|
* Number of results to return per page.
|
|
1222
1233
|
*/
|
|
1223
1234
|
pageSize?: number,
|
|
1224
|
-
/**
|
|
1225
|
-
* Filter groups by platform key
|
|
1226
|
-
*/
|
|
1227
|
-
platformKey?: string,
|
|
1228
1235
|
}): CancelablePromise<PaginatedRbacGroupList> {
|
|
1229
1236
|
return __request(OpenAPI, {
|
|
1230
1237
|
method: 'GET',
|
|
1231
1238
|
url: '/api/core/rbac/groups/',
|
|
1232
1239
|
query: {
|
|
1240
|
+
'owner': owner,
|
|
1233
1241
|
'page': page,
|
|
1234
1242
|
'page_size': pageSize,
|
|
1235
1243
|
'platform_key': platformKey,
|
|
@@ -1365,7 +1373,7 @@ export class CoreService {
|
|
|
1365
1373
|
/**
|
|
1366
1374
|
* platform key for authorization check
|
|
1367
1375
|
*/
|
|
1368
|
-
platformKey
|
|
1376
|
+
platformKey: string,
|
|
1369
1377
|
}): CancelablePromise<void> {
|
|
1370
1378
|
return __request(OpenAPI, {
|
|
1371
1379
|
method: 'DELETE',
|
|
@@ -1381,6 +1389,63 @@ export class CoreService {
|
|
|
1381
1389
|
},
|
|
1382
1390
|
});
|
|
1383
1391
|
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Get mentor access status
|
|
1394
|
+
* Retrieve current access information for a specific mentor, including all groups and users that have access with their respective roles.
|
|
1395
|
+
* @returns MentorPolicy
|
|
1396
|
+
* @throws ApiError
|
|
1397
|
+
*/
|
|
1398
|
+
public static coreRbacMentorAccessList({
|
|
1399
|
+
mentorId,
|
|
1400
|
+
platformKey,
|
|
1401
|
+
}: {
|
|
1402
|
+
/**
|
|
1403
|
+
* ID of the mentor to get access information for
|
|
1404
|
+
*/
|
|
1405
|
+
mentorId: number,
|
|
1406
|
+
/**
|
|
1407
|
+
* Platform key where the mentor belongs
|
|
1408
|
+
*/
|
|
1409
|
+
platformKey: string,
|
|
1410
|
+
}): CancelablePromise<Array<MentorPolicy>> {
|
|
1411
|
+
return __request(OpenAPI, {
|
|
1412
|
+
method: 'GET',
|
|
1413
|
+
url: '/api/core/rbac/mentor-access/',
|
|
1414
|
+
query: {
|
|
1415
|
+
'mentor_id': mentorId,
|
|
1416
|
+
'platform_key': platformKey,
|
|
1417
|
+
},
|
|
1418
|
+
errors: {
|
|
1419
|
+
400: `Missing or invalid query parameters`,
|
|
1420
|
+
403: `Permission denied - ShareMentor permission required`,
|
|
1421
|
+
404: `Platform not found`,
|
|
1422
|
+
500: `Internal server error`,
|
|
1423
|
+
},
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Control which RbacGroups and/or Users have access to a mentor and with what Role
|
|
1428
|
+
* Create or update RBAC policies to manage group and user access to specific mentors. Creates role-specific policies and handles adding/removing groups and users.
|
|
1429
|
+
* @returns MentorPolicy
|
|
1430
|
+
* @throws ApiError
|
|
1431
|
+
*/
|
|
1432
|
+
public static coreRbacMentorAccessCreate({
|
|
1433
|
+
requestBody,
|
|
1434
|
+
}: {
|
|
1435
|
+
requestBody: MentorPolicy,
|
|
1436
|
+
}): CancelablePromise<MentorPolicy> {
|
|
1437
|
+
return __request(OpenAPI, {
|
|
1438
|
+
method: 'POST',
|
|
1439
|
+
url: '/api/core/rbac/mentor-access/',
|
|
1440
|
+
body: requestBody,
|
|
1441
|
+
mediaType: 'application/json',
|
|
1442
|
+
errors: {
|
|
1443
|
+
400: `Invalid request data or validation errors`,
|
|
1444
|
+
403: `Permission denied - ShareMentor permission required`,
|
|
1445
|
+
404: `Platform or mentor not found`,
|
|
1446
|
+
},
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1384
1449
|
/**
|
|
1385
1450
|
* Check user permissions
|
|
1386
1451
|
* Check user permissions for specified resources
|
|
@@ -1567,7 +1632,7 @@ export class CoreService {
|
|
|
1567
1632
|
/**
|
|
1568
1633
|
* platform key for authorization check
|
|
1569
1634
|
*/
|
|
1570
|
-
platformKey
|
|
1635
|
+
platformKey: string,
|
|
1571
1636
|
}): CancelablePromise<void> {
|
|
1572
1637
|
return __request(OpenAPI, {
|
|
1573
1638
|
method: 'DELETE',
|
|
@@ -1740,7 +1805,7 @@ export class CoreService {
|
|
|
1740
1805
|
/**
|
|
1741
1806
|
* platform key for authorization check
|
|
1742
1807
|
*/
|
|
1743
|
-
platformKey
|
|
1808
|
+
platformKey: string,
|
|
1744
1809
|
}): CancelablePromise<void> {
|
|
1745
1810
|
return __request(OpenAPI, {
|
|
1746
1811
|
method: 'DELETE',
|
|
@@ -1856,6 +1921,62 @@ export class CoreService {
|
|
|
1856
1921
|
},
|
|
1857
1922
|
});
|
|
1858
1923
|
}
|
|
1924
|
+
/**
|
|
1925
|
+
* Get user group access status
|
|
1926
|
+
* Retrieve current group access information for a specific user, including all groups the user has access to and whether they have mentor management permissions.
|
|
1927
|
+
* @returns UserGroupAccess
|
|
1928
|
+
* @throws ApiError
|
|
1929
|
+
*/
|
|
1930
|
+
public static coreRbacUserGroupAccessRetrieve({
|
|
1931
|
+
platformKey,
|
|
1932
|
+
userId,
|
|
1933
|
+
}: {
|
|
1934
|
+
/**
|
|
1935
|
+
* Platform key where the groups exist
|
|
1936
|
+
*/
|
|
1937
|
+
platformKey: string,
|
|
1938
|
+
/**
|
|
1939
|
+
* ID of the user to check group access for
|
|
1940
|
+
*/
|
|
1941
|
+
userId: number,
|
|
1942
|
+
}): CancelablePromise<UserGroupAccess> {
|
|
1943
|
+
return __request(OpenAPI, {
|
|
1944
|
+
method: 'GET',
|
|
1945
|
+
url: '/api/core/rbac/user-group-access/',
|
|
1946
|
+
query: {
|
|
1947
|
+
'platform_key': platformKey,
|
|
1948
|
+
'user_id': userId,
|
|
1949
|
+
},
|
|
1950
|
+
errors: {
|
|
1951
|
+
400: `Missing or invalid query parameters`,
|
|
1952
|
+
404: `Platform or user not found`,
|
|
1953
|
+
500: `Internal server error`,
|
|
1954
|
+
},
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* Manage user access to groups
|
|
1959
|
+
* Create or update user access to groups by adding/removing group access. Creates one policy per user with GROUP_MENTOR_MANAGER role for managing mentor access.
|
|
1960
|
+
* @returns UserGroupAccess
|
|
1961
|
+
* @throws ApiError
|
|
1962
|
+
*/
|
|
1963
|
+
public static coreRbacUserGroupAccessCreate({
|
|
1964
|
+
requestBody,
|
|
1965
|
+
}: {
|
|
1966
|
+
requestBody: UserGroupAccess,
|
|
1967
|
+
}): CancelablePromise<UserGroupAccess> {
|
|
1968
|
+
return __request(OpenAPI, {
|
|
1969
|
+
method: 'POST',
|
|
1970
|
+
url: '/api/core/rbac/user-group-access/',
|
|
1971
|
+
body: requestBody,
|
|
1972
|
+
mediaType: 'application/json',
|
|
1973
|
+
errors: {
|
|
1974
|
+
400: `Invalid request data or validation errors`,
|
|
1975
|
+
404: `Platform or user not found`,
|
|
1976
|
+
500: `Internal server error`,
|
|
1977
|
+
},
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1859
1980
|
/**
|
|
1860
1981
|
* Invalidate all tokens for the authenticated user
|
|
1861
1982
|
* @returns any No response body
|