@iblai/web-utils 1.2.8 → 1.2.9

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.
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Types for the course-metadata feature slice.
3
+ *
4
+ * These mirror the shapes returned by LMS edX course metadata / outline /
5
+ * enrollment eligibility endpoints. They are not present in
6
+ * @iblai/iblai-api so we co-locate them with the slice.
7
+ */
8
+ export interface CourseOutlineChildNode {
9
+ id: string;
10
+ block_id: string;
11
+ lms_web_url?: string;
12
+ legacy_web_url?: string;
13
+ student_view_url?: string;
14
+ type: string;
15
+ display_name: string;
16
+ graded?: boolean;
17
+ start?: string;
18
+ has_score?: boolean;
19
+ resume_block?: boolean;
20
+ completion?: number;
21
+ complete?: boolean;
22
+ scored?: boolean;
23
+ num_graded_problems?: number;
24
+ children?: CourseOutlineChildNode[];
25
+ special_exam_info?: boolean;
26
+ }
27
+ export interface CourseOutlineResponse {
28
+ display_name: string;
29
+ graded: boolean;
30
+ has_scheduled_content: boolean;
31
+ has_score: boolean;
32
+ id: string;
33
+ legacy_web_url: string;
34
+ lms_web_url: string;
35
+ num_graded_problems: number;
36
+ resume_block: boolean;
37
+ scored: boolean;
38
+ start: string;
39
+ student_view_url: string;
40
+ type: string;
41
+ children: CourseOutlineChildNode[];
42
+ }
43
+ export interface CourseEligibilityResponse {
44
+ is_enrolled: boolean;
45
+ can_enroll: boolean;
46
+ invitation_only: boolean;
47
+ is_admin: boolean;
48
+ is_eligible?: boolean;
49
+ }
50
+ export interface CourseEnrollmentRequest {
51
+ course_details: {
52
+ course_id: string;
53
+ };
54
+ }
55
+ export interface CourseMode {
56
+ slug: string;
57
+ name: string;
58
+ min_price: number;
59
+ suggested_prices: string;
60
+ currency: string;
61
+ expiration_datetime: string | null;
62
+ description: string | null;
63
+ sku: string | null;
64
+ bulk_sku: string | null;
65
+ }
66
+ export interface CourseEnrollmentResponse {
67
+ created: string;
68
+ mode: string;
69
+ is_active: boolean;
70
+ course_details: {
71
+ course_id: string;
72
+ course_name: string;
73
+ enrollment_start: string;
74
+ enrollment_end: string | null;
75
+ course_start: string;
76
+ course_end: string | null;
77
+ invite_only: boolean;
78
+ course_modes: CourseMode[];
79
+ pacing_type: string;
80
+ };
81
+ user: string;
82
+ }
83
+ export interface CertificateData {
84
+ cert_status: string;
85
+ cert_web_view_url: string | null;
86
+ download_url: string | null;
87
+ certificate_available_date: string | null;
88
+ }
89
+ export interface CompletionSummary {
90
+ complete_count: number;
91
+ incomplete_count: number;
92
+ locked_count: number;
93
+ }
94
+ export interface CourseGrade {
95
+ letter_grade: string | null;
96
+ percent: number;
97
+ is_passing: boolean;
98
+ }
99
+ export interface AssignmentPolicy {
100
+ num_droppable: number;
101
+ num_total: number;
102
+ short_label: string;
103
+ type: string;
104
+ weight: number;
105
+ }
106
+ export interface GradeRange {
107
+ Pass: number;
108
+ }
109
+ export interface GradingPolicy {
110
+ assignment_policies: AssignmentPolicy[];
111
+ grade_range: GradeRange;
112
+ }
113
+ export interface Subsection {
114
+ assignment_type: string | null;
115
+ block_key: string;
116
+ display_name: string;
117
+ has_graded_assignment: boolean;
118
+ override: unknown | null;
119
+ learner_has_access: boolean;
120
+ num_points_earned: number;
121
+ num_points_possible: number;
122
+ percent_graded: number;
123
+ problem_scores: unknown[];
124
+ show_correctness: string;
125
+ show_grades: boolean;
126
+ url: string;
127
+ }
128
+ export interface SectionScore {
129
+ display_name: string;
130
+ subsections: Subsection[];
131
+ }
132
+ export interface VerificationData {
133
+ link: string | null;
134
+ status: string;
135
+ status_date: string | null;
136
+ }
137
+ export interface CourseProgress {
138
+ can_show_upgrade_sock: boolean;
139
+ verified_mode: string | null;
140
+ access_expiration: string | null;
141
+ certificate_data: CertificateData;
142
+ completion_summary: CompletionSummary;
143
+ course_grade: CourseGrade;
144
+ credit_course_requirements: unknown | null;
145
+ end: string | null;
146
+ enrollment_mode: string;
147
+ grading_policy: GradingPolicy;
148
+ has_scheduled_content: boolean;
149
+ section_scores: SectionScore[];
150
+ studio_url: string;
151
+ username: string;
152
+ user_has_passing_grade: boolean;
153
+ verification_data: VerificationData;
154
+ }
155
+ export interface CourseCompletionData {
156
+ total_units: number;
157
+ total_blocks: number;
158
+ total_sections: number;
159
+ completed_units: number;
160
+ completed_blocks: number;
161
+ total_subsections: number;
162
+ completed_sections: number;
163
+ completed_subsections: number;
164
+ }
165
+ export interface CourseCompletion {
166
+ course_id: string;
167
+ org: string;
168
+ user_id: number;
169
+ username: string;
170
+ completion_percentage: number;
171
+ completed: boolean;
172
+ last_updated: string;
173
+ completion_date: string | null;
174
+ completion_data: CourseCompletionData;
175
+ grading_percentage: number;
176
+ passed: boolean;
177
+ passing_date: string | null;
178
+ grade_data: Record<string, unknown>;
179
+ }