@academy-sdk/sdk 0.1.0 → 0.2.0

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.
Files changed (102) hide show
  1. package/dist/bundle.js +70 -0
  2. package/dist/manifest.json +5 -0
  3. package/dist/styles.css +3307 -0
  4. package/package.json +40 -46
  5. package/src/components/atoms/Avatar.tsx +38 -0
  6. package/src/components/atoms/Badge.tsx +32 -0
  7. package/src/components/atoms/Button.tsx +48 -0
  8. package/src/components/atoms/Card.tsx +33 -0
  9. package/src/components/atoms/Input.tsx +39 -0
  10. package/src/components/atoms/ProgressBar.tsx +52 -0
  11. package/src/components/atoms/Tabs.tsx +47 -0
  12. package/src/components/atoms/index.ts +10 -0
  13. package/src/components/index.ts +11 -0
  14. package/src/components/molecules/CourseCard.tsx +215 -0
  15. package/src/components/molecules/EmptyState.tsx +23 -0
  16. package/src/components/molecules/LoadingSpinner.tsx +27 -0
  17. package/src/components/molecules/PageHeader.tsx +22 -0
  18. package/src/components/molecules/Pagination.tsx +82 -0
  19. package/src/components/molecules/SearchInput.tsx +35 -0
  20. package/src/components/molecules/index.ts +12 -0
  21. package/src/components/organisms/CourseSidebar.tsx +276 -0
  22. package/src/components/organisms/LearnerNavbar.tsx +129 -0
  23. package/src/components/organisms/LearnerSidebar.tsx +148 -0
  24. package/src/components/organisms/LessonBookmarks.tsx +128 -0
  25. package/src/components/organisms/LessonNotes.tsx +153 -0
  26. package/src/components/organisms/index.ts +10 -0
  27. package/src/components/pages/BundleDetailPage.tsx +388 -0
  28. package/src/components/pages/CatalogBundlesPage.tsx +96 -0
  29. package/src/components/pages/CatalogCoursesPage.tsx +299 -0
  30. package/src/components/pages/CourseDetailPage.tsx +582 -0
  31. package/src/components/pages/CoursePlayerPage.tsx +481 -0
  32. package/src/components/pages/CreatorProfilePage.tsx +161 -0
  33. package/src/components/pages/LearnerSettingsPage.tsx +58 -0
  34. package/src/components/pages/ManualReviewDetailPage.tsx +254 -0
  35. package/src/components/pages/ManualReviewPage.tsx +228 -0
  36. package/src/components/pages/MessagesPage.tsx +285 -0
  37. package/src/components/pages/MyLearningPage.tsx +239 -0
  38. package/src/components/pages/PaymentCancelPage.tsx +74 -0
  39. package/src/components/pages/PaymentSuccessPage.tsx +73 -0
  40. package/src/components/pages/index.ts +13 -0
  41. package/src/components/utils.ts +6 -0
  42. package/src/contracts/components.contract.ts +89 -0
  43. package/src/contracts/index.ts +4 -0
  44. package/src/contracts/layout.contract.ts +36 -0
  45. package/src/contracts/pages.contract.ts +275 -0
  46. package/src/contracts/template.contract.ts +100 -0
  47. package/src/default-template.tsx +52 -0
  48. package/src/hooks/index.ts +28 -0
  49. package/src/hooks/sdk-context.tsx +152 -0
  50. package/src/hooks/useAiCoach.ts +27 -0
  51. package/src/hooks/useBookmarks.ts +35 -0
  52. package/src/hooks/useCourseSearch.ts +18 -0
  53. package/src/hooks/useDebounce.ts +19 -0
  54. package/src/hooks/useMyBundles.ts +21 -0
  55. package/src/hooks/useMyCourses.ts +20 -0
  56. package/src/hooks/useNotes.ts +35 -0
  57. package/src/hooks/useNotifications.ts +16 -0
  58. package/src/hooks/useTheme.ts +17 -0
  59. package/src/hooks/useToast.ts +17 -0
  60. package/src/hooks/useUser.ts +33 -0
  61. package/src/index.ts +33 -0
  62. package/src/layouts/DefaultLayout.tsx +58 -0
  63. package/src/manifest.json +5 -0
  64. package/src/styles.css +43 -0
  65. package/src/types/ai-coach.ts +25 -0
  66. package/src/types/bookmarks.ts +20 -0
  67. package/src/types/bundle.ts +119 -0
  68. package/src/types/common.ts +24 -0
  69. package/src/types/course.ts +135 -0
  70. package/src/types/enrollment.ts +35 -0
  71. package/src/types/index.ts +15 -0
  72. package/src/types/lesson.ts +106 -0
  73. package/src/types/manual-review.ts +116 -0
  74. package/src/types/messaging.ts +109 -0
  75. package/src/types/notification.ts +30 -0
  76. package/src/types/payment.ts +40 -0
  77. package/src/types/progress.ts +19 -0
  78. package/src/types/rating.ts +20 -0
  79. package/src/types/search.ts +31 -0
  80. package/src/types/user.ts +16 -0
  81. package/src/utils/formatters.ts +74 -0
  82. package/src/utils/index.ts +8 -0
  83. package/dist/components/atoms/index.cjs +0 -318
  84. package/dist/components/atoms/index.js +0 -288
  85. package/dist/components/index.cjs +0 -1275
  86. package/dist/components/index.js +0 -1245
  87. package/dist/components/molecules/index.cjs +0 -334
  88. package/dist/components/molecules/index.js +0 -311
  89. package/dist/components/organisms/index.cjs +0 -855
  90. package/dist/components/organisms/index.js +0 -825
  91. package/dist/components/pages/index.cjs +0 -3306
  92. package/dist/components/pages/index.js +0 -3315
  93. package/dist/contracts/index.cjs +0 -52
  94. package/dist/contracts/index.js +0 -29
  95. package/dist/hooks/index.cjs +0 -165
  96. package/dist/hooks/index.js +0 -142
  97. package/dist/index.cjs +0 -630
  98. package/dist/index.js +0 -600
  99. package/dist/types/index.cjs +0 -18
  100. package/dist/types/index.js +0 -0
  101. package/dist/utils/index.cjs +0 -80
  102. package/dist/utils/index.js +0 -57
@@ -0,0 +1,119 @@
1
+ export interface BundleSettings {
2
+ pricingType: 'FREE' | 'ONE_TIME' | 'SUBSCRIPTION' | 'INSTALLMENT';
3
+ price?: number;
4
+ currency?: string;
5
+ accessDurationDays?: number;
6
+ allowCourseSkipping?: boolean;
7
+ requireSequentialCompletion?: boolean;
8
+ enableBundleCertificate?: boolean;
9
+ trialEnabled?: boolean;
10
+ trialPrice?: number;
11
+ trialDurationDays?: number;
12
+ }
13
+
14
+ export interface Bundle {
15
+ id: string;
16
+ tenantId?: string;
17
+ title: string;
18
+ slug?: string;
19
+ description?: string;
20
+ status: 'DRAFT' | 'PUBLISHED' | 'UNPUBLISHED' | 'ARCHIVED';
21
+ settings?: BundleSettings;
22
+ courses?: BundleCourse[];
23
+ includedCourses?: BundleCourse[];
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ }
27
+
28
+ export interface BundleCourse {
29
+ courseId: string;
30
+ orderIndex: number;
31
+ dripType?: 'STUDENT_ENROLLMENT_DATE' | 'STUDENT_START_DATE' | 'SPECIFIC_DATE';
32
+ dripStartDate?: string;
33
+ course?: {
34
+ id: string;
35
+ title: string;
36
+ slug?: string;
37
+ thumbnail?: string;
38
+ summary?: string;
39
+ status?: string;
40
+ sections?: Array<{
41
+ id: string;
42
+ title: string;
43
+ description?: string;
44
+ activities?: Array<{
45
+ id: string;
46
+ title: string;
47
+ description?: string;
48
+ estimatedDuration?: string;
49
+ }>;
50
+ }>;
51
+ };
52
+ }
53
+
54
+ export interface LearnerBundleCourse {
55
+ id: string;
56
+ title: string;
57
+ slug: string;
58
+ summary?: string;
59
+ thumbnail?: string;
60
+ orderIndex: number;
61
+ status: string;
62
+ totalActivities: number;
63
+ isEnrolled: boolean;
64
+ enrollmentId?: string;
65
+ enrollmentSource?: string;
66
+ isAccessible: boolean;
67
+ isAvailable: boolean;
68
+ availableAt?: string;
69
+ dripType?: 'STUDENT_ENROLLMENT_DATE' | 'STUDENT_START_DATE' | 'SPECIFIC_DATE';
70
+ isCompleted?: boolean;
71
+ completedAt?: string;
72
+ progressPercentage?: number;
73
+ completedActivities?: number;
74
+ }
75
+
76
+ export interface LearnerBundleCreator {
77
+ id: string;
78
+ name: string;
79
+ email: string;
80
+ }
81
+
82
+ export interface LearnerBundle {
83
+ id: string;
84
+ title: string;
85
+ slug: string;
86
+ description?: string;
87
+ courses: LearnerBundleCourse[];
88
+ totalCourses: number;
89
+ totalActivities: number;
90
+ price?: number | null;
91
+ currency: string;
92
+ pricingType: 'FREE' | 'ONE_TIME' | 'SUBSCRIPTION' | 'INSTALLMENT';
93
+ creator: LearnerBundleCreator;
94
+ isEnrolled: boolean;
95
+ createdAt: string;
96
+ updatedAt: string;
97
+ allowCourseSkipping: boolean;
98
+ requireSequentialCompletion: boolean;
99
+ enableBundleCertificate: boolean;
100
+ enableDiscussions: boolean;
101
+ bundleProgressPercentage: number;
102
+ allCoursesCompleted?: boolean;
103
+ certificateUrl?: string;
104
+ trialEnabled?: boolean;
105
+ trialPrice?: number;
106
+ trialDurationDays?: number;
107
+ }
108
+
109
+ export interface BundleListResponse {
110
+ data: Bundle[];
111
+ meta: {
112
+ page: number;
113
+ limit: number;
114
+ total: number;
115
+ totalPages: number;
116
+ hasNextPage: boolean;
117
+ hasPreviousPage: boolean;
118
+ };
119
+ }
@@ -0,0 +1,24 @@
1
+ export interface PaginationMeta {
2
+ page: number;
3
+ limit: number;
4
+ total: number;
5
+ totalPages: number;
6
+ hasNextPage: boolean;
7
+ hasPreviousPage: boolean;
8
+ }
9
+
10
+ export interface PaginatedResponse<T> {
11
+ data: T[];
12
+ meta: PaginationMeta;
13
+ }
14
+
15
+ export interface PaginationProps {
16
+ currentPage: number;
17
+ totalPages: number;
18
+ total: number;
19
+ pageSize: number;
20
+ hasNextPage: boolean;
21
+ hasPreviousPage: boolean;
22
+ onPageChange: (page: number) => void;
23
+ maxVisiblePages?: number;
24
+ }
@@ -0,0 +1,135 @@
1
+ export interface Course {
2
+ id: string;
3
+ title: string;
4
+ description?: string;
5
+ summary?: string;
6
+ slug?: string;
7
+ thumbnail?: string;
8
+ instructorId?: string;
9
+ status?: string;
10
+ modules?: Module[];
11
+ sections?: any[];
12
+ studentsEnrolled?: number;
13
+ totalActivities?: number;
14
+ createdAt?: Date;
15
+ updatedAt?: Date;
16
+ timestamp?: string;
17
+ settings?: CourseSettings;
18
+ }
19
+
20
+ export interface CourseSettings {
21
+ dripEnabled?: boolean;
22
+ timezone?: string;
23
+ banner?: string;
24
+ primaryThemeColor?: string;
25
+ secondaryThemeColor?: string;
26
+ communityEnabled?: boolean;
27
+ slackCommunityEnabled?: boolean;
28
+ slackCommunityStatus?: string;
29
+ slackChannelId?: string;
30
+ slackChannelName?: string;
31
+ seoTitle?: string;
32
+ seoDescription?: string;
33
+ seo?: CourseSEOSettings;
34
+ trialEnabled?: boolean;
35
+ trialPrice?: number;
36
+ trialDurationDays?: number;
37
+ }
38
+
39
+ export interface CourseSEOSettings {
40
+ title?: string;
41
+ description?: string;
42
+ isPubliclyDiscoverable?: boolean;
43
+ requirePassword?: boolean;
44
+ coursePassword?: string;
45
+ }
46
+
47
+ export interface Module {
48
+ id: string;
49
+ courseId: string;
50
+ title: string;
51
+ description: string;
52
+ order: number;
53
+ lessons: Lesson[];
54
+ }
55
+
56
+ export interface Lesson {
57
+ id: string;
58
+ moduleId: string;
59
+ title: string;
60
+ description: string;
61
+ videoUrl?: string;
62
+ content: string;
63
+ resources: Resource[];
64
+ homeworkRequired: boolean;
65
+ order: number;
66
+ duration?: number;
67
+ }
68
+
69
+ export interface Resource {
70
+ id: string;
71
+ lessonId: string;
72
+ title: string;
73
+ url: string;
74
+ type: 'pdf' | 'video' | 'link' | 'document';
75
+ }
76
+
77
+ // Course player types
78
+ export interface CoursePlayerLesson {
79
+ id: string;
80
+ title: string;
81
+ videoUrl: string;
82
+ videoProvider?: 'YOUTUBE' | 'VIMEO' | 'LOOM' | 'OTHERS';
83
+ videoResourceId?: string;
84
+ hasTranscript?: boolean;
85
+ duration: string;
86
+ completed: boolean;
87
+ locked?: boolean;
88
+ available?: boolean;
89
+ availableAt?: string;
90
+ availabilityMessage?: string;
91
+ schedulingType?: string;
92
+ remainingDays?: number;
93
+ hasPrerequisite?: boolean;
94
+ downloadable?: boolean;
95
+ lessonIcon?: string;
96
+ description?: string;
97
+ summary?: string;
98
+ learningObjectives?: string[];
99
+ enableDiscussion?: boolean;
100
+ secondaryResources?: Array<{
101
+ id: string;
102
+ title: string;
103
+ type: 'VIDEO' | 'LINK' | 'DOCUMENT';
104
+ metadataJson: {
105
+ url?: string;
106
+ key?: string;
107
+ name?: string;
108
+ size?: number;
109
+ mimeType?: string;
110
+ };
111
+ }>;
112
+ progressData?: {
113
+ progressId?: string;
114
+ completed?: boolean;
115
+ lastAccessed?: string;
116
+ progressSecond?: number;
117
+ completedAt?: string;
118
+ };
119
+ _fullData?: any;
120
+ }
121
+
122
+ export interface CoursePlayerModule {
123
+ id: string;
124
+ title: string;
125
+ lessons: CoursePlayerLesson[];
126
+ }
127
+
128
+ export interface CoursePlayerCourse {
129
+ id: string;
130
+ title: string;
131
+ description: string;
132
+ modules: CoursePlayerModule[];
133
+ summary?: string;
134
+ learningObjectives?: string[];
135
+ }
@@ -0,0 +1,35 @@
1
+ export interface StudentProgress {
2
+ id: string;
3
+ studentId: string;
4
+ courseId: string;
5
+ lessonsCompleted: string[];
6
+ currentLessonId?: string;
7
+ completionPercentage: number;
8
+ lastAccessedAt: Date;
9
+ }
10
+
11
+ export interface CourseEnrollment {
12
+ id: string;
13
+ learnerId: string;
14
+ learnerName: string;
15
+ learnerEmail: string;
16
+ learnerAvatar?: string;
17
+ courseId: string;
18
+ enrollmentDate: string;
19
+ status: 'active' | 'inactive' | 'removed' | 'pending';
20
+ progress: {
21
+ completedLessons: number;
22
+ totalLessons: number;
23
+ percentage: number;
24
+ };
25
+ lastAccessedAt?: string;
26
+ }
27
+
28
+ export interface EnrollmentStatus {
29
+ isEnrolled: boolean;
30
+ enrollmentId?: string;
31
+ enrolledAt?: string;
32
+ lastActivityId?: string;
33
+ progress?: number;
34
+ hasReviewed?: boolean;
35
+ }
@@ -0,0 +1,15 @@
1
+ export * from './course';
2
+ export * from './lesson';
3
+ export * from './bundle';
4
+ export * from './user';
5
+ export * from './enrollment';
6
+ export * from './messaging';
7
+ export * from './ai-coach';
8
+ export * from './search';
9
+ export * from './notification';
10
+ export * from './rating';
11
+ export * from './manual-review';
12
+ export * from './payment';
13
+ export * from './common';
14
+ export * from './bookmarks';
15
+ export * from './progress';
@@ -0,0 +1,106 @@
1
+ export interface LessonContent {
2
+ id: string;
3
+ title: string;
4
+ description: string;
5
+ videoUrl?: string;
6
+ videoDuration?: number;
7
+ resources: LessonResource[];
8
+ moduleId: string;
9
+ courseId: string;
10
+ order: number;
11
+ createdAt?: string;
12
+ updatedAt?: string;
13
+ }
14
+
15
+ export interface LessonResource {
16
+ id: string;
17
+ lessonId: string;
18
+ title: string;
19
+ url: string;
20
+ type: 'pdf' | 'video' | 'link' | 'document';
21
+ size?: number;
22
+ createdAt?: string;
23
+ }
24
+
25
+ export interface TranscriptItem {
26
+ timestamp: string;
27
+ text: string;
28
+ startTime: number;
29
+ endTime?: number;
30
+ }
31
+
32
+ export interface LessonTranscript {
33
+ lessonId: string;
34
+ language: string;
35
+ items: TranscriptItem[];
36
+ totalDuration?: number;
37
+ }
38
+
39
+ export interface TranscriptSearchResult {
40
+ lessonId: string;
41
+ matches: TranscriptItem[];
42
+ totalMatches: number;
43
+ }
44
+
45
+ export interface LessonProgress {
46
+ currentTime: number;
47
+ duration: number;
48
+ completed: boolean;
49
+ }
50
+
51
+ export interface LessonNote {
52
+ id: string;
53
+ activityId: string;
54
+ text: string;
55
+ timestamp?: number;
56
+ formattedTimestamp?: string;
57
+ createdAt: string;
58
+ updatedAt: string;
59
+ }
60
+
61
+ export interface FAQItem {
62
+ id: string;
63
+ question: string;
64
+ answer: string;
65
+ }
66
+
67
+ export interface CreateNotePayload {
68
+ activityId: string;
69
+ text: string;
70
+ timestamp?: number;
71
+ }
72
+
73
+ export interface UpdateNotePayload {
74
+ text: string;
75
+ timestamp?: number;
76
+ }
77
+
78
+ export interface LessonResources {
79
+ externalLinks: string[];
80
+ description: string;
81
+ customTabs: Array<{ id: string; label: string }>;
82
+ uploadedFiles?: Array<{
83
+ id: string;
84
+ key: string;
85
+ name: string;
86
+ size: number;
87
+ type: string;
88
+ url?: string;
89
+ customTitle?: string;
90
+ customDescription?: string;
91
+ }>;
92
+ }
93
+
94
+ export interface LessonData {
95
+ title: string;
96
+ videoLinks: Array<{ id: string; url: string; title?: string }>;
97
+ description: string;
98
+ settings: Record<string, string | boolean | number> & { faqs?: FAQItem[] };
99
+ resources?: LessonResources;
100
+ resourceIds?: {
101
+ videoResourceIds?: string[];
102
+ linkResourceIds?: string[];
103
+ fileResourceIds?: string[];
104
+ };
105
+ settingsId?: string;
106
+ }
@@ -0,0 +1,116 @@
1
+ export type LearnerManualReviewStatus = 'IN_REVIEW' | 'REQUEST_CHANGE' | 'GRADED';
2
+
3
+ export type QuestionType = 'SINGLE_CHOICE' | 'MULTIPLE_SELECT' | 'TRUE_FALSE' | 'TEXT' | 'ESSAY';
4
+
5
+ export interface LearnerManualReviewAssignment {
6
+ id: string;
7
+ title: string;
8
+ courseId: string;
9
+ courseName: string;
10
+ totalQuestions: number;
11
+ totalPoints: number;
12
+ passingScore: number;
13
+ isManualReview: boolean;
14
+ }
15
+
16
+ export interface LearnerManualReviewAnswer {
17
+ questionId: string;
18
+ questionText: string;
19
+ questionType: QuestionType;
20
+ questionPoints: number;
21
+ selectedOptionId?: string | null;
22
+ selectedOptionText?: string | null;
23
+ selectedOptionIds?: string[];
24
+ selectedOptions?: Array<{ id: string; text: string }>;
25
+ answerText?: string | null;
26
+ isCorrect?: boolean;
27
+ pointsAwarded?: number;
28
+ }
29
+
30
+ export interface LearnerManualReviewSubmission {
31
+ id: string;
32
+ assignment: LearnerManualReviewAssignment;
33
+ status: LearnerManualReviewStatus;
34
+ score: number;
35
+ passed: boolean | null;
36
+ totalQuestions: number;
37
+ correctAnswers: number;
38
+ wrongAnswers: number;
39
+ totalPoints: number;
40
+ pointsAwarded: number;
41
+ submittedAt: string;
42
+ startedAt: string;
43
+ timeTakenMinutes: number;
44
+ answers: LearnerManualReviewAnswer[];
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ }
48
+
49
+ export interface LearnerManualReviewSummary {
50
+ totalSubmissions: number;
51
+ gradedSubmissions: number;
52
+ inReviewSubmissions: number;
53
+ requestChangeSubmissions: number;
54
+ averageScore: number;
55
+ highestScore: number;
56
+ lowestScore: number;
57
+ passRate: number;
58
+ averageTimeTaken: number;
59
+ }
60
+
61
+ export interface LearnerManualReviewPagination {
62
+ currentPage: number;
63
+ itemsPerPage: number;
64
+ totalItems: number;
65
+ totalPages: number;
66
+ hasNextPage: boolean;
67
+ hasPreviousPage: boolean;
68
+ }
69
+
70
+ export interface LearnerManualReviewResultsResponse {
71
+ data: LearnerManualReviewSubmission[];
72
+ summary: LearnerManualReviewSummary;
73
+ pagination: LearnerManualReviewPagination;
74
+ }
75
+
76
+ export interface LearnerManualReviewFilters {
77
+ courseId?: string;
78
+ activityId?: string;
79
+ status?: LearnerManualReviewStatus;
80
+ minScore?: number;
81
+ maxScore?: number;
82
+ passed?: boolean;
83
+ submittedFrom?: string;
84
+ submittedTo?: string;
85
+ search?: string;
86
+ sortBy?: 'submittedAt' | 'score' | 'status' | 'createdAt';
87
+ page?: number;
88
+ limit?: number;
89
+ }
90
+
91
+ export interface LearnerManualReviewDetailResponse {
92
+ context: {
93
+ learner: { id: string; name: string; email: string };
94
+ assignment: { id: string; title: string; totalPoints: number; totalQuestions: number };
95
+ course: { id: string; name: string };
96
+ enrollmentId: string;
97
+ submittedAt: string;
98
+ status: LearnerManualReviewStatus;
99
+ revisionNumber: number;
100
+ };
101
+ answers: LearnerManualReviewAnswer[];
102
+ latestReview?: {
103
+ score: number;
104
+ feedbackQuestionIds: string[];
105
+ additionalFeedback?: string;
106
+ reviewedAt: string;
107
+ };
108
+ revisionHistory: Array<{
109
+ id: string;
110
+ revisionNumber: number;
111
+ status: string;
112
+ submittedAt: string;
113
+ score: number;
114
+ isCurrent: boolean;
115
+ }>;
116
+ }
@@ -0,0 +1,109 @@
1
+ export interface MessageParticipant {
2
+ id: string;
3
+ name: string;
4
+ email: string;
5
+ avatar?: string;
6
+ role: 'CREATOR' | 'STUDENT';
7
+ }
8
+
9
+ export interface Message {
10
+ id: string;
11
+ conversationId: string;
12
+ senderId: string;
13
+ senderName: string;
14
+ senderRole: 'CREATOR' | 'STUDENT';
15
+ content: string;
16
+ timestamp: string;
17
+ isRead: boolean;
18
+ isDeletedForMe: boolean;
19
+ courseContext?: {
20
+ courseId: string;
21
+ courseName: string;
22
+ };
23
+ }
24
+
25
+ export interface Conversation {
26
+ id: string;
27
+ participant: MessageParticipant;
28
+ lastMessage: {
29
+ content: string;
30
+ timestamp: string;
31
+ senderId: string;
32
+ };
33
+ unreadCount: number;
34
+ isArchived: boolean;
35
+ courseContext?: {
36
+ courseId: string;
37
+ courseName: string;
38
+ moduleName?: string;
39
+ };
40
+ }
41
+
42
+ export interface ConversationMessageItem {
43
+ id: string;
44
+ senderRole: string;
45
+ content: string;
46
+ isRead: boolean;
47
+ timestamp: string;
48
+ context_label?: string;
49
+ }
50
+
51
+ export interface StudentConversationItem {
52
+ conversationId: string;
53
+ creatorName: string;
54
+ creatorEmail: string;
55
+ creatorId: string;
56
+ courseId: string;
57
+ courseTitle: string;
58
+ lastMessageAt: string;
59
+ unreadCount: number;
60
+ msgs?: ConversationMessageItem[];
61
+ }
62
+
63
+ export interface StudentConversationsResponse {
64
+ data: StudentConversationItem[];
65
+ meta: {
66
+ page: number;
67
+ limit: number;
68
+ total: number;
69
+ totalPages: number;
70
+ hasNextPage: boolean;
71
+ hasPreviousPage: boolean;
72
+ };
73
+ }
74
+
75
+ export interface SendCourseMessagePayload {
76
+ content: string;
77
+ conversationId?: string;
78
+ }
79
+
80
+ export interface SendCourseMessageResponse {
81
+ conversation: {
82
+ id: string;
83
+ studentId: string;
84
+ creatorId: string;
85
+ courseId: string;
86
+ lastMessageId: string;
87
+ lastMessageAt: string;
88
+ };
89
+ message: {
90
+ id: string;
91
+ conversationId: string;
92
+ senderId: string;
93
+ senderRole: 'CREATOR' | 'STUDENT';
94
+ content: string;
95
+ createdAt: string;
96
+ isRead: boolean;
97
+ };
98
+ }
99
+
100
+ export interface UnmessagedCourse {
101
+ id: string;
102
+ title: string;
103
+ creatorId: string;
104
+ }
105
+
106
+ export interface UnmessagedCoursesResponse {
107
+ data: UnmessagedCourse[];
108
+ total: number;
109
+ }
@@ -0,0 +1,30 @@
1
+ export type NotificationType = 'NEW_MESSAGE';
2
+ export type NotificationSenderRole = 'STUDENT' | 'CREATOR';
3
+
4
+ export interface NotificationSender {
5
+ id: string;
6
+ name: string;
7
+ userRole: NotificationSenderRole;
8
+ }
9
+
10
+ export interface MessageNotification {
11
+ id: string;
12
+ type: NotificationType;
13
+ conversationId: string;
14
+ messageId: string;
15
+ senderId?: string;
16
+ contextLabel: string;
17
+ messageContent?: string;
18
+ readAt?: string | null;
19
+ createdAt: string;
20
+ sender?: NotificationSender;
21
+ }
22
+
23
+ export interface NotificationListMeta {
24
+ page: number;
25
+ limit: number;
26
+ total: number;
27
+ totalPages: number;
28
+ hasNextPage: boolean;
29
+ hasPreviousPage: boolean;
30
+ }