@memberjunction/actions-bizapps-lms 5.3.1 → 5.4.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 (194) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/LEARNWORLDS_SIDECAR_PLAN.md +845 -0
  4. package/dist/base/base-lms.action.d.ts +26 -4
  5. package/dist/base/base-lms.action.d.ts.map +1 -1
  6. package/dist/base/base-lms.action.js +73 -17
  7. package/dist/base/base-lms.action.js.map +1 -1
  8. package/dist/providers/learnworlds/actions/attach-tags.action.d.ts +26 -0
  9. package/dist/providers/learnworlds/actions/attach-tags.action.d.ts.map +1 -0
  10. package/dist/providers/learnworlds/actions/attach-tags.action.js +79 -0
  11. package/dist/providers/learnworlds/actions/attach-tags.action.js.map +1 -0
  12. package/dist/providers/learnworlds/actions/create-user.action.d.ts +24 -1
  13. package/dist/providers/learnworlds/actions/create-user.action.d.ts.map +1 -1
  14. package/dist/providers/learnworlds/actions/create-user.action.js +166 -142
  15. package/dist/providers/learnworlds/actions/create-user.action.js.map +1 -1
  16. package/dist/providers/learnworlds/actions/detach-tags.action.d.ts +26 -0
  17. package/dist/providers/learnworlds/actions/detach-tags.action.d.ts.map +1 -0
  18. package/dist/providers/learnworlds/actions/detach-tags.action.js +79 -0
  19. package/dist/providers/learnworlds/actions/detach-tags.action.js.map +1 -0
  20. package/dist/providers/learnworlds/actions/enroll-user.action.d.ts +31 -3
  21. package/dist/providers/learnworlds/actions/enroll-user.action.d.ts.map +1 -1
  22. package/dist/providers/learnworlds/actions/enroll-user.action.js +179 -125
  23. package/dist/providers/learnworlds/actions/enroll-user.action.js.map +1 -1
  24. package/dist/providers/learnworlds/actions/get-bulk-data.action.d.ts +79 -0
  25. package/dist/providers/learnworlds/actions/get-bulk-data.action.d.ts.map +1 -0
  26. package/dist/providers/learnworlds/actions/get-bulk-data.action.js +359 -0
  27. package/dist/providers/learnworlds/actions/get-bulk-data.action.js.map +1 -0
  28. package/dist/providers/learnworlds/actions/get-bundles.action.d.ts +34 -0
  29. package/dist/providers/learnworlds/actions/get-bundles.action.d.ts.map +1 -0
  30. package/dist/providers/learnworlds/actions/get-bundles.action.js +107 -0
  31. package/dist/providers/learnworlds/actions/get-bundles.action.js.map +1 -0
  32. package/dist/providers/learnworlds/actions/get-certificates.action.d.ts +33 -2
  33. package/dist/providers/learnworlds/actions/get-certificates.action.d.ts.map +1 -1
  34. package/dist/providers/learnworlds/actions/get-certificates.action.js +311 -244
  35. package/dist/providers/learnworlds/actions/get-certificates.action.js.map +1 -1
  36. package/dist/providers/learnworlds/actions/get-course-analytics.action.d.ts +14 -14
  37. package/dist/providers/learnworlds/actions/get-course-analytics.action.d.ts.map +1 -1
  38. package/dist/providers/learnworlds/actions/get-course-analytics.action.js +234 -226
  39. package/dist/providers/learnworlds/actions/get-course-analytics.action.js.map +1 -1
  40. package/dist/providers/learnworlds/actions/get-course-details.action.d.ts +42 -6
  41. package/dist/providers/learnworlds/actions/get-course-details.action.d.ts.map +1 -1
  42. package/dist/providers/learnworlds/actions/get-course-details.action.js +182 -148
  43. package/dist/providers/learnworlds/actions/get-course-details.action.js.map +1 -1
  44. package/dist/providers/learnworlds/actions/get-courses.action.d.ts +29 -82
  45. package/dist/providers/learnworlds/actions/get-courses.action.d.ts.map +1 -1
  46. package/dist/providers/learnworlds/actions/get-courses.action.js +188 -207
  47. package/dist/providers/learnworlds/actions/get-courses.action.js.map +1 -1
  48. package/dist/providers/learnworlds/actions/get-quiz-results.action.d.ts +22 -2
  49. package/dist/providers/learnworlds/actions/get-quiz-results.action.d.ts.map +1 -1
  50. package/dist/providers/learnworlds/actions/get-quiz-results.action.js +316 -294
  51. package/dist/providers/learnworlds/actions/get-quiz-results.action.js.map +1 -1
  52. package/dist/providers/learnworlds/actions/get-user-details.action.d.ts +23 -59
  53. package/dist/providers/learnworlds/actions/get-user-details.action.d.ts.map +1 -1
  54. package/dist/providers/learnworlds/actions/get-user-details.action.js +113 -114
  55. package/dist/providers/learnworlds/actions/get-user-details.action.js.map +1 -1
  56. package/dist/providers/learnworlds/actions/get-user-enrollments.action.d.ts +43 -5
  57. package/dist/providers/learnworlds/actions/get-user-enrollments.action.d.ts.map +1 -1
  58. package/dist/providers/learnworlds/actions/get-user-enrollments.action.js +191 -147
  59. package/dist/providers/learnworlds/actions/get-user-enrollments.action.js.map +1 -1
  60. package/dist/providers/learnworlds/actions/get-user-progress.action.d.ts +21 -92
  61. package/dist/providers/learnworlds/actions/get-user-progress.action.d.ts.map +1 -1
  62. package/dist/providers/learnworlds/actions/get-user-progress.action.js +145 -166
  63. package/dist/providers/learnworlds/actions/get-user-progress.action.js.map +1 -1
  64. package/dist/providers/learnworlds/actions/get-users.action.d.ts +14 -28
  65. package/dist/providers/learnworlds/actions/get-users.action.d.ts.map +1 -1
  66. package/dist/providers/learnworlds/actions/get-users.action.js +122 -143
  67. package/dist/providers/learnworlds/actions/get-users.action.js.map +1 -1
  68. package/dist/providers/learnworlds/actions/index.d.ts +7 -0
  69. package/dist/providers/learnworlds/actions/index.d.ts.map +1 -1
  70. package/dist/providers/learnworlds/actions/index.js +7 -0
  71. package/dist/providers/learnworlds/actions/index.js.map +1 -1
  72. package/dist/providers/learnworlds/actions/onboard-learner.action.d.ts +53 -0
  73. package/dist/providers/learnworlds/actions/onboard-learner.action.d.ts.map +1 -0
  74. package/dist/providers/learnworlds/actions/onboard-learner.action.js +236 -0
  75. package/dist/providers/learnworlds/actions/onboard-learner.action.js.map +1 -0
  76. package/dist/providers/learnworlds/actions/sso-login.action.d.ts +35 -0
  77. package/dist/providers/learnworlds/actions/sso-login.action.d.ts.map +1 -0
  78. package/dist/providers/learnworlds/actions/sso-login.action.js +101 -0
  79. package/dist/providers/learnworlds/actions/sso-login.action.js.map +1 -0
  80. package/dist/providers/learnworlds/actions/update-user-progress.action.d.ts +12 -1
  81. package/dist/providers/learnworlds/actions/update-user-progress.action.d.ts.map +1 -1
  82. package/dist/providers/learnworlds/actions/update-user-progress.action.js +167 -210
  83. package/dist/providers/learnworlds/actions/update-user-progress.action.js.map +1 -1
  84. package/dist/providers/learnworlds/actions/update-user.action.d.ts +39 -0
  85. package/dist/providers/learnworlds/actions/update-user.action.d.ts.map +1 -0
  86. package/dist/providers/learnworlds/actions/update-user.action.js +168 -0
  87. package/dist/providers/learnworlds/actions/update-user.action.js.map +1 -0
  88. package/dist/providers/learnworlds/index.d.ts +1 -0
  89. package/dist/providers/learnworlds/index.d.ts.map +1 -1
  90. package/dist/providers/learnworlds/index.js +2 -0
  91. package/dist/providers/learnworlds/index.js.map +1 -1
  92. package/dist/providers/learnworlds/interfaces/bundle.types.d.ts +16 -0
  93. package/dist/providers/learnworlds/interfaces/bundle.types.d.ts.map +1 -0
  94. package/dist/providers/learnworlds/interfaces/bundle.types.js +2 -0
  95. package/dist/providers/learnworlds/interfaces/bundle.types.js.map +1 -0
  96. package/dist/providers/learnworlds/interfaces/certificate.types.d.ts +66 -0
  97. package/dist/providers/learnworlds/interfaces/certificate.types.d.ts.map +1 -0
  98. package/dist/providers/learnworlds/interfaces/certificate.types.js +2 -0
  99. package/dist/providers/learnworlds/interfaces/certificate.types.js.map +1 -0
  100. package/dist/providers/learnworlds/interfaces/common.types.d.ts +221 -0
  101. package/dist/providers/learnworlds/interfaces/common.types.d.ts.map +1 -0
  102. package/dist/providers/learnworlds/interfaces/common.types.js +2 -0
  103. package/dist/providers/learnworlds/interfaces/common.types.js.map +1 -0
  104. package/dist/providers/learnworlds/interfaces/course.types.d.ts +393 -0
  105. package/dist/providers/learnworlds/interfaces/course.types.d.ts.map +1 -0
  106. package/dist/providers/learnworlds/interfaces/course.types.js +2 -0
  107. package/dist/providers/learnworlds/interfaces/course.types.js.map +1 -0
  108. package/dist/providers/learnworlds/interfaces/enrollment.types.d.ts +165 -0
  109. package/dist/providers/learnworlds/interfaces/enrollment.types.d.ts.map +1 -0
  110. package/dist/providers/learnworlds/interfaces/enrollment.types.js +2 -0
  111. package/dist/providers/learnworlds/interfaces/enrollment.types.js.map +1 -0
  112. package/dist/providers/learnworlds/interfaces/index.d.ts +12 -0
  113. package/dist/providers/learnworlds/interfaces/index.d.ts.map +1 -0
  114. package/dist/providers/learnworlds/interfaces/index.js +13 -0
  115. package/dist/providers/learnworlds/interfaces/index.js.map +1 -0
  116. package/dist/providers/learnworlds/interfaces/onboarding.types.d.ts +39 -0
  117. package/dist/providers/learnworlds/interfaces/onboarding.types.d.ts.map +1 -0
  118. package/dist/providers/learnworlds/interfaces/onboarding.types.js +2 -0
  119. package/dist/providers/learnworlds/interfaces/onboarding.types.js.map +1 -0
  120. package/dist/providers/learnworlds/interfaces/quiz.types.d.ts +108 -0
  121. package/dist/providers/learnworlds/interfaces/quiz.types.d.ts.map +1 -0
  122. package/dist/providers/learnworlds/interfaces/quiz.types.js +2 -0
  123. package/dist/providers/learnworlds/interfaces/quiz.types.js.map +1 -0
  124. package/dist/providers/learnworlds/interfaces/sso.types.d.ts +18 -0
  125. package/dist/providers/learnworlds/interfaces/sso.types.d.ts.map +1 -0
  126. package/dist/providers/learnworlds/interfaces/sso.types.js +2 -0
  127. package/dist/providers/learnworlds/interfaces/sso.types.js.map +1 -0
  128. package/dist/providers/learnworlds/interfaces/sync.types.d.ts +44 -0
  129. package/dist/providers/learnworlds/interfaces/sync.types.d.ts.map +1 -0
  130. package/dist/providers/learnworlds/interfaces/sync.types.js +2 -0
  131. package/dist/providers/learnworlds/interfaces/sync.types.js.map +1 -0
  132. package/dist/providers/learnworlds/interfaces/tag.types.d.ts +17 -0
  133. package/dist/providers/learnworlds/interfaces/tag.types.d.ts.map +1 -0
  134. package/dist/providers/learnworlds/interfaces/tag.types.js +2 -0
  135. package/dist/providers/learnworlds/interfaces/tag.types.js.map +1 -0
  136. package/dist/providers/learnworlds/interfaces/user.types.d.ts +198 -0
  137. package/dist/providers/learnworlds/interfaces/user.types.d.ts.map +1 -0
  138. package/dist/providers/learnworlds/interfaces/user.types.js +2 -0
  139. package/dist/providers/learnworlds/interfaces/user.types.js.map +1 -0
  140. package/dist/providers/learnworlds/learnworlds-base.action.d.ts +111 -7
  141. package/dist/providers/learnworlds/learnworlds-base.action.d.ts.map +1 -1
  142. package/dist/providers/learnworlds/learnworlds-base.action.js +293 -56
  143. package/dist/providers/learnworlds/learnworlds-base.action.js.map +1 -1
  144. package/package.json +8 -7
  145. package/src/__tests__/attach-tags.action.test.ts +137 -0
  146. package/src/__tests__/create-user.action.test.ts +311 -0
  147. package/src/__tests__/detach-tags.action.test.ts +136 -0
  148. package/src/__tests__/enroll-user.action.test.ts +283 -0
  149. package/src/__tests__/get-bulk-data.action.test.ts +649 -0
  150. package/src/__tests__/get-bundles.action.test.ts +215 -0
  151. package/src/__tests__/lms.test.ts +275 -184
  152. package/src/__tests__/onboard-learner.action.test.ts +455 -0
  153. package/src/__tests__/sso-login.action.test.ts +256 -0
  154. package/src/__tests__/update-user.action.test.ts +350 -0
  155. package/src/base/base-lms.action.ts +226 -163
  156. package/src/providers/learnworlds/actions/attach-tags.action.ts +90 -0
  157. package/src/providers/learnworlds/actions/create-user.action.ts +291 -235
  158. package/src/providers/learnworlds/actions/detach-tags.action.ts +90 -0
  159. package/src/providers/learnworlds/actions/enroll-user.action.ts +326 -220
  160. package/src/providers/learnworlds/actions/get-bulk-data.action.ts +438 -0
  161. package/src/providers/learnworlds/actions/get-bundles.action.ts +139 -0
  162. package/src/providers/learnworlds/actions/get-certificates.action.ts +499 -309
  163. package/src/providers/learnworlds/actions/get-course-analytics.action.ts +470 -337
  164. package/src/providers/learnworlds/actions/get-course-details.action.ts +395 -249
  165. package/src/providers/learnworlds/actions/get-courses.action.ts +508 -565
  166. package/src/providers/learnworlds/actions/get-quiz-results.action.ts +606 -381
  167. package/src/providers/learnworlds/actions/get-user-details.action.ts +335 -349
  168. package/src/providers/learnworlds/actions/get-user-enrollments.action.ts +328 -228
  169. package/src/providers/learnworlds/actions/get-user-progress.action.ts +522 -571
  170. package/src/providers/learnworlds/actions/get-users.action.ts +231 -282
  171. package/src/providers/learnworlds/actions/index.ts +8 -1
  172. package/src/providers/learnworlds/actions/onboard-learner.action.ts +286 -0
  173. package/src/providers/learnworlds/actions/sso-login.action.ts +116 -0
  174. package/src/providers/learnworlds/actions/update-user-progress.action.ts +301 -263
  175. package/src/providers/learnworlds/actions/update-user.action.ts +181 -0
  176. package/src/providers/learnworlds/index.ts +4 -1
  177. package/src/providers/learnworlds/interfaces/bundle.types.ts +17 -0
  178. package/src/providers/learnworlds/interfaces/certificate.types.ts +69 -0
  179. package/src/providers/learnworlds/interfaces/common.types.ts +233 -0
  180. package/src/providers/learnworlds/interfaces/course.types.ts +411 -0
  181. package/src/providers/learnworlds/interfaces/enrollment.types.ts +176 -0
  182. package/src/providers/learnworlds/interfaces/index.ts +12 -0
  183. package/src/providers/learnworlds/interfaces/onboarding.types.ts +41 -0
  184. package/src/providers/learnworlds/interfaces/quiz.types.ts +118 -0
  185. package/src/providers/learnworlds/interfaces/sso.types.ts +19 -0
  186. package/src/providers/learnworlds/interfaces/sync.types.ts +46 -0
  187. package/src/providers/learnworlds/interfaces/tag.types.ts +18 -0
  188. package/src/providers/learnworlds/interfaces/user.types.ts +204 -0
  189. package/src/providers/learnworlds/learnworlds-base.action.ts +468 -210
  190. package/tsconfig.json +1 -1
  191. package/dist/__tests__/lms.test.d.ts +0 -2
  192. package/dist/__tests__/lms.test.d.ts.map +0 -1
  193. package/dist/__tests__/lms.test.js +0 -232
  194. package/dist/__tests__/lms.test.js.map +0 -1
@@ -0,0 +1,411 @@
1
+ import { LearnWorldsBaseParams, LearnWorldsCourse } from './common.types';
2
+
3
+ /**
4
+ * Parameters for the GetCourses action
5
+ */
6
+ export interface GetCoursesParams extends LearnWorldsBaseParams {
7
+ SearchText?: string;
8
+ Status?: string;
9
+ CategoryID?: string;
10
+ Level?: string;
11
+ Language?: string;
12
+ OnlyFree?: boolean;
13
+ MinPrice?: number;
14
+ MaxPrice?: number;
15
+ Tags?: string;
16
+ InstructorID?: string;
17
+ CreatedAfter?: string;
18
+ CreatedBefore?: string;
19
+ SortBy?: string;
20
+ SortOrder?: 'asc' | 'desc';
21
+ IncludeEnrollmentStats?: boolean;
22
+ MaxResults?: number;
23
+ }
24
+
25
+ /**
26
+ * Result of the GetCourses action
27
+ */
28
+ export interface GetCoursesResult {
29
+ Courses: LearnWorldsCourse[];
30
+ TotalCount: number;
31
+ Summary: CourseCatalogSummary;
32
+ }
33
+
34
+ /**
35
+ * Summary statistics for the course catalog
36
+ */
37
+ export interface CourseCatalogSummary {
38
+ totalCourses: number;
39
+ publishedCourses: number;
40
+ draftCourses: number;
41
+ freeCourses: number;
42
+ paidCourses: number;
43
+ categoryCounts: Record<string, number>;
44
+ levelCounts: Record<string, number>;
45
+ languageCounts: Record<string, number>;
46
+ enrollmentStats: {
47
+ totalEnrollments: number;
48
+ averageEnrollmentsPerCourse: number;
49
+ mostPopularCourses: Array<{
50
+ id: string;
51
+ title: string;
52
+ enrollments: number;
53
+ }>;
54
+ };
55
+ priceStats: {
56
+ averagePrice: number;
57
+ minPrice: number;
58
+ maxPrice: number;
59
+ currency: string;
60
+ };
61
+ }
62
+
63
+ /**
64
+ * Parameters for the GetCourseDetails action
65
+ */
66
+ export interface GetCourseDetailsParams extends LearnWorldsBaseParams {
67
+ CourseID: string;
68
+ IncludeModules?: boolean;
69
+ IncludeInstructors?: boolean;
70
+ IncludeStats?: boolean;
71
+ }
72
+
73
+ /**
74
+ * Result of the GetCourseDetails action
75
+ */
76
+ export interface GetCourseDetailsResult {
77
+ CourseDetails: CourseDetailsData;
78
+ Summary: CourseDetailsSummary;
79
+ }
80
+
81
+ export interface CourseDetailsData {
82
+ id: string;
83
+ title: string;
84
+ slug?: string;
85
+ description?: string;
86
+ shortDescription?: string;
87
+ status: string;
88
+ price: number;
89
+ originalPrice?: number;
90
+ currency: string;
91
+ level: string;
92
+ language: string;
93
+ duration?: number;
94
+ durationText?: string;
95
+ totalEnrollments: number;
96
+ averageRating?: number;
97
+ totalRatings: number;
98
+ tags: string[];
99
+ categories: string[];
100
+ imageUrl?: string;
101
+ videoUrl?: string;
102
+ certificateEnabled: boolean;
103
+ createdAt?: string;
104
+ updatedAt?: string;
105
+ publishedAt?: string;
106
+ modules?: CourseModule[];
107
+ totalModules?: number;
108
+ totalLessons?: number;
109
+ instructors?: CourseInstructor[];
110
+ stats?: CourseStats;
111
+ }
112
+
113
+ export interface CourseModule {
114
+ id: string;
115
+ title: string;
116
+ description?: string;
117
+ order: number;
118
+ duration?: number;
119
+ durationText?: string;
120
+ totalLessons: number;
121
+ lessons: CourseLesson[];
122
+ }
123
+
124
+ export interface CourseLesson {
125
+ id: string;
126
+ title: string;
127
+ type: string;
128
+ duration?: number;
129
+ durationText?: string;
130
+ order: number;
131
+ isFree: boolean;
132
+ hasVideo: boolean;
133
+ hasQuiz: boolean;
134
+ hasAssignment: boolean;
135
+ }
136
+
137
+ export interface CourseInstructor {
138
+ id: string;
139
+ name: string;
140
+ email?: string;
141
+ bio?: string;
142
+ title?: string;
143
+ imageUrl?: string;
144
+ totalCourses: number;
145
+ totalStudents: number;
146
+ averageRating: number;
147
+ }
148
+
149
+ export interface CourseStats {
150
+ totalEnrollments: number;
151
+ activeStudents: number;
152
+ completionRate: number;
153
+ averageProgressPercentage: number;
154
+ averageTimeToComplete?: number;
155
+ totalRevenue: number;
156
+ }
157
+
158
+ /**
159
+ * Summary view of course details
160
+ */
161
+ export interface CourseDetailsSummary {
162
+ courseId: string;
163
+ title: string;
164
+ status: string;
165
+ level: string;
166
+ duration?: string;
167
+ totalModules: number;
168
+ totalLessons: number;
169
+ totalEnrollments: number;
170
+ averageRating: number;
171
+ certificateEnabled: boolean;
172
+ price: number;
173
+ currency: string;
174
+ }
175
+
176
+ /**
177
+ * Parameters for the GetCourseAnalytics action
178
+ */
179
+ export interface GetCourseAnalyticsParams extends LearnWorldsBaseParams {
180
+ CourseID: string;
181
+ DateFrom?: string;
182
+ DateTo?: string;
183
+ IncludeUserBreakdown?: boolean;
184
+ IncludeModuleStats?: boolean;
185
+ IncludeRevenue?: boolean;
186
+ }
187
+
188
+ /**
189
+ * Result of the GetCourseAnalytics action
190
+ */
191
+ export interface GetCourseAnalyticsResult {
192
+ CourseAnalytics: CourseAnalyticsData;
193
+ Summary: CourseAnalyticsSummary;
194
+ }
195
+
196
+ /**
197
+ * Summary produced alongside the course analytics payload
198
+ */
199
+ export interface CourseAnalyticsSummary {
200
+ courseId: string;
201
+ period: { from: string; to: string };
202
+ keyMetrics: {
203
+ totalEnrollments: number;
204
+ completionRate: number;
205
+ averageProgress: number;
206
+ activeStudents: number;
207
+ averageTimeSpent: string;
208
+ certificatesIssued: number;
209
+ };
210
+ trends: {
211
+ enrollmentGrowth: string;
212
+ engagementTrend: string;
213
+ completionTrend: string;
214
+ };
215
+ }
216
+
217
+ /**
218
+ * User breakdown data for course analytics
219
+ */
220
+ export interface CourseAnalyticsUserBreakdown {
221
+ total: number;
222
+ progressDistribution: {
223
+ notStarted: number;
224
+ under25: number;
225
+ between25And50: number;
226
+ between50And75: number;
227
+ between75And99: number;
228
+ completed: number;
229
+ };
230
+ percentageDistribution: Record<string, string>;
231
+ }
232
+
233
+ /**
234
+ * Formatted module-level statistics for course analytics
235
+ */
236
+ export interface CourseAnalyticsModuleStat {
237
+ moduleId: string;
238
+ moduleTitle: string;
239
+ completionRate: number;
240
+ averageProgress: number;
241
+ averageTimeSpent: number;
242
+ averageTimeSpentText: string;
243
+ studentsStarted: number;
244
+ studentsCompleted: number;
245
+ lessons: CourseAnalyticsLessonStat[];
246
+ }
247
+
248
+ /**
249
+ * Formatted lesson-level statistics nested inside module stats
250
+ */
251
+ export interface CourseAnalyticsLessonStat {
252
+ lessonId: string;
253
+ lessonTitle: string;
254
+ completionRate: number;
255
+ averageTimeSpent: number;
256
+ viewCount: number;
257
+ }
258
+
259
+ /**
260
+ * A single data point in a time-series trend (enrollment, revenue, DAU, etc.)
261
+ */
262
+ export interface TrendDataPoint {
263
+ date?: string;
264
+ value?: number;
265
+ label?: string;
266
+ }
267
+
268
+ export interface CourseAnalyticsData {
269
+ courseId: string;
270
+ period: { from: string; to: string };
271
+ enrollment: {
272
+ totalEnrollments: number;
273
+ newEnrollments: number;
274
+ activeStudents: number;
275
+ enrollmentTrend: TrendDataPoint[];
276
+ };
277
+ progress: {
278
+ averageProgressPercentage: number;
279
+ completionRate: number;
280
+ totalCompletions: number;
281
+ inProgressCount: number;
282
+ notStartedCount: number;
283
+ dropoutRate: number;
284
+ };
285
+ engagement: {
286
+ averageTimeSpent: number;
287
+ averageTimeSpentText: string;
288
+ totalTimeSpent: number;
289
+ totalTimeSpentText: string;
290
+ averageSessionDuration: number;
291
+ lastActivityDate?: string;
292
+ dailyActiveUsers: TrendDataPoint[];
293
+ };
294
+ performance: {
295
+ averageQuizScore: number;
296
+ passRate: number;
297
+ certificatesIssued: number;
298
+ averageTimeToComplete: number;
299
+ averageTimeToCompleteText: string;
300
+ };
301
+ revenue?: {
302
+ totalRevenue: number;
303
+ currency: string;
304
+ averageOrderValue: number;
305
+ totalOrders: number;
306
+ revenueTrend: TrendDataPoint[];
307
+ topMarkets: TrendDataPoint[];
308
+ };
309
+ moduleStats?: CourseAnalyticsModuleStat[];
310
+ userBreakdown?: CourseAnalyticsUserBreakdown;
311
+ }
312
+
313
+ /**
314
+ * Course progress detail interfaces used by GetUserProgress
315
+ */
316
+ export interface CourseProgress {
317
+ courseId: string;
318
+ courseTitle: string;
319
+ enrollmentId: string;
320
+ enrolledAt: Date;
321
+ lastAccessedAt?: Date;
322
+ progressPercentage: number;
323
+ completedUnits: number;
324
+ totalUnits: number;
325
+ completedLessons: number;
326
+ totalLessons: number;
327
+ totalTimeSpent: number;
328
+ averageSessionTime: number;
329
+ estimatedTimeToComplete?: number;
330
+ quizScoreAverage?: number;
331
+ assignmentsCompleted?: number;
332
+ assignmentsTotal?: number;
333
+ currentGrade?: number;
334
+ status: 'not_started' | 'in_progress' | 'completed' | 'expired';
335
+ completedAt?: Date;
336
+ expiresAt?: Date;
337
+ certificateEarned: boolean;
338
+ certificateUrl?: string;
339
+ unitProgress?: UnitProgress[];
340
+ }
341
+
342
+ export interface UnitProgress {
343
+ unitId: string;
344
+ unitTitle: string;
345
+ unitType: 'section' | 'chapter' | 'module';
346
+ order: number;
347
+ progressPercentage: number;
348
+ completedLessons: number;
349
+ totalLessons: number;
350
+ timeSpent: number;
351
+ status: 'not_started' | 'in_progress' | 'completed';
352
+ startedAt?: Date;
353
+ completedAt?: Date;
354
+ lessons?: LessonProgress[];
355
+ }
356
+
357
+ export interface LessonProgress {
358
+ lessonId: string;
359
+ lessonTitle: string;
360
+ lessonType: 'video' | 'text' | 'quiz' | 'assignment' | 'scorm' | 'interactive';
361
+ order: number;
362
+ completed: boolean;
363
+ progressPercentage: number;
364
+ timeSpent: number;
365
+ startedAt?: Date;
366
+ completedAt?: Date;
367
+ lastAccessedAt?: Date;
368
+ videoWatchTime?: number;
369
+ videoTotalTime?: number;
370
+ quizScore?: number;
371
+ quizMaxScore?: number;
372
+ quizAttempts?: number;
373
+ assignmentSubmitted?: boolean;
374
+ assignmentGrade?: number;
375
+ }
376
+
377
+ export interface UserLearningProgress {
378
+ userId: string;
379
+ userEmail: string;
380
+ totalCourses: number;
381
+ coursesCompleted: number;
382
+ coursesInProgress: number;
383
+ coursesNotStarted: number;
384
+ overallProgressPercentage: number;
385
+ totalTimeSpent: number;
386
+ totalCertificatesEarned: number;
387
+ averageQuizScore?: number;
388
+ courses: CourseProgress[];
389
+ learningStreak?: number;
390
+ lastLearningDate?: Date;
391
+ mostActiveDay?: string;
392
+ preferredLearningTime?: string;
393
+ }
394
+
395
+ /**
396
+ * Parameters for the GetUserProgress action
397
+ */
398
+ export interface GetUserProgressParams extends LearnWorldsBaseParams {
399
+ UserID: string;
400
+ CourseID?: string;
401
+ IncludeUnitDetails?: boolean;
402
+ IncludeLessonDetails?: boolean;
403
+ }
404
+
405
+ /**
406
+ * Result of the GetUserProgress action
407
+ */
408
+ export interface GetUserProgressResult {
409
+ UserProgress: UserLearningProgress;
410
+ Summary: Record<string, unknown>;
411
+ }
@@ -0,0 +1,176 @@
1
+ import { LearnWorldsBaseParams, LearnWorldsEnrollment } from './common.types';
2
+
3
+ /**
4
+ * Parameters for the EnrollUser action.
5
+ * Supports both course and bundle enrollment via ProductType.
6
+ */
7
+ export interface EnrollUserParams extends LearnWorldsBaseParams {
8
+ UserID: string;
9
+ CourseID: string;
10
+ ProductType?: 'course' | 'bundle';
11
+ Price?: number;
12
+ Justification?: string;
13
+ NotifyUser?: boolean;
14
+ StartDate?: string;
15
+ ExpiryDate?: string;
16
+ }
17
+
18
+ /**
19
+ * Result of the EnrollUser action
20
+ */
21
+ export interface EnrollUserResult {
22
+ EnrollmentDetails: LearnWorldsEnrollment;
23
+ Summary: EnrollUserSummary;
24
+ }
25
+
26
+ export interface EnrollUserSummary {
27
+ enrollmentId: string;
28
+ userId: string;
29
+ userName: string;
30
+ courseId: string;
31
+ courseTitle: string;
32
+ enrolledAt: string;
33
+ status: string;
34
+ price: number;
35
+ notificationSent: boolean;
36
+ }
37
+
38
+ /**
39
+ * Parameters for the GetUserEnrollments action
40
+ */
41
+ export interface GetUserEnrollmentsParams extends LearnWorldsBaseParams {
42
+ UserID: string;
43
+ Status?: string;
44
+ IncludeExpired?: boolean;
45
+ IncludeCourseDetails?: boolean;
46
+ SortBy?: string;
47
+ SortOrder?: 'asc' | 'desc';
48
+ MaxResults?: number;
49
+ }
50
+
51
+ /**
52
+ * Result of the GetUserEnrollments action
53
+ */
54
+ export interface GetUserEnrollmentsResult {
55
+ Enrollments: FormattedEnrollment[];
56
+ TotalCount: number;
57
+ Summary: EnrollmentsSummary;
58
+ }
59
+
60
+ export interface FormattedEnrollment {
61
+ id: string;
62
+ courseId: string;
63
+ enrolledAt?: string;
64
+ startsAt?: string;
65
+ expiresAt?: string;
66
+ status: string;
67
+ progress: {
68
+ percentage: number;
69
+ completedUnits: number;
70
+ totalUnits: number;
71
+ completedLessons: number;
72
+ totalLessons: number;
73
+ lastAccessedAt?: string;
74
+ totalTimeSpent: number;
75
+ totalTimeSpentText: string;
76
+ };
77
+ grade?: number;
78
+ certificateEligible: boolean;
79
+ certificateIssuedAt?: string;
80
+ completedAt?: string;
81
+ course?: {
82
+ id: string;
83
+ title: string;
84
+ description?: string;
85
+ imageUrl?: string;
86
+ level?: string;
87
+ duration?: number;
88
+ durationText?: string;
89
+ instructorName?: string;
90
+ certificateEnabled: boolean;
91
+ };
92
+ }
93
+
94
+ export interface EnrollmentsSummary {
95
+ userId: string;
96
+ totalEnrollments: number;
97
+ activeEnrollments: number;
98
+ completedEnrollments: number;
99
+ expiredEnrollments: number;
100
+ inProgressEnrollments: number;
101
+ averageProgressPercentage: number;
102
+ totalTimeSpent: number;
103
+ totalTimeSpentText: string;
104
+ certificatesEarned: number;
105
+ enrollmentsByStatus: {
106
+ active: number;
107
+ completed: number;
108
+ expired: number;
109
+ };
110
+ }
111
+
112
+ /**
113
+ * Parameters for the UpdateUserProgress action
114
+ */
115
+ export interface UpdateUserProgressParams extends LearnWorldsBaseParams {
116
+ UserID: string;
117
+ CourseID: string;
118
+ LessonID?: string;
119
+ ProgressPercentage?: number;
120
+ Completed?: boolean;
121
+ TimeSpent?: number;
122
+ Score?: number;
123
+ Notes?: string;
124
+ }
125
+
126
+ /**
127
+ * Result of the UpdateUserProgress action
128
+ */
129
+ export interface UpdateUserProgressResult {
130
+ ProgressDetails: ProgressDetails;
131
+ Summary: ProgressUpdateSummary;
132
+ }
133
+
134
+ export interface ProgressDetails {
135
+ userId: string;
136
+ courseId: string;
137
+ lessonId?: string;
138
+ previousProgress: {
139
+ percentage: number;
140
+ completedUnits: number;
141
+ totalTimeSpent: number;
142
+ };
143
+ updatedProgress: {
144
+ percentage: number;
145
+ completedUnits: number;
146
+ totalUnits: number;
147
+ totalTimeSpent: number;
148
+ totalTimeSpentText: string;
149
+ lastAccessedAt: string;
150
+ completed: boolean;
151
+ completedAt?: string;
152
+ };
153
+ updateType: 'lesson' | 'course';
154
+ updateResult: ProgressUpdateResult;
155
+ }
156
+
157
+ /**
158
+ * Accumulator for progress update results (lesson and/or course)
159
+ */
160
+ export interface ProgressUpdateResult {
161
+ lessonProgress?: Record<string, unknown>;
162
+ courseProgress?: Record<string, unknown>;
163
+ }
164
+
165
+ export interface ProgressUpdateSummary {
166
+ userId: string;
167
+ courseId: string;
168
+ lessonId?: string;
169
+ progressIncreased: boolean;
170
+ previousPercentage: number;
171
+ newPercentage: number;
172
+ timeAdded: number;
173
+ totalTimeSpent: number;
174
+ isCompleted: boolean;
175
+ updateType: 'lesson' | 'course';
176
+ }
@@ -0,0 +1,12 @@
1
+ // Barrel export for all LearnWorlds interface types
2
+ export * from './common.types';
3
+ export * from './user.types';
4
+ export * from './course.types';
5
+ export * from './enrollment.types';
6
+ export * from './sso.types';
7
+ export * from './tag.types';
8
+ export * from './onboarding.types';
9
+ export * from './quiz.types';
10
+ export * from './certificate.types';
11
+ export * from './bundle.types';
12
+ export * from './sync.types';
@@ -0,0 +1,41 @@
1
+ import { LearnWorldsBaseParams } from './common.types';
2
+
3
+ /**
4
+ * Parameters for the OnboardLearner orchestration action.
5
+ * Composes CreateUser + EnrollUser + SSO in a single call.
6
+ */
7
+ export interface OnboardLearnerParams extends LearnWorldsBaseParams {
8
+ Email: string;
9
+ FirstName?: string;
10
+ LastName?: string;
11
+ Role?: string;
12
+ Tags?: string[];
13
+ CustomFields?: Record<string, unknown>;
14
+ CourseIDs?: string[];
15
+ BundleIDs?: string[];
16
+ RedirectTo?: string;
17
+ SendWelcomeEmail?: boolean;
18
+ }
19
+
20
+ /**
21
+ * Result of the OnboardLearner action
22
+ */
23
+ export interface OnboardLearnerResult {
24
+ Success: boolean;
25
+ LoginURL?: string;
26
+ LearnWorldsUserId: string;
27
+ IsNewUser: boolean;
28
+ Enrollments: OnboardLearnerEnrollmentResult[];
29
+ Errors: string[];
30
+ }
31
+
32
+ /**
33
+ * Per-enrollment result within OnboardLearner
34
+ */
35
+ export interface OnboardLearnerEnrollmentResult {
36
+ productId: string;
37
+ productType: 'course' | 'bundle';
38
+ success: boolean;
39
+ enrollmentId?: string;
40
+ error?: string;
41
+ }