@iblai/data-layer 1.32.0 → 1.33.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/dist/index.d.ts +684 -346
- package/dist/index.esm.js +59 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +60 -14
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/analytics/__tests__/conversation-headline.test.d.ts +1 -0
- package/dist/src/features/core/__tests__/custom-endpoints.test.d.ts +1 -0
- package/dist/src/features/core/__tests__/llm-access.test.d.ts +1 -0
- package/dist/src/features/core/__tests__/logo-endpoints.test.d.ts +1 -0
- package/dist/src/features/core/api-slice.d.ts +663 -345
- package/dist/src/features/core/types.d.ts +18 -0
- package/dist/src/features/tenant-logo/__tests__/constants.test.d.ts +1 -0
- package/dist/src/features/tenant-logo/constants.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41372,6 +41372,34 @@ async function fetchLtiList(path, args) {
|
|
|
41372
41372
|
}
|
|
41373
41373
|
return response.json();
|
|
41374
41374
|
}
|
|
41375
|
+
/**
|
|
41376
|
+
* Fetch for the tenant-admin LLM-access endpoints. Not in the pinned generated
|
|
41377
|
+
* client, and the screen needs the HTTP status and the 400 body (which names
|
|
41378
|
+
* the rejected entry), so a JSON body is kept parsed on the thrown error.
|
|
41379
|
+
*/
|
|
41380
|
+
async function fetchLlmAccess(path, init, query) {
|
|
41381
|
+
const url = `${OpenAPI.BASE}/api/core/rbac/llm-access/${path}/${query ? `?${query.toString()}` : ''}`;
|
|
41382
|
+
const response = await fetch(url, {
|
|
41383
|
+
...init,
|
|
41384
|
+
headers: { ...OpenAPI.HEADERS, ...init.headers },
|
|
41385
|
+
credentials: 'omit',
|
|
41386
|
+
});
|
|
41387
|
+
if (!response.ok) {
|
|
41388
|
+
const text = await response.text();
|
|
41389
|
+
let body = text;
|
|
41390
|
+
try {
|
|
41391
|
+
body = JSON.parse(text);
|
|
41392
|
+
}
|
|
41393
|
+
catch (_a) {
|
|
41394
|
+
// Not JSON (e.g. an HTML error page); keep the raw text.
|
|
41395
|
+
}
|
|
41396
|
+
throw Object.assign(new Error(`Failed to ${path} user LLM access`), {
|
|
41397
|
+
status: response.status,
|
|
41398
|
+
body,
|
|
41399
|
+
});
|
|
41400
|
+
}
|
|
41401
|
+
return response.json();
|
|
41402
|
+
}
|
|
41375
41403
|
const coreApiSlice = react.createApi({
|
|
41376
41404
|
reducerPath: 'coreApiSlice',
|
|
41377
41405
|
baseQuery: iblFakeBaseQuery,
|
|
@@ -41386,6 +41414,7 @@ const coreApiSlice = react.createApi({
|
|
|
41386
41414
|
'LtiKeys',
|
|
41387
41415
|
'LtiMentors',
|
|
41388
41416
|
'LtiTools',
|
|
41417
|
+
'LlmAccess',
|
|
41389
41418
|
],
|
|
41390
41419
|
endpoints: (builder) => ({
|
|
41391
41420
|
createRedirectToken: builder.mutation({
|
|
@@ -41448,6 +41477,21 @@ const coreApiSlice = react.createApi({
|
|
|
41448
41477
|
setStudentMentorCreationStatus: builder.mutation({
|
|
41449
41478
|
...buildEndpointFromDmService(CoreService.coreRbacStudentMentorCreationSetCreate),
|
|
41450
41479
|
}),
|
|
41480
|
+
// 404 (platform or "LLM Model Access" policy missing) and 400 (an entry
|
|
41481
|
+
// not in the model catalog) won't change on a retry, so fail fast and let
|
|
41482
|
+
// the screen explain them instead of stalling through the backoff.
|
|
41483
|
+
getLlmAccess: builder.query({
|
|
41484
|
+
...buildEndpointFromService(exports.SERVICES.DM, (args) => fetchLlmAccess('status', { method: 'GET' }, new URLSearchParams({ platform_key: args.platform_key })), { expectedErrorStatuses: [404] }),
|
|
41485
|
+
providesTags: ['LlmAccess'],
|
|
41486
|
+
}),
|
|
41487
|
+
setLlmAccess: builder.mutation({
|
|
41488
|
+
...buildEndpointFromService(exports.SERVICES.DM, (args) => fetchLlmAccess('set', {
|
|
41489
|
+
method: 'POST',
|
|
41490
|
+
headers: { 'Content-Type': 'application/json' },
|
|
41491
|
+
body: JSON.stringify(args),
|
|
41492
|
+
}), { expectedErrorStatuses: [400, 404] }),
|
|
41493
|
+
invalidatesTags: ['LlmAccess'],
|
|
41494
|
+
}),
|
|
41451
41495
|
//RBAC GROUPS
|
|
41452
41496
|
getRbacGroups: builder.query({
|
|
41453
41497
|
...buildEndpointFromDmService(CoreService.coreRbacGroupsList),
|
|
@@ -41870,7 +41914,7 @@ const coreApiSlice = react.createApi({
|
|
|
41870
41914
|
}),
|
|
41871
41915
|
}),
|
|
41872
41916
|
});
|
|
41873
|
-
const { useCreateRedirectTokenMutation, useGetPlatformInfoQuery, useGetRbacPermissionsMutation, useLazyGetPlatformInfoQuery, useUpdatePlatformInfoMutation, useUpdateUserStatusMutation, useGetAccessibleUsersQuery, useLazyGetAccessibleUsersQuery, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, useGetRbacGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useGetRbacGroupDetailsQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetRbacRolesQuery, useLazyGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, usePartialUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetDepartmentMemberCheckQuery, useLazyGetDepartmentMemberCheckQuery, useGetRbacMentorAccessListQuery, useUpdateRbacMentorAccessMutation, useGetRbacActionsDefinitionQuery, useLazyGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useLazyGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useLazyGetRbacResourceListQuery, useGetRbacTeamsAccessListQuery, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation,
|
|
41917
|
+
const { useCreateRedirectTokenMutation, useGetPlatformInfoQuery, useGetRbacPermissionsMutation, useLazyGetPlatformInfoQuery, useUpdatePlatformInfoMutation, useUpdateUserStatusMutation, useGetAccessibleUsersQuery, useLazyGetAccessibleUsersQuery, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, useGetLlmAccessQuery, useSetLlmAccessMutation, useGetRbacGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useGetRbacGroupDetailsQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetRbacRolesQuery, useLazyGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, usePartialUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetDepartmentMemberCheckQuery, useLazyGetDepartmentMemberCheckQuery, useGetRbacMentorAccessListQuery, useUpdateRbacMentorAccessMutation, useGetRbacActionsDefinitionQuery, useLazyGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useLazyGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useLazyGetRbacResourceListQuery, useGetRbacTeamsAccessListQuery, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation,
|
|
41874
41918
|
// LTI Keys
|
|
41875
41919
|
useGetLtiKeysQuery, useGetLtiKeyDetailQuery, useLazyGetLtiKeyDetailQuery, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation,
|
|
41876
41920
|
// LTI Agent (Mentor) Links
|
|
@@ -41879,8 +41923,8 @@ useGetLtiMentorsQuery, useGetLtiMentorDetailQuery, useCreateLtiMentorMutation, u
|
|
|
41879
41923
|
useGetLtiToolsQuery, useGetLtiToolDetailQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useDeleteLtiToolMutation, } = coreApiSlice;
|
|
41880
41924
|
|
|
41881
41925
|
const LOGO_ENDPOINTS = {
|
|
41882
|
-
light_logo: (platformKey) => getServiceUrl(exports.SERVICES.AXD) + `/api/core/orgs/${platformKey}/logo
|
|
41883
|
-
dark_logo: (platformKey) => getServiceUrl(exports.SERVICES.AXD) + `/api/core/orgs/${platformKey}/dark-mode-logo
|
|
41926
|
+
light_logo: (platformKey) => getServiceUrl(exports.SERVICES.AXD) + `/api/core/orgs/${platformKey}/logo/`,
|
|
41927
|
+
dark_logo: (platformKey) => getServiceUrl(exports.SERVICES.AXD) + `/api/core/orgs/${platformKey}/dark-mode-logo/`,
|
|
41884
41928
|
};
|
|
41885
41929
|
const CORE_CUSTOM_REDUCER_PATH = 'coreCustomApiSlice';
|
|
41886
41930
|
const CORE_FAKE_CUSTOM_REDUCER_PATH = 'coreFakeCustomApiSlice';
|
|
@@ -43153,7 +43197,7 @@ const NON_AI_ANALYTICS_ENDPOINTS = {
|
|
|
43153
43197
|
},
|
|
43154
43198
|
GET_TRANSCRIPTS_CONVERSATION_HEADLINE: {
|
|
43155
43199
|
service: exports.SERVICES.DM,
|
|
43156
|
-
path: (args) => `/api/analytics/conversations
|
|
43200
|
+
path: (args) => `/api/analytics/conversations/?platform_key=${args.platform_key}${args.mentor_unique_id ? `&mentor_unique_id=${args.mentor_unique_id}` : ''}&metric=${args.metric}${args.date_filter ? `&date_filter=${args.date_filter}` : ''}${args.start_date ? `&start_date=${args.start_date}` : ''}${args.end_date ? `&end_date=${args.end_date}` : ''}`,
|
|
43157
43201
|
},
|
|
43158
43202
|
GET_CONTENT_ANALYTICS: {
|
|
43159
43203
|
service: exports.SERVICES.DM,
|
|
@@ -44679,28 +44723,28 @@ const artifactsApiSlice = react.createApi({
|
|
|
44679
44723
|
const { useListArtifactsQuery, useLazyListArtifactsQuery, useGetArtifactQuery, useLazyGetArtifactQuery, useUpdateArtifactMutation, useListArtifactVersionsQuery, useLazyListArtifactVersionsQuery, useGetArtifactVersionQuery, useLazyGetArtifactVersionQuery, useSetCurrentVersionMutation, } = artifactsApiSlice;
|
|
44680
44724
|
const artifactsApiReducer = artifactsApiSlice.reducer;
|
|
44681
44725
|
|
|
44682
|
-
const TENANT_LOGO_REDUCER_PATH =
|
|
44726
|
+
const TENANT_LOGO_REDUCER_PATH = 'tenantLogoApiSlice';
|
|
44683
44727
|
const TENANT_LOGO_QUERY_KEYS = {
|
|
44684
|
-
GET_LIGHT_LOGO: () => [
|
|
44685
|
-
GET_DARK_LOGO: () => [
|
|
44728
|
+
GET_LIGHT_LOGO: () => ['GET_LIGHT_LOGO'],
|
|
44729
|
+
GET_DARK_LOGO: () => ['GET_DARK_LOGO'],
|
|
44686
44730
|
};
|
|
44687
44731
|
const TENANT_LOGO_ENDPOINTS = {
|
|
44688
44732
|
GET_LIGHT_LOGO: {
|
|
44689
|
-
path: (platformKey) => `/api/core/orgs/${platformKey}/logo
|
|
44690
|
-
service: exports.SERVICES.AXD
|
|
44733
|
+
path: (platformKey) => `/api/core/orgs/${platformKey}/logo/`,
|
|
44734
|
+
service: exports.SERVICES.AXD,
|
|
44691
44735
|
},
|
|
44692
44736
|
GET_DARK_LOGO: {
|
|
44693
|
-
path: (platformKey) => `/api/core/orgs/${platformKey}/dark-mode-logo
|
|
44694
|
-
service: exports.SERVICES.AXD
|
|
44737
|
+
path: (platformKey) => `/api/core/orgs/${platformKey}/dark-mode-logo/`,
|
|
44738
|
+
service: exports.SERVICES.AXD,
|
|
44695
44739
|
},
|
|
44696
44740
|
UPLOAD_LIGHT_LOGO: {
|
|
44697
44741
|
path: (platformKey) => `/api/core/orgs/${platformKey}/logo/create/`,
|
|
44698
|
-
service: exports.SERVICES.AXD
|
|
44742
|
+
service: exports.SERVICES.AXD,
|
|
44699
44743
|
},
|
|
44700
44744
|
UPLOAD_DARK_LOGO: {
|
|
44701
44745
|
path: (platformKey) => `/api/core/orgs/${platformKey}/dark-mode-logo/create/`,
|
|
44702
|
-
service: exports.SERVICES.AXD
|
|
44703
|
-
}
|
|
44746
|
+
service: exports.SERVICES.AXD,
|
|
44747
|
+
},
|
|
44704
44748
|
};
|
|
44705
44749
|
|
|
44706
44750
|
const tenantLogoApiSlice = react.createApi({
|
|
@@ -50437,6 +50481,7 @@ exports.useGetItemSubscriptionQuery = useGetItemSubscriptionQuery;
|
|
|
50437
50481
|
exports.useGetLLMCredentialsQuery = useGetLLMCredentialsQuery;
|
|
50438
50482
|
exports.useGetLearnerCourseOutlineQuery = useGetLearnerCourseOutlineQuery;
|
|
50439
50483
|
exports.useGetLearnerDetailsQuery = useGetLearnerDetailsQuery;
|
|
50484
|
+
exports.useGetLlmAccessQuery = useGetLlmAccessQuery;
|
|
50440
50485
|
exports.useGetLlmUsageMetricsQuery = useGetLlmUsageMetricsQuery;
|
|
50441
50486
|
exports.useGetLlmUsageObservationsQuery = useGetLlmUsageObservationsQuery;
|
|
50442
50487
|
exports.useGetLlmUsageTracesQuery = useGetLlmUsageTracesQuery;
|
|
@@ -50912,6 +50957,7 @@ exports.useSelfRetireMutation = useSelfRetireMutation;
|
|
|
50912
50957
|
exports.useSendNotificationMutation = useSendNotificationMutation;
|
|
50913
50958
|
exports.useSendTestTemplateEmailMutation = useSendTestTemplateEmailMutation;
|
|
50914
50959
|
exports.useSetCurrentVersionMutation = useSetCurrentVersionMutation;
|
|
50960
|
+
exports.useSetLlmAccessMutation = useSetLlmAccessMutation;
|
|
50915
50961
|
exports.useSetPlatformConfigurationsMutation = useSetPlatformConfigurationsMutation;
|
|
50916
50962
|
exports.useSetStudentMentorCreationStatusMutation = useSetStudentMentorCreationStatusMutation;
|
|
50917
50963
|
exports.useSetStudioAdvancedSettingsMutation = useSetStudioAdvancedSettingsMutation;
|