@iblai/data-layer 1.8.9 → 1.9.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.js CHANGED
@@ -40423,6 +40423,32 @@ const userApiSlice = react.createApi({
40423
40423
  });
40424
40424
  const { useGetUserMetadataQuery, useLazyGetUserMetadataQuery, useUpdateUserMetadataMutation, useUpdateUserAccountMutation, useResetPasswordMutation, useUpdateUserRoleMutation, useUploadProfileImageMutation, useRemoveProfileImageMutation, useGetUserMetadataEdxQuery, useLazyGetUserMetadataEdxQuery, useUpdateUserMetadataEdxMutation, useGetUserPlatformMetadataQuery, useLazyGetUserPlatformMetadataQuery, useUpdateUserPlatformMetadataMutation, } = userApiSlice;
40425
40425
 
40426
+ /**
40427
+ * Shared fetch for the paginated LTI provider list endpoints. Sends
40428
+ * `platform_key`, optional `mentor_id` (Agent Links), and `page` / `page_size`.
40429
+ */
40430
+ async function fetchLtiList(path, args) {
40431
+ const queryParams = new URLSearchParams({ platform_key: args.platformKey });
40432
+ if (args.mentorId)
40433
+ queryParams.set('mentor_id', args.mentorId);
40434
+ if (args.page !== undefined)
40435
+ queryParams.set('page', String(args.page));
40436
+ if (args.pageSize !== undefined)
40437
+ queryParams.set('page_size', String(args.pageSize));
40438
+ const url = `${OpenAPI.BASE}/api/core/lti/1p3/provider/${path}/?${queryParams.toString()}`;
40439
+ const response = await fetch(url, {
40440
+ method: 'GET',
40441
+ headers: OpenAPI.HEADERS,
40442
+ credentials: 'omit',
40443
+ });
40444
+ if (!response.ok) {
40445
+ throw Object.assign(new Error(`Failed to fetch ${path}`), {
40446
+ status: response.status,
40447
+ body: await response.text(),
40448
+ });
40449
+ }
40450
+ return response.json();
40451
+ }
40426
40452
  const coreApiSlice = react.createApi({
40427
40453
  reducerPath: 'coreApiSlice',
40428
40454
  baseQuery: iblFakeBaseQuery,
@@ -40722,7 +40748,7 @@ const coreApiSlice = react.createApi({
40722
40748
  }),
40723
40749
  // ── LTI 1.3 Provider: Keys (platform-wide RSA signing keys) ──
40724
40750
  getLtiKeys: builder.query({
40725
- ...buildEndpointFromDmService(CoreService.coreLti1P3ProviderLtiKeysList),
40751
+ ...buildEndpointFromService(exports.SERVICES.DM, (args) => fetchLtiList('lti-keys', args)),
40726
40752
  providesTags: ['LtiKeys'],
40727
40753
  }),
40728
40754
  getLtiKeyDetail: builder.query({
@@ -40751,24 +40777,7 @@ const coreApiSlice = react.createApi({
40751
40777
  // The generated CoreService.coreLti1P3ProviderLtiMentorsList only sends
40752
40778
  // platform_key.
40753
40779
  getLtiMentors: builder.query({
40754
- ...buildEndpointFromService(exports.SERVICES.DM, async (args) => {
40755
- const queryParams = new URLSearchParams({ platform_key: args.platformKey });
40756
- if (args.mentorId)
40757
- queryParams.set('mentor_id', args.mentorId);
40758
- const url = `${OpenAPI.BASE}/api/core/lti/1p3/provider/lti-mentors/?${queryParams.toString()}`;
40759
- const response = await fetch(url, {
40760
- method: 'GET',
40761
- headers: OpenAPI.HEADERS,
40762
- credentials: 'omit',
40763
- });
40764
- if (!response.ok) {
40765
- throw Object.assign(new Error('Failed to fetch LTI mentors'), {
40766
- status: response.status,
40767
- body: await response.text(),
40768
- });
40769
- }
40770
- return response.json();
40771
- }),
40780
+ ...buildEndpointFromService(exports.SERVICES.DM, (args) => fetchLtiList('lti-mentors', args)),
40772
40781
  providesTags: ['LtiMentors'],
40773
40782
  }),
40774
40783
  getLtiMentorDetail: builder.query({
@@ -40791,7 +40800,7 @@ const coreApiSlice = react.createApi({
40791
40800
  }),
40792
40801
  // ── LTI 1.3 Provider: Tools (platform-wide LTI Platform integrations) ──
40793
40802
  getLtiTools: builder.query({
40794
- ...buildEndpointFromDmService(CoreService.coreLti1P3ProviderLtiToolsList),
40803
+ ...buildEndpointFromService(exports.SERVICES.DM, (args) => fetchLtiList('lti-tools', args)),
40795
40804
  providesTags: ['LtiTools'],
40796
40805
  }),
40797
40806
  getLtiToolDetail: builder.query({
@@ -45735,6 +45744,7 @@ const mentorReducer = {
45735
45744
  [clawApiSlice.reducerPath]: clawApiSlice.reducer,
45736
45745
  [watchedGroupsApiSlice.reducerPath]: watchedGroupsApiSlice.reducer,
45737
45746
  [chatPrivacyApiSlice.reducerPath]: chatPrivacyApiSlice.reducer,
45747
+ [skillsApiSlice.reducerPath]: skillsApiSlice.reducer,
45738
45748
  };
45739
45749
  const mentorMiddleware = [
45740
45750
  mentorApiSlice.middleware,
@@ -45790,6 +45800,7 @@ const mentorMiddleware = [
45790
45800
  clawApiSlice.middleware,
45791
45801
  watchedGroupsApiSlice.middleware,
45792
45802
  chatPrivacyApiSlice.middleware,
45803
+ skillsApiSlice.middleware,
45793
45804
  ];
45794
45805
 
45795
45806
  const skillsReducer = {