@memberjunction/actions-bizapps-lms 5.3.1 → 5.4.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +26 -0
- package/LEARNWORLDS_SIDECAR_PLAN.md +845 -0
- package/dist/base/base-lms.action.d.ts +26 -4
- package/dist/base/base-lms.action.d.ts.map +1 -1
- package/dist/base/base-lms.action.js +73 -17
- package/dist/base/base-lms.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/attach-tags.action.d.ts +26 -0
- package/dist/providers/learnworlds/actions/attach-tags.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/attach-tags.action.js +79 -0
- package/dist/providers/learnworlds/actions/attach-tags.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/create-user.action.d.ts +24 -1
- package/dist/providers/learnworlds/actions/create-user.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/create-user.action.js +166 -142
- package/dist/providers/learnworlds/actions/create-user.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/detach-tags.action.d.ts +26 -0
- package/dist/providers/learnworlds/actions/detach-tags.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/detach-tags.action.js +79 -0
- package/dist/providers/learnworlds/actions/detach-tags.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/enroll-user.action.d.ts +31 -3
- package/dist/providers/learnworlds/actions/enroll-user.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/enroll-user.action.js +179 -125
- package/dist/providers/learnworlds/actions/enroll-user.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-bulk-data.action.d.ts +79 -0
- package/dist/providers/learnworlds/actions/get-bulk-data.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/get-bulk-data.action.js +359 -0
- package/dist/providers/learnworlds/actions/get-bulk-data.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/get-bundles.action.d.ts +34 -0
- package/dist/providers/learnworlds/actions/get-bundles.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/get-bundles.action.js +107 -0
- package/dist/providers/learnworlds/actions/get-bundles.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/get-certificates.action.d.ts +33 -2
- package/dist/providers/learnworlds/actions/get-certificates.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-certificates.action.js +311 -244
- package/dist/providers/learnworlds/actions/get-certificates.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-analytics.action.d.ts +14 -14
- package/dist/providers/learnworlds/actions/get-course-analytics.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-analytics.action.js +234 -226
- package/dist/providers/learnworlds/actions/get-course-analytics.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-details.action.d.ts +42 -6
- package/dist/providers/learnworlds/actions/get-course-details.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-details.action.js +182 -148
- package/dist/providers/learnworlds/actions/get-course-details.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-courses.action.d.ts +29 -82
- package/dist/providers/learnworlds/actions/get-courses.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-courses.action.js +188 -207
- package/dist/providers/learnworlds/actions/get-courses.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-quiz-results.action.d.ts +22 -2
- package/dist/providers/learnworlds/actions/get-quiz-results.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-quiz-results.action.js +316 -294
- package/dist/providers/learnworlds/actions/get-quiz-results.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-details.action.d.ts +23 -59
- package/dist/providers/learnworlds/actions/get-user-details.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-details.action.js +113 -114
- package/dist/providers/learnworlds/actions/get-user-details.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-enrollments.action.d.ts +43 -5
- package/dist/providers/learnworlds/actions/get-user-enrollments.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-enrollments.action.js +191 -147
- package/dist/providers/learnworlds/actions/get-user-enrollments.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-progress.action.d.ts +21 -92
- package/dist/providers/learnworlds/actions/get-user-progress.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-progress.action.js +145 -166
- package/dist/providers/learnworlds/actions/get-user-progress.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-users.action.d.ts +14 -28
- package/dist/providers/learnworlds/actions/get-users.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-users.action.js +122 -143
- package/dist/providers/learnworlds/actions/get-users.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/index.d.ts +7 -0
- package/dist/providers/learnworlds/actions/index.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/index.js +7 -0
- package/dist/providers/learnworlds/actions/index.js.map +1 -1
- package/dist/providers/learnworlds/actions/onboard-learner.action.d.ts +53 -0
- package/dist/providers/learnworlds/actions/onboard-learner.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/onboard-learner.action.js +236 -0
- package/dist/providers/learnworlds/actions/onboard-learner.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/sso-login.action.d.ts +35 -0
- package/dist/providers/learnworlds/actions/sso-login.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/sso-login.action.js +101 -0
- package/dist/providers/learnworlds/actions/sso-login.action.js.map +1 -0
- package/dist/providers/learnworlds/actions/update-user-progress.action.d.ts +12 -1
- package/dist/providers/learnworlds/actions/update-user-progress.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/update-user-progress.action.js +167 -210
- package/dist/providers/learnworlds/actions/update-user-progress.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/update-user.action.d.ts +39 -0
- package/dist/providers/learnworlds/actions/update-user.action.d.ts.map +1 -0
- package/dist/providers/learnworlds/actions/update-user.action.js +168 -0
- package/dist/providers/learnworlds/actions/update-user.action.js.map +1 -0
- package/dist/providers/learnworlds/index.d.ts +1 -0
- package/dist/providers/learnworlds/index.d.ts.map +1 -1
- package/dist/providers/learnworlds/index.js +2 -0
- package/dist/providers/learnworlds/index.js.map +1 -1
- package/dist/providers/learnworlds/interfaces/bundle.types.d.ts +16 -0
- package/dist/providers/learnworlds/interfaces/bundle.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/bundle.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/bundle.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/certificate.types.d.ts +66 -0
- package/dist/providers/learnworlds/interfaces/certificate.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/certificate.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/certificate.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/common.types.d.ts +221 -0
- package/dist/providers/learnworlds/interfaces/common.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/common.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/common.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/course.types.d.ts +393 -0
- package/dist/providers/learnworlds/interfaces/course.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/course.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/course.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/enrollment.types.d.ts +165 -0
- package/dist/providers/learnworlds/interfaces/enrollment.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/enrollment.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/enrollment.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/index.d.ts +12 -0
- package/dist/providers/learnworlds/interfaces/index.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/index.js +13 -0
- package/dist/providers/learnworlds/interfaces/index.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/onboarding.types.d.ts +39 -0
- package/dist/providers/learnworlds/interfaces/onboarding.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/onboarding.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/onboarding.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/quiz.types.d.ts +108 -0
- package/dist/providers/learnworlds/interfaces/quiz.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/quiz.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/quiz.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/sso.types.d.ts +18 -0
- package/dist/providers/learnworlds/interfaces/sso.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/sso.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/sso.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/sync.types.d.ts +44 -0
- package/dist/providers/learnworlds/interfaces/sync.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/sync.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/sync.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/tag.types.d.ts +17 -0
- package/dist/providers/learnworlds/interfaces/tag.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/tag.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/tag.types.js.map +1 -0
- package/dist/providers/learnworlds/interfaces/user.types.d.ts +198 -0
- package/dist/providers/learnworlds/interfaces/user.types.d.ts.map +1 -0
- package/dist/providers/learnworlds/interfaces/user.types.js +2 -0
- package/dist/providers/learnworlds/interfaces/user.types.js.map +1 -0
- package/dist/providers/learnworlds/learnworlds-base.action.d.ts +111 -7
- package/dist/providers/learnworlds/learnworlds-base.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/learnworlds-base.action.js +293 -56
- package/dist/providers/learnworlds/learnworlds-base.action.js.map +1 -1
- package/package.json +8 -7
- package/src/__tests__/attach-tags.action.test.ts +137 -0
- package/src/__tests__/create-user.action.test.ts +311 -0
- package/src/__tests__/detach-tags.action.test.ts +136 -0
- package/src/__tests__/enroll-user.action.test.ts +283 -0
- package/src/__tests__/get-bulk-data.action.test.ts +649 -0
- package/src/__tests__/get-bundles.action.test.ts +215 -0
- package/src/__tests__/lms.test.ts +275 -184
- package/src/__tests__/onboard-learner.action.test.ts +455 -0
- package/src/__tests__/sso-login.action.test.ts +256 -0
- package/src/__tests__/update-user.action.test.ts +350 -0
- package/src/base/base-lms.action.ts +226 -163
- package/src/providers/learnworlds/actions/attach-tags.action.ts +90 -0
- package/src/providers/learnworlds/actions/create-user.action.ts +291 -235
- package/src/providers/learnworlds/actions/detach-tags.action.ts +90 -0
- package/src/providers/learnworlds/actions/enroll-user.action.ts +326 -220
- package/src/providers/learnworlds/actions/get-bulk-data.action.ts +438 -0
- package/src/providers/learnworlds/actions/get-bundles.action.ts +139 -0
- package/src/providers/learnworlds/actions/get-certificates.action.ts +499 -309
- package/src/providers/learnworlds/actions/get-course-analytics.action.ts +470 -337
- package/src/providers/learnworlds/actions/get-course-details.action.ts +395 -249
- package/src/providers/learnworlds/actions/get-courses.action.ts +508 -565
- package/src/providers/learnworlds/actions/get-quiz-results.action.ts +606 -381
- package/src/providers/learnworlds/actions/get-user-details.action.ts +335 -349
- package/src/providers/learnworlds/actions/get-user-enrollments.action.ts +328 -228
- package/src/providers/learnworlds/actions/get-user-progress.action.ts +522 -571
- package/src/providers/learnworlds/actions/get-users.action.ts +231 -282
- package/src/providers/learnworlds/actions/index.ts +8 -1
- package/src/providers/learnworlds/actions/onboard-learner.action.ts +286 -0
- package/src/providers/learnworlds/actions/sso-login.action.ts +116 -0
- package/src/providers/learnworlds/actions/update-user-progress.action.ts +301 -263
- package/src/providers/learnworlds/actions/update-user.action.ts +181 -0
- package/src/providers/learnworlds/index.ts +4 -1
- package/src/providers/learnworlds/interfaces/bundle.types.ts +17 -0
- package/src/providers/learnworlds/interfaces/certificate.types.ts +69 -0
- package/src/providers/learnworlds/interfaces/common.types.ts +233 -0
- package/src/providers/learnworlds/interfaces/course.types.ts +411 -0
- package/src/providers/learnworlds/interfaces/enrollment.types.ts +176 -0
- package/src/providers/learnworlds/interfaces/index.ts +12 -0
- package/src/providers/learnworlds/interfaces/onboarding.types.ts +41 -0
- package/src/providers/learnworlds/interfaces/quiz.types.ts +118 -0
- package/src/providers/learnworlds/interfaces/sso.types.ts +19 -0
- package/src/providers/learnworlds/interfaces/sync.types.ts +46 -0
- package/src/providers/learnworlds/interfaces/tag.types.ts +18 -0
- package/src/providers/learnworlds/interfaces/user.types.ts +204 -0
- package/src/providers/learnworlds/learnworlds-base.action.ts +468 -210
- package/tsconfig.json +1 -1
- package/dist/__tests__/lms.test.d.ts +0 -2
- package/dist/__tests__/lms.test.d.ts.map +0 -1
- package/dist/__tests__/lms.test.js +0 -232
- package/dist/__tests__/lms.test.js.map +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { LearnWorldsBaseParams } from './common.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for the GetQuizResults action
|
|
5
|
+
*/
|
|
6
|
+
export interface GetQuizResultsParams extends LearnWorldsBaseParams {
|
|
7
|
+
UserID?: string;
|
|
8
|
+
CourseID?: string;
|
|
9
|
+
QuizID?: string;
|
|
10
|
+
IncludeQuestions?: boolean;
|
|
11
|
+
IncludeAnswers?: boolean;
|
|
12
|
+
PassingOnly?: boolean;
|
|
13
|
+
DateFrom?: string;
|
|
14
|
+
DateTo?: string;
|
|
15
|
+
SortBy?: string;
|
|
16
|
+
SortOrder?: 'asc' | 'desc';
|
|
17
|
+
MaxResults?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Result of the GetQuizResults action
|
|
22
|
+
*/
|
|
23
|
+
export interface GetQuizResultsResult {
|
|
24
|
+
QuizResults: FormattedQuizResult[];
|
|
25
|
+
TotalCount: number;
|
|
26
|
+
Summary: QuizResultsSummary;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface FormattedQuizResult {
|
|
30
|
+
id: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
courseId: string;
|
|
33
|
+
quizId: string;
|
|
34
|
+
attemptNumber: number;
|
|
35
|
+
score: number;
|
|
36
|
+
maxScore: number;
|
|
37
|
+
percentage: number;
|
|
38
|
+
passed: boolean;
|
|
39
|
+
passingScore: number;
|
|
40
|
+
startedAt?: string;
|
|
41
|
+
completedAt?: string;
|
|
42
|
+
duration: number;
|
|
43
|
+
durationText: string;
|
|
44
|
+
user?: {
|
|
45
|
+
id: string;
|
|
46
|
+
email: string;
|
|
47
|
+
name: string;
|
|
48
|
+
};
|
|
49
|
+
quiz?: {
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
type: string;
|
|
53
|
+
questionCount?: number;
|
|
54
|
+
};
|
|
55
|
+
questions?: FormattedQuestion[];
|
|
56
|
+
answers?: FormattedAnswer[];
|
|
57
|
+
metrics?: QuizMetrics;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface FormattedQuestion {
|
|
61
|
+
questionNumber: number;
|
|
62
|
+
questionId: string;
|
|
63
|
+
questionText: string;
|
|
64
|
+
questionType: string;
|
|
65
|
+
points: number;
|
|
66
|
+
difficulty: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Possible answer value types from quiz responses.
|
|
71
|
+
*/
|
|
72
|
+
export type QuizAnswerValue = string | number | boolean | string[] | undefined;
|
|
73
|
+
|
|
74
|
+
export interface FormattedAnswer {
|
|
75
|
+
questionNumber: number;
|
|
76
|
+
questionId?: string;
|
|
77
|
+
userAnswer: QuizAnswerValue;
|
|
78
|
+
correctAnswer: QuizAnswerValue;
|
|
79
|
+
isCorrect: boolean;
|
|
80
|
+
pointsEarned: number;
|
|
81
|
+
pointsPossible: number;
|
|
82
|
+
feedback?: string;
|
|
83
|
+
timeSpent?: number;
|
|
84
|
+
answeredAt?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface QuizMetrics {
|
|
88
|
+
correctAnswers: number;
|
|
89
|
+
incorrectAnswers: number;
|
|
90
|
+
totalQuestions: number;
|
|
91
|
+
accuracyRate: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface QuizResultsSummary {
|
|
95
|
+
totalResults: number;
|
|
96
|
+
passedResults: number;
|
|
97
|
+
failedResults: number;
|
|
98
|
+
passRate: number;
|
|
99
|
+
averageScore: number;
|
|
100
|
+
averageDuration: number;
|
|
101
|
+
averageDurationText: string;
|
|
102
|
+
dateRange: {
|
|
103
|
+
from: string;
|
|
104
|
+
to: string;
|
|
105
|
+
};
|
|
106
|
+
filterType: string;
|
|
107
|
+
quizBreakdown: Record<
|
|
108
|
+
string,
|
|
109
|
+
{
|
|
110
|
+
results: FormattedQuizResult[];
|
|
111
|
+
stats: {
|
|
112
|
+
attempts: number;
|
|
113
|
+
averageScore: number;
|
|
114
|
+
passRate: number;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
> | null;
|
|
118
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LearnWorldsBaseParams } from './common.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for the SSOLogin action.
|
|
5
|
+
* Requires either Email or UserID.
|
|
6
|
+
*/
|
|
7
|
+
export interface SSOLoginParams extends LearnWorldsBaseParams {
|
|
8
|
+
Email?: string;
|
|
9
|
+
UserID?: string;
|
|
10
|
+
RedirectTo?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Result of the SSOLogin action
|
|
15
|
+
*/
|
|
16
|
+
export interface SSOLoginResult {
|
|
17
|
+
LoginURL: string;
|
|
18
|
+
LearnWorldsUserID?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LearnWorldsBaseParams, LearnWorldsUser, LearnWorldsCourse, LearnWorldsBundle, LearnWorldsEnrollment, LearnWorldsCertificate } from './common.types';
|
|
2
|
+
import { UserLearningProgress } from './course.types';
|
|
3
|
+
import { FormattedQuizResult } from './quiz.types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Payload for bulk data consumers that need to sync LearnWorlds data
|
|
7
|
+
* into MemberJunction or external systems.
|
|
8
|
+
*/
|
|
9
|
+
export interface LearnWorldsSyncPayload {
|
|
10
|
+
users?: LearnWorldsUser[];
|
|
11
|
+
courses?: LearnWorldsCourse[];
|
|
12
|
+
bundles?: LearnWorldsBundle[];
|
|
13
|
+
enrollments?: LearnWorldsEnrollment[];
|
|
14
|
+
progress?: UserLearningProgress[];
|
|
15
|
+
certificates?: LearnWorldsCertificate[];
|
|
16
|
+
quizResults?: FormattedQuizResult[];
|
|
17
|
+
syncedAt: string;
|
|
18
|
+
companyId: string;
|
|
19
|
+
totalApiCalls: number;
|
|
20
|
+
errors: SyncError[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Error encountered during a sync operation
|
|
25
|
+
*/
|
|
26
|
+
export interface SyncError {
|
|
27
|
+
entity: 'user' | 'course' | 'bundle' | 'enrollment' | 'progress' | 'certificate' | 'quizResult';
|
|
28
|
+
entityId: string;
|
|
29
|
+
operation: 'create' | 'update' | 'delete' | 'read';
|
|
30
|
+
message: string;
|
|
31
|
+
timestamp: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Parameters for the GetBulkData action
|
|
36
|
+
*/
|
|
37
|
+
export interface BulkDataParams extends LearnWorldsBaseParams {
|
|
38
|
+
IncludeUsers?: boolean;
|
|
39
|
+
IncludeCourses?: boolean;
|
|
40
|
+
IncludeBundles?: boolean;
|
|
41
|
+
IncludeEnrollments?: boolean;
|
|
42
|
+
IncludeProgress?: boolean;
|
|
43
|
+
IncludeCertificates?: boolean;
|
|
44
|
+
IncludeQuizResults?: boolean;
|
|
45
|
+
MaxResultsPerEntity?: number;
|
|
46
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LearnWorldsBaseParams } from './common.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for AttachTags / DetachTags actions
|
|
5
|
+
*/
|
|
6
|
+
export interface TagParams extends LearnWorldsBaseParams {
|
|
7
|
+
UserID: string;
|
|
8
|
+
Tags: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Result of tag operations
|
|
13
|
+
*/
|
|
14
|
+
export interface TagResult {
|
|
15
|
+
Success: boolean;
|
|
16
|
+
UserID: string;
|
|
17
|
+
Tags: string[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { LearnWorldsBaseParams, LearnWorldsUser } from './common.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for the CreateUser action
|
|
5
|
+
*/
|
|
6
|
+
export interface CreateUserParams extends LearnWorldsBaseParams {
|
|
7
|
+
Email: string;
|
|
8
|
+
Username?: string;
|
|
9
|
+
Password?: string;
|
|
10
|
+
FirstName?: string;
|
|
11
|
+
LastName?: string;
|
|
12
|
+
Role?: string;
|
|
13
|
+
IsActive?: boolean;
|
|
14
|
+
SendWelcomeEmail?: boolean;
|
|
15
|
+
Tags?: string | string[];
|
|
16
|
+
CustomFields?: Record<string, unknown>;
|
|
17
|
+
EnrollInCourses?: string | string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Result of the CreateUser action
|
|
22
|
+
*/
|
|
23
|
+
export interface CreateUserResult {
|
|
24
|
+
UserDetails: CreateUserDetails;
|
|
25
|
+
EnrollmentResults: CreateUserEnrollmentResult[];
|
|
26
|
+
Summary: CreateUserSummary;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface CreateUserDetails {
|
|
30
|
+
id: string;
|
|
31
|
+
email: string;
|
|
32
|
+
username?: string;
|
|
33
|
+
firstName?: string;
|
|
34
|
+
lastName?: string;
|
|
35
|
+
fullName: string;
|
|
36
|
+
role: string;
|
|
37
|
+
status: string;
|
|
38
|
+
tags: string[];
|
|
39
|
+
customFields: Record<string, unknown>;
|
|
40
|
+
createdAt?: string;
|
|
41
|
+
loginUrl?: string;
|
|
42
|
+
resetPasswordUrl?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface CreateUserEnrollmentResult {
|
|
46
|
+
courseId: string;
|
|
47
|
+
success: boolean;
|
|
48
|
+
enrollmentId?: string;
|
|
49
|
+
error?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CreateUserSummary {
|
|
53
|
+
userId: string;
|
|
54
|
+
email: string;
|
|
55
|
+
username?: string;
|
|
56
|
+
fullName: string;
|
|
57
|
+
role: string;
|
|
58
|
+
status: string;
|
|
59
|
+
welcomeEmailSent: boolean;
|
|
60
|
+
coursesEnrolled: number;
|
|
61
|
+
totalCoursesRequested: number;
|
|
62
|
+
loginUrl?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Parameters for the UpdateUser action
|
|
67
|
+
*/
|
|
68
|
+
export interface UpdateUserParams extends LearnWorldsBaseParams {
|
|
69
|
+
UserID: string;
|
|
70
|
+
Email?: string;
|
|
71
|
+
Username?: string;
|
|
72
|
+
Password?: string;
|
|
73
|
+
FirstName?: string;
|
|
74
|
+
LastName?: string;
|
|
75
|
+
Role?: string;
|
|
76
|
+
IsActive?: boolean;
|
|
77
|
+
Tags?: string[];
|
|
78
|
+
CustomFields?: Record<string, unknown>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Result of the UpdateUser action
|
|
83
|
+
*/
|
|
84
|
+
export interface UpdateUserResult {
|
|
85
|
+
UserDetails: LearnWorldsUser;
|
|
86
|
+
Summary: UpdateUserSummary;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface UpdateUserSummary {
|
|
90
|
+
userId: string;
|
|
91
|
+
email: string;
|
|
92
|
+
fieldsUpdated: string[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Parameters for the GetUsers action
|
|
97
|
+
*/
|
|
98
|
+
export interface GetUsersParams extends LearnWorldsBaseParams {
|
|
99
|
+
SearchText?: string;
|
|
100
|
+
Role?: string;
|
|
101
|
+
Status?: string;
|
|
102
|
+
Tags?: string;
|
|
103
|
+
CreatedAfter?: string;
|
|
104
|
+
CreatedBefore?: string;
|
|
105
|
+
SortBy?: string;
|
|
106
|
+
SortOrder?: 'asc' | 'desc';
|
|
107
|
+
IncludeCourseStats?: boolean;
|
|
108
|
+
MaxResults?: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Result of the GetUsers action
|
|
113
|
+
*/
|
|
114
|
+
export interface GetUsersResult {
|
|
115
|
+
Users: LearnWorldsUser[];
|
|
116
|
+
TotalCount: number;
|
|
117
|
+
Summary: UsersSummary;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface UsersSummary {
|
|
121
|
+
totalUsers: number;
|
|
122
|
+
activeUsers: number;
|
|
123
|
+
inactiveUsers: number;
|
|
124
|
+
suspendedUsers: number;
|
|
125
|
+
usersByRole: Record<string, number>;
|
|
126
|
+
averageCoursesPerUser: number;
|
|
127
|
+
totalTimeSpent: number;
|
|
128
|
+
mostActiveUsers: Array<{ id: string; name: string; completedCourses?: number }>;
|
|
129
|
+
recentSignups: Array<{ id: string; name: string; signupDate: Date }>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Parameters for the GetUserDetails action
|
|
134
|
+
*/
|
|
135
|
+
export interface GetUserDetailsParams extends LearnWorldsBaseParams {
|
|
136
|
+
UserID: string;
|
|
137
|
+
IncludeEnrollments?: boolean;
|
|
138
|
+
IncludeStats?: boolean;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Result of the GetUserDetails action
|
|
143
|
+
*/
|
|
144
|
+
export interface GetUserDetailsResult {
|
|
145
|
+
UserDetails: LearnWorldsUserDetailsFull;
|
|
146
|
+
Summary: Record<string, unknown>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Full user details including enrollment and achievement data
|
|
151
|
+
*/
|
|
152
|
+
export interface LearnWorldsUserDetailsFull {
|
|
153
|
+
id: string;
|
|
154
|
+
email: string;
|
|
155
|
+
username: string;
|
|
156
|
+
firstName?: string;
|
|
157
|
+
lastName?: string;
|
|
158
|
+
fullName?: string;
|
|
159
|
+
status: 'active' | 'inactive' | 'suspended';
|
|
160
|
+
role: string;
|
|
161
|
+
createdAt: Date;
|
|
162
|
+
lastLoginAt?: Date;
|
|
163
|
+
avatarUrl?: string;
|
|
164
|
+
bio?: string;
|
|
165
|
+
location?: string;
|
|
166
|
+
timezone?: string;
|
|
167
|
+
language?: string;
|
|
168
|
+
phone?: string;
|
|
169
|
+
tags?: string[];
|
|
170
|
+
customFields?: Record<string, unknown>;
|
|
171
|
+
totalCourses: number;
|
|
172
|
+
completedCourses: number;
|
|
173
|
+
inProgressCourses: number;
|
|
174
|
+
notStartedCourses: number;
|
|
175
|
+
totalTimeSpent: number;
|
|
176
|
+
averageCompletionRate: number;
|
|
177
|
+
lastActivityDate?: Date;
|
|
178
|
+
enrollments?: UserDetailEnrollment[];
|
|
179
|
+
totalCertificates: number;
|
|
180
|
+
totalBadges: number;
|
|
181
|
+
points?: number;
|
|
182
|
+
level?: string;
|
|
183
|
+
emailNotifications?: boolean;
|
|
184
|
+
twoFactorEnabled?: boolean;
|
|
185
|
+
agreedToTerms?: boolean;
|
|
186
|
+
marketingConsent?: boolean;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Enrollment details nested in user details
|
|
191
|
+
*/
|
|
192
|
+
export interface UserDetailEnrollment {
|
|
193
|
+
courseId: string;
|
|
194
|
+
courseTitle: string;
|
|
195
|
+
enrolledAt: Date;
|
|
196
|
+
status: 'active' | 'completed' | 'expired' | 'suspended';
|
|
197
|
+
progress: number;
|
|
198
|
+
completedAt?: Date;
|
|
199
|
+
expiresAt?: Date;
|
|
200
|
+
lastAccessedAt?: Date;
|
|
201
|
+
timeSpent: number;
|
|
202
|
+
certificateUrl?: string;
|
|
203
|
+
grade?: number;
|
|
204
|
+
}
|