@iblai/iblai-js 1.4.9 → 1.4.11

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.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useRef, useEffect, useState, useCallback, useLayoutEffect, forwardRef, createElement as createElement$1, useMemo, createContext, useReducer, useImperativeHandle, useContext, useDebugValue, isValidElement, Children, PureComponent, cloneElement, Component } from 'react';
3
- import { LOCAL_STORAGE_KEYS, TimeTracker, getInitials, useTenantMetadata, isAlphaNumeric32, checkRbacPermission, getTimeAgo, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl } from '@iblai/web-utils';
3
+ import { LOCAL_STORAGE_KEYS, TimeTracker, getInitials, useTenantMetadata, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl } from '@iblai/web-utils';
4
4
  import { useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, useGetMentorsQuery, useGetRbacPoliciesQuery, usePlatformUsersQuery, usePlatformUserGroupsQuery, useUpdateTemplateMutation, useGetTemplateDetailsQuery, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useLazyGetDownloadReportFromURLQuery, useGetReportsQuery, useCreateReportMutation, useGetMentorPublicSettingsQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListPaywallsQuery, useListSubscribersQuery, useGetAuditLogsQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useCreateCheckoutMutation } from '@iblai/data-layer';
5
5
  import { toast, Toaster as Toaster$1 } from 'sonner';
6
6
  import { jsx, Fragment as Fragment$1, jsxs } from 'react/jsx-runtime';
@@ -122167,7 +122167,11 @@ function SendNotificationDialog({ open, onOpenChange, tenant, onNotificationSent
122167
122167
  }
122168
122168
  else if (recipientType === 'groups') {
122169
122169
  // Include users so we can extract unique users when sending notification
122170
- getUserGroups({ platformKey: tenant, includeUsers: true });
122170
+ getUserGroups({
122171
+ platformKey: tenant,
122172
+ includeUsers: true,
122173
+ requiredAction: REQUIRED_ACTIONS_FOR_GROUPS.NOTIFICATIONS,
122174
+ });
122171
122175
  }
122172
122176
  // Only include debouncedSearch in deps when user has permission
122173
122177
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -122393,8 +122397,8 @@ function SendNotificationDialog({ open, onOpenChange, tenant, onNotificationSent
122393
122397
  toggleUserSelection(user);
122394
122398
  }
122395
122399
  }, "data-testid": `user-option-${user.email}`, children: [jsx(Avatar, { className: "h-9 w-9", children: jsx(AvatarFallback, { className: "bg-blue-100 text-blue-700 font-medium", children: userName.substring(0, 2).toUpperCase() }) }), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("div", { className: "text-sm font-medium text-gray-900", children: userName }), jsx("div", { className: "text-xs text-gray-500 truncate", children: user.email })] }), isSelected && (jsx("div", { className: "w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center flex-shrink-0", "aria-hidden": "true", children: jsx("svg", { className: "w-3 h-3 text-white", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", stroke: "currentColor", children: jsx("path", { d: "M5 13l4 4L19 7" }) }) }))] }, user.email));
122396
- })) : (jsx("div", { className: "text-center py-8 text-gray-500 text-sm", role: "status", "data-testid": "users-empty", children: "No users found" })) })), recipientType === 'groups' && (jsx("div", { className: "max-h-[280px] overflow-y-auto space-y-2 border rounded-lg p-2", role: "listbox", "aria-label": "Available users", "aria-describedby": "recipients-label selected-count", "data-testid": "available-users-listbox", children: groupsLoading ? (jsx("div", { className: "text-center py-8 text-gray-500 text-sm", role: "status", "aria-live": "polite", "data-testid": "users-loading", children: "Loading ..." })) : groups.length > 0 ? (groups.map((group) => {
122397
- const isSelected = selectedGroups.some((g) => g.name === group.email);
122400
+ })) : (jsx("div", { className: "text-center py-8 text-gray-500 text-sm", role: "status", "data-testid": "users-empty", children: "No users found" })) })), recipientType === 'groups' && (jsx("div", { className: "max-h-[280px] overflow-y-auto space-y-2 border rounded-lg p-2", role: "listbox", "aria-label": "Available groups", "aria-describedby": "recipients-label selected-count", "data-testid": "available-users-listbox", children: groupsLoading ? (jsx("div", { className: "text-center py-8 text-gray-500 text-sm", role: "status", "aria-live": "polite", "data-testid": "users-loading", children: "Loading ..." })) : groups.length > 0 ? (groups.map((group) => {
122401
+ const isSelected = selectedGroups.some((g) => g.name === group.name);
122398
122402
  const groupName = group.name;
122399
122403
  return (jsxs("div", { onClick: () => toggleGroupSelection(group), className: `flex items-center gap-3 p-3 rounded-lg cursor-pointer transition-colors ${isSelected
122400
122404
  ? 'bg-blue-50 border border-blue-200'
@@ -186027,8 +186031,11 @@ const DEFAULT_MAX_POLL_TIMEOUT = 30000; // 30 seconds fallback
186027
186031
  const getPollingInterval = (attempt, maxTimeout) => {
186028
186032
  return Math.min(BASE_POLL_INTERVAL * Math.pow(2, attempt), maxTimeout);
186029
186033
  };
186030
- const useReports = ({ tenantKey, selectedMentorId, usergroupIds, }) => {
186031
- const { data: reportsResponse, isLoading, error, refetch, } = useGetReportsQuery({ key: tenantKey });
186034
+ const useReports = ({ tenantKey, selectedMentorId, usergroupIds, selectedMentorDbId, }) => {
186035
+ const { data: reportsResponse, isLoading, error, refetch, } = useGetReportsQuery({
186036
+ key: tenantKey,
186037
+ ...(selectedMentorDbId ? { mentor_id: selectedMentorDbId } : {}),
186038
+ });
186032
186039
  const reports = useMemo(() => { var _a; return (_a = reportsResponse === null || reportsResponse === void 0 ? void 0 : reportsResponse.data) !== null && _a !== void 0 ? _a : []; }, [reportsResponse === null || reportsResponse === void 0 ? void 0 : reportsResponse.data]);
186033
186040
  const [statusMap, setStatusMap] = useState({});
186034
186041
  const [activeReportName, setActiveReportName] = useState(null);
@@ -186329,7 +186336,7 @@ const toTitleCase = (value) => {
186329
186336
  .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
186330
186337
  .join(' ');
186331
186338
  };
186332
- function AnalyticsReports({ tenantKey, selectedMentorId, disabledReports = [], usergroupIds, }) {
186339
+ function AnalyticsReports({ tenantKey, selectedMentorId, disabledReports = [], usergroupIds, selectedMentorDbId, }) {
186333
186340
  const { metadata } = useTenantMetadata({ org: tenantKey });
186334
186341
  //we using metadata to get the combined recommendation reports
186335
186342
  //"combined_recommendation_reports": "Recommendation History Report,Course Grade Report,User Group Member List Report",
@@ -186343,6 +186350,7 @@ function AnalyticsReports({ tenantKey, selectedMentorId, disabledReports = [], u
186343
186350
  tenantKey,
186344
186351
  selectedMentorId,
186345
186352
  usergroupIds,
186353
+ selectedMentorDbId,
186346
186354
  });
186347
186355
  const [fetchReportBlob] = useLazyGetDownloadReportFromURLQuery();
186348
186356
  const fetchAuthenticatedContent = useCallback(async (url) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/iblai-js",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
5
5
  "type": "module",
6
6
  "engines": {
@@ -61,10 +61,10 @@
61
61
  "axios": "1.13.6",
62
62
  "dotenv": "16.6.1",
63
63
  "winston": "3.19.0",
64
- "@iblai/data-layer": "1.3.6",
64
+ "@iblai/data-layer": "1.3.7",
65
65
  "@iblai/mcp": "1.3.2",
66
- "@iblai/web-containers": "1.3.8",
67
- "@iblai/web-utils": "1.2.9"
66
+ "@iblai/web-utils": "1.2.10",
67
+ "@iblai/web-containers": "1.3.10"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@iblai/iblai-api": "4.166.0-ai",