@contractspec/module.learning-journey 3.7.16 → 3.7.18
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/dist/browser/contracts/index.js +1 -578
- package/dist/browser/contracts/models.js +1 -193
- package/dist/browser/contracts/onboarding.js +1 -417
- package/dist/browser/contracts/operations.js +1 -326
- package/dist/browser/contracts/shared.js +1 -5
- package/dist/browser/docs/index.js +7 -51
- package/dist/browser/docs/learning-journey.docblock.js +7 -51
- package/dist/browser/engines/index.js +1 -675
- package/dist/browser/engines/srs.js +1 -198
- package/dist/browser/engines/streak.js +1 -159
- package/dist/browser/engines/xp.js +1 -320
- package/dist/browser/entities/ai.js +1 -343
- package/dist/browser/entities/course.js +1 -276
- package/dist/browser/entities/flashcard.js +1 -222
- package/dist/browser/entities/gamification.js +1 -340
- package/dist/browser/entities/index.js +1 -2140
- package/dist/browser/entities/learner.js +1 -333
- package/dist/browser/entities/onboarding.js +1 -301
- package/dist/browser/entities/quiz.js +1 -304
- package/dist/browser/events.js +1 -423
- package/dist/browser/i18n/catalogs/en.js +1 -43
- package/dist/browser/i18n/catalogs/es.js +1 -43
- package/dist/browser/i18n/catalogs/fr.js +1 -43
- package/dist/browser/i18n/catalogs/index.js +1 -127
- package/dist/browser/i18n/index.js +1 -169
- package/dist/browser/i18n/keys.js +1 -16
- package/dist/browser/i18n/locale.js +1 -13
- package/dist/browser/i18n/messages.js +1 -139
- package/dist/browser/index.js +7 -3914
- package/dist/browser/learning-journey.capability.js +1 -43
- package/dist/browser/learning-journey.feature.js +1 -56
- package/dist/contracts/index.js +1 -578
- package/dist/contracts/models.js +1 -193
- package/dist/contracts/onboarding.js +1 -417
- package/dist/contracts/operations.js +1 -326
- package/dist/contracts/shared.js +1 -5
- package/dist/docs/index.js +7 -51
- package/dist/docs/learning-journey.docblock.js +7 -51
- package/dist/engines/index.js +1 -675
- package/dist/engines/srs.js +1 -198
- package/dist/engines/streak.js +1 -159
- package/dist/engines/xp.js +1 -320
- package/dist/entities/ai.js +1 -343
- package/dist/entities/course.js +1 -276
- package/dist/entities/flashcard.js +1 -222
- package/dist/entities/gamification.js +1 -340
- package/dist/entities/index.js +1 -2140
- package/dist/entities/learner.js +1 -333
- package/dist/entities/onboarding.js +1 -301
- package/dist/entities/quiz.js +1 -304
- package/dist/events.js +1 -423
- package/dist/i18n/catalogs/en.js +1 -43
- package/dist/i18n/catalogs/es.js +1 -43
- package/dist/i18n/catalogs/fr.js +1 -43
- package/dist/i18n/catalogs/index.js +1 -127
- package/dist/i18n/index.js +1 -169
- package/dist/i18n/keys.js +1 -16
- package/dist/i18n/locale.js +1 -13
- package/dist/i18n/messages.js +1 -139
- package/dist/index.js +7 -3914
- package/dist/learning-journey.capability.js +1 -43
- package/dist/learning-journey.feature.js +1 -56
- package/dist/node/contracts/index.js +1 -578
- package/dist/node/contracts/models.js +1 -193
- package/dist/node/contracts/onboarding.js +1 -417
- package/dist/node/contracts/operations.js +1 -326
- package/dist/node/contracts/shared.js +1 -5
- package/dist/node/docs/index.js +7 -51
- package/dist/node/docs/learning-journey.docblock.js +7 -51
- package/dist/node/engines/index.js +1 -675
- package/dist/node/engines/srs.js +1 -198
- package/dist/node/engines/streak.js +1 -159
- package/dist/node/engines/xp.js +1 -320
- package/dist/node/entities/ai.js +1 -343
- package/dist/node/entities/course.js +1 -276
- package/dist/node/entities/flashcard.js +1 -222
- package/dist/node/entities/gamification.js +1 -340
- package/dist/node/entities/index.js +1 -2140
- package/dist/node/entities/learner.js +1 -333
- package/dist/node/entities/onboarding.js +1 -301
- package/dist/node/entities/quiz.js +1 -304
- package/dist/node/events.js +1 -423
- package/dist/node/i18n/catalogs/en.js +1 -43
- package/dist/node/i18n/catalogs/es.js +1 -43
- package/dist/node/i18n/catalogs/fr.js +1 -43
- package/dist/node/i18n/catalogs/index.js +1 -127
- package/dist/node/i18n/index.js +1 -169
- package/dist/node/i18n/keys.js +1 -16
- package/dist/node/i18n/locale.js +1 -13
- package/dist/node/i18n/messages.js +1 -139
- package/dist/node/index.js +7 -3914
- package/dist/node/learning-journey.capability.js +1 -43
- package/dist/node/learning-journey.feature.js +1 -56
- package/package.json +5 -5
package/dist/entities/ai.js
CHANGED
|
@@ -1,344 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
defineEntity,
|
|
5
|
-
defineEntityEnum,
|
|
6
|
-
field,
|
|
7
|
-
index
|
|
8
|
-
} from "@contractspec/lib.schema";
|
|
9
|
-
var LearningStyleEnum = defineEntityEnum({
|
|
10
|
-
name: "LearningStyle",
|
|
11
|
-
values: ["VISUAL", "AUDITORY", "READING", "KINESTHETIC", "MIXED"],
|
|
12
|
-
schema: "lssm_learning",
|
|
13
|
-
description: "Preferred learning style."
|
|
14
|
-
});
|
|
15
|
-
var RecommendationTypeEnum = defineEntityEnum({
|
|
16
|
-
name: "RecommendationType",
|
|
17
|
-
values: [
|
|
18
|
-
"COURSE",
|
|
19
|
-
"LESSON",
|
|
20
|
-
"REVIEW",
|
|
21
|
-
"PRACTICE",
|
|
22
|
-
"ASSESSMENT",
|
|
23
|
-
"DECK"
|
|
24
|
-
],
|
|
25
|
-
schema: "lssm_learning",
|
|
26
|
-
description: "Type of learning recommendation."
|
|
27
|
-
});
|
|
28
|
-
var LearnerProfileEntity = defineEntity({
|
|
29
|
-
name: "LearnerProfile",
|
|
30
|
-
description: "AI personalization profile for a learner.",
|
|
31
|
-
schema: "lssm_learning",
|
|
32
|
-
map: "learner_profile",
|
|
33
|
-
fields: {
|
|
34
|
-
id: field.id({ description: "Unique profile identifier" }),
|
|
35
|
-
learnerId: field.foreignKey({ description: "Learner" }),
|
|
36
|
-
learningStyle: field.enum("LearningStyle", {
|
|
37
|
-
default: "MIXED",
|
|
38
|
-
description: "Preferred learning style"
|
|
39
|
-
}),
|
|
40
|
-
preferredDifficulty: field.string({
|
|
41
|
-
default: '"adaptive"',
|
|
42
|
-
description: "Difficulty preference"
|
|
43
|
-
}),
|
|
44
|
-
preferredSessionLength: field.int({
|
|
45
|
-
default: 30,
|
|
46
|
-
description: "Preferred session length in minutes"
|
|
47
|
-
}),
|
|
48
|
-
interests: field.json({ isOptional: true, description: "Topic interests" }),
|
|
49
|
-
goals: field.json({ isOptional: true, description: "Learning goals" }),
|
|
50
|
-
pacePreference: field.string({
|
|
51
|
-
default: '"normal"',
|
|
52
|
-
description: "Learning pace: slow, normal, fast"
|
|
53
|
-
}),
|
|
54
|
-
bestTimeOfDay: field.string({
|
|
55
|
-
isOptional: true,
|
|
56
|
-
description: "Best time for learning"
|
|
57
|
-
}),
|
|
58
|
-
averageSessionLength: field.int({
|
|
59
|
-
isOptional: true,
|
|
60
|
-
description: "Average session length"
|
|
61
|
-
}),
|
|
62
|
-
daysActivePerWeek: field.int({
|
|
63
|
-
isOptional: true,
|
|
64
|
-
description: "Days active per week"
|
|
65
|
-
}),
|
|
66
|
-
avgQuizScore: field.int({
|
|
67
|
-
isOptional: true,
|
|
68
|
-
description: "Average quiz score"
|
|
69
|
-
}),
|
|
70
|
-
avgLessonCompletionTime: field.int({
|
|
71
|
-
isOptional: true,
|
|
72
|
-
description: "Avg lesson completion time"
|
|
73
|
-
}),
|
|
74
|
-
strengths: field.json({
|
|
75
|
-
isOptional: true,
|
|
76
|
-
description: "Identified strengths"
|
|
77
|
-
}),
|
|
78
|
-
weaknesses: field.json({
|
|
79
|
-
isOptional: true,
|
|
80
|
-
description: "Areas for improvement"
|
|
81
|
-
}),
|
|
82
|
-
lastAnalyzedAt: field.dateTime({
|
|
83
|
-
isOptional: true,
|
|
84
|
-
description: "Last AI analysis"
|
|
85
|
-
}),
|
|
86
|
-
metadata: field.json({
|
|
87
|
-
isOptional: true,
|
|
88
|
-
description: "Additional metadata"
|
|
89
|
-
}),
|
|
90
|
-
createdAt: field.createdAt(),
|
|
91
|
-
updatedAt: field.updatedAt(),
|
|
92
|
-
learner: field.belongsTo("Learner", ["learnerId"], ["id"], {
|
|
93
|
-
onDelete: "Cascade"
|
|
94
|
-
})
|
|
95
|
-
},
|
|
96
|
-
indexes: [
|
|
97
|
-
index.unique(["learnerId"], { name: "learner_profile_unique" }),
|
|
98
|
-
index.on(["learningStyle"])
|
|
99
|
-
],
|
|
100
|
-
enums: [LearningStyleEnum]
|
|
101
|
-
});
|
|
102
|
-
var SkillMapEntity = defineEntity({
|
|
103
|
-
name: "SkillMap",
|
|
104
|
-
description: "Maps learner proficiency across skills.",
|
|
105
|
-
schema: "lssm_learning",
|
|
106
|
-
map: "skill_map",
|
|
107
|
-
fields: {
|
|
108
|
-
id: field.id({ description: "Unique skill map identifier" }),
|
|
109
|
-
learnerId: field.foreignKey({ description: "Learner" }),
|
|
110
|
-
skillId: field.string({ description: "Skill identifier" }),
|
|
111
|
-
skillName: field.string({ description: "Skill name" }),
|
|
112
|
-
skillCategory: field.string({
|
|
113
|
-
isOptional: true,
|
|
114
|
-
description: "Skill category"
|
|
115
|
-
}),
|
|
116
|
-
level: field.int({ default: 0, description: "Proficiency level (0-100)" }),
|
|
117
|
-
confidence: field.decimal({
|
|
118
|
-
default: 0.5,
|
|
119
|
-
description: "Confidence in assessment"
|
|
120
|
-
}),
|
|
121
|
-
lessonsCompleted: field.int({
|
|
122
|
-
default: 0,
|
|
123
|
-
description: "Related lessons completed"
|
|
124
|
-
}),
|
|
125
|
-
quizzesCompleted: field.int({
|
|
126
|
-
default: 0,
|
|
127
|
-
description: "Related quizzes completed"
|
|
128
|
-
}),
|
|
129
|
-
practiceTime: field.int({
|
|
130
|
-
default: 0,
|
|
131
|
-
description: "Practice time in minutes"
|
|
132
|
-
}),
|
|
133
|
-
lastPracticedAt: field.dateTime({
|
|
134
|
-
isOptional: true,
|
|
135
|
-
description: "Last practice time"
|
|
136
|
-
}),
|
|
137
|
-
learningVelocity: field.decimal({
|
|
138
|
-
isOptional: true,
|
|
139
|
-
description: "Learning speed for this skill"
|
|
140
|
-
}),
|
|
141
|
-
predictedTimeToMastery: field.int({
|
|
142
|
-
isOptional: true,
|
|
143
|
-
description: "Predicted time to mastery (minutes)"
|
|
144
|
-
}),
|
|
145
|
-
createdAt: field.createdAt(),
|
|
146
|
-
updatedAt: field.updatedAt(),
|
|
147
|
-
learner: field.belongsTo("Learner", ["learnerId"], ["id"], {
|
|
148
|
-
onDelete: "Cascade"
|
|
149
|
-
})
|
|
150
|
-
},
|
|
151
|
-
indexes: [
|
|
152
|
-
index.unique(["learnerId", "skillId"], { name: "skill_map_unique" }),
|
|
153
|
-
index.on(["skillId", "level"]),
|
|
154
|
-
index.on(["learnerId", "level"])
|
|
155
|
-
]
|
|
156
|
-
});
|
|
157
|
-
var LearningPathEntity = defineEntity({
|
|
158
|
-
name: "LearningPath",
|
|
159
|
-
description: "AI-generated personalized learning path.",
|
|
160
|
-
schema: "lssm_learning",
|
|
161
|
-
map: "learning_path",
|
|
162
|
-
fields: {
|
|
163
|
-
id: field.id({ description: "Unique path identifier" }),
|
|
164
|
-
learnerId: field.foreignKey({ description: "Learner" }),
|
|
165
|
-
name: field.string({ description: "Path name" }),
|
|
166
|
-
description: field.string({
|
|
167
|
-
isOptional: true,
|
|
168
|
-
description: "Path description"
|
|
169
|
-
}),
|
|
170
|
-
goal: field.string({ isOptional: true, description: "Path goal" }),
|
|
171
|
-
steps: field.json({ description: "Ordered list of learning steps" }),
|
|
172
|
-
currentStepIndex: field.int({
|
|
173
|
-
default: 0,
|
|
174
|
-
description: "Current step index"
|
|
175
|
-
}),
|
|
176
|
-
progress: field.int({ default: 0, description: "Completion percentage" }),
|
|
177
|
-
completedSteps: field.int({ default: 0, description: "Steps completed" }),
|
|
178
|
-
totalSteps: field.int({ default: 0, description: "Total steps" }),
|
|
179
|
-
generatedAt: field.dateTime({ description: "When path was generated" }),
|
|
180
|
-
adaptedFrom: field.string({
|
|
181
|
-
isOptional: true,
|
|
182
|
-
description: "Original path ID if adapted"
|
|
183
|
-
}),
|
|
184
|
-
generationParams: field.json({
|
|
185
|
-
isOptional: true,
|
|
186
|
-
description: "AI generation parameters"
|
|
187
|
-
}),
|
|
188
|
-
adaptationHistory: field.json({
|
|
189
|
-
isOptional: true,
|
|
190
|
-
description: "Path adaptation history"
|
|
191
|
-
}),
|
|
192
|
-
isActive: field.boolean({
|
|
193
|
-
default: true,
|
|
194
|
-
description: "Whether path is active"
|
|
195
|
-
}),
|
|
196
|
-
isCompleted: field.boolean({
|
|
197
|
-
default: false,
|
|
198
|
-
description: "Whether path is completed"
|
|
199
|
-
}),
|
|
200
|
-
startedAt: field.dateTime({
|
|
201
|
-
isOptional: true,
|
|
202
|
-
description: "When started"
|
|
203
|
-
}),
|
|
204
|
-
completedAt: field.dateTime({
|
|
205
|
-
isOptional: true,
|
|
206
|
-
description: "When completed"
|
|
207
|
-
}),
|
|
208
|
-
estimatedCompletionDate: field.dateTime({
|
|
209
|
-
isOptional: true,
|
|
210
|
-
description: "Estimated completion"
|
|
211
|
-
}),
|
|
212
|
-
createdAt: field.createdAt(),
|
|
213
|
-
updatedAt: field.updatedAt(),
|
|
214
|
-
learner: field.belongsTo("Learner", ["learnerId"], ["id"], {
|
|
215
|
-
onDelete: "Cascade"
|
|
216
|
-
})
|
|
217
|
-
},
|
|
218
|
-
indexes: [index.on(["learnerId", "isActive"]), index.on(["generatedAt"])]
|
|
219
|
-
});
|
|
220
|
-
var RecommendationEntity = defineEntity({
|
|
221
|
-
name: "Recommendation",
|
|
222
|
-
description: "AI-powered learning recommendation.",
|
|
223
|
-
schema: "lssm_learning",
|
|
224
|
-
map: "recommendation",
|
|
225
|
-
fields: {
|
|
226
|
-
id: field.id({ description: "Unique recommendation identifier" }),
|
|
227
|
-
learnerId: field.foreignKey({ description: "Learner" }),
|
|
228
|
-
type: field.enum("RecommendationType", {
|
|
229
|
-
description: "Recommendation type"
|
|
230
|
-
}),
|
|
231
|
-
itemId: field.string({ description: "Recommended item ID" }),
|
|
232
|
-
itemType: field.string({
|
|
233
|
-
description: "Item type (course, lesson, deck, etc.)"
|
|
234
|
-
}),
|
|
235
|
-
score: field.decimal({ description: "Recommendation score (0-1)" }),
|
|
236
|
-
confidence: field.decimal({ description: "Confidence in recommendation" }),
|
|
237
|
-
reason: field.string({ description: "Human-readable reason" }),
|
|
238
|
-
factors: field.json({
|
|
239
|
-
isOptional: true,
|
|
240
|
-
description: "Factors that contributed to recommendation"
|
|
241
|
-
}),
|
|
242
|
-
status: field.string({
|
|
243
|
-
default: '"pending"',
|
|
244
|
-
description: "Status: pending, viewed, accepted, dismissed"
|
|
245
|
-
}),
|
|
246
|
-
viewedAt: field.dateTime({ isOptional: true, description: "When viewed" }),
|
|
247
|
-
acceptedAt: field.dateTime({
|
|
248
|
-
isOptional: true,
|
|
249
|
-
description: "When accepted"
|
|
250
|
-
}),
|
|
251
|
-
dismissedAt: field.dateTime({
|
|
252
|
-
isOptional: true,
|
|
253
|
-
description: "When dismissed"
|
|
254
|
-
}),
|
|
255
|
-
feedback: field.string({ isOptional: true, description: "User feedback" }),
|
|
256
|
-
feedbackRating: field.int({
|
|
257
|
-
isOptional: true,
|
|
258
|
-
description: "Feedback rating (1-5)"
|
|
259
|
-
}),
|
|
260
|
-
expiresAt: field.dateTime({
|
|
261
|
-
isOptional: true,
|
|
262
|
-
description: "When recommendation expires"
|
|
263
|
-
}),
|
|
264
|
-
createdAt: field.createdAt(),
|
|
265
|
-
updatedAt: field.updatedAt(),
|
|
266
|
-
learner: field.belongsTo("Learner", ["learnerId"], ["id"], {
|
|
267
|
-
onDelete: "Cascade"
|
|
268
|
-
})
|
|
269
|
-
},
|
|
270
|
-
indexes: [
|
|
271
|
-
index.on(["learnerId", "status", "score"]),
|
|
272
|
-
index.on(["type", "status"]),
|
|
273
|
-
index.on(["expiresAt"])
|
|
274
|
-
],
|
|
275
|
-
enums: [RecommendationTypeEnum]
|
|
276
|
-
});
|
|
277
|
-
var LearningGapEntity = defineEntity({
|
|
278
|
-
name: "LearningGap",
|
|
279
|
-
description: "Identified learning gap.",
|
|
280
|
-
schema: "lssm_learning",
|
|
281
|
-
map: "learning_gap",
|
|
282
|
-
fields: {
|
|
283
|
-
id: field.id({ description: "Unique gap identifier" }),
|
|
284
|
-
learnerId: field.foreignKey({ description: "Learner" }),
|
|
285
|
-
skillId: field.string({ description: "Skill with gap" }),
|
|
286
|
-
skillName: field.string({ description: "Skill name" }),
|
|
287
|
-
severity: field.string({
|
|
288
|
-
default: '"moderate"',
|
|
289
|
-
description: "Gap severity: minor, moderate, major"
|
|
290
|
-
}),
|
|
291
|
-
confidence: field.decimal({ description: "Confidence in gap detection" }),
|
|
292
|
-
evidence: field.json({ isOptional: true, description: "Evidence for gap" }),
|
|
293
|
-
relatedQuestions: field.json({
|
|
294
|
-
isOptional: true,
|
|
295
|
-
description: "Questions that revealed gap"
|
|
296
|
-
}),
|
|
297
|
-
suggestedRemediation: field.json({
|
|
298
|
-
isOptional: true,
|
|
299
|
-
description: "Suggested remediation"
|
|
300
|
-
}),
|
|
301
|
-
remediationProgress: field.int({
|
|
302
|
-
default: 0,
|
|
303
|
-
description: "Remediation progress"
|
|
304
|
-
}),
|
|
305
|
-
status: field.string({
|
|
306
|
-
default: '"open"',
|
|
307
|
-
description: "Status: open, in_progress, resolved"
|
|
308
|
-
}),
|
|
309
|
-
resolvedAt: field.dateTime({
|
|
310
|
-
isOptional: true,
|
|
311
|
-
description: "When resolved"
|
|
312
|
-
}),
|
|
313
|
-
detectedAt: field.dateTime({ description: "When gap was detected" }),
|
|
314
|
-
createdAt: field.createdAt(),
|
|
315
|
-
updatedAt: field.updatedAt(),
|
|
316
|
-
learner: field.belongsTo("Learner", ["learnerId"], ["id"], {
|
|
317
|
-
onDelete: "Cascade"
|
|
318
|
-
})
|
|
319
|
-
},
|
|
320
|
-
indexes: [
|
|
321
|
-
index.on(["learnerId", "status"]),
|
|
322
|
-
index.on(["skillId", "status"]),
|
|
323
|
-
index.on(["severity", "status"])
|
|
324
|
-
]
|
|
325
|
-
});
|
|
326
|
-
var aiEntities = [
|
|
327
|
-
LearnerProfileEntity,
|
|
328
|
-
SkillMapEntity,
|
|
329
|
-
LearningPathEntity,
|
|
330
|
-
RecommendationEntity,
|
|
331
|
-
LearningGapEntity
|
|
332
|
-
];
|
|
333
|
-
var aiEnums = [LearningStyleEnum, RecommendationTypeEnum];
|
|
334
|
-
export {
|
|
335
|
-
aiEnums,
|
|
336
|
-
aiEntities,
|
|
337
|
-
SkillMapEntity,
|
|
338
|
-
RecommendationTypeEnum,
|
|
339
|
-
RecommendationEntity,
|
|
340
|
-
LearningStyleEnum,
|
|
341
|
-
LearningPathEntity,
|
|
342
|
-
LearningGapEntity,
|
|
343
|
-
LearnerProfileEntity
|
|
344
|
-
};
|
|
2
|
+
import{defineEntity as z,defineEntityEnum as A,field as j,index as q}from"@contractspec/lib.schema";var B=A({name:"LearningStyle",values:["VISUAL","AUDITORY","READING","KINESTHETIC","MIXED"],schema:"lssm_learning",description:"Preferred learning style."}),C=A({name:"RecommendationType",values:["COURSE","LESSON","REVIEW","PRACTICE","ASSESSMENT","DECK"],schema:"lssm_learning",description:"Type of learning recommendation."}),D=z({name:"LearnerProfile",description:"AI personalization profile for a learner.",schema:"lssm_learning",map:"learner_profile",fields:{id:j.id({description:"Unique profile identifier"}),learnerId:j.foreignKey({description:"Learner"}),learningStyle:j.enum("LearningStyle",{default:"MIXED",description:"Preferred learning style"}),preferredDifficulty:j.string({default:'"adaptive"',description:"Difficulty preference"}),preferredSessionLength:j.int({default:30,description:"Preferred session length in minutes"}),interests:j.json({isOptional:!0,description:"Topic interests"}),goals:j.json({isOptional:!0,description:"Learning goals"}),pacePreference:j.string({default:'"normal"',description:"Learning pace: slow, normal, fast"}),bestTimeOfDay:j.string({isOptional:!0,description:"Best time for learning"}),averageSessionLength:j.int({isOptional:!0,description:"Average session length"}),daysActivePerWeek:j.int({isOptional:!0,description:"Days active per week"}),avgQuizScore:j.int({isOptional:!0,description:"Average quiz score"}),avgLessonCompletionTime:j.int({isOptional:!0,description:"Avg lesson completion time"}),strengths:j.json({isOptional:!0,description:"Identified strengths"}),weaknesses:j.json({isOptional:!0,description:"Areas for improvement"}),lastAnalyzedAt:j.dateTime({isOptional:!0,description:"Last AI analysis"}),metadata:j.json({isOptional:!0,description:"Additional metadata"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),learner:j.belongsTo("Learner",["learnerId"],["id"],{onDelete:"Cascade"})},indexes:[q.unique(["learnerId"],{name:"learner_profile_unique"}),q.on(["learningStyle"])],enums:[B]}),F=z({name:"SkillMap",description:"Maps learner proficiency across skills.",schema:"lssm_learning",map:"skill_map",fields:{id:j.id({description:"Unique skill map identifier"}),learnerId:j.foreignKey({description:"Learner"}),skillId:j.string({description:"Skill identifier"}),skillName:j.string({description:"Skill name"}),skillCategory:j.string({isOptional:!0,description:"Skill category"}),level:j.int({default:0,description:"Proficiency level (0-100)"}),confidence:j.decimal({default:0.5,description:"Confidence in assessment"}),lessonsCompleted:j.int({default:0,description:"Related lessons completed"}),quizzesCompleted:j.int({default:0,description:"Related quizzes completed"}),practiceTime:j.int({default:0,description:"Practice time in minutes"}),lastPracticedAt:j.dateTime({isOptional:!0,description:"Last practice time"}),learningVelocity:j.decimal({isOptional:!0,description:"Learning speed for this skill"}),predictedTimeToMastery:j.int({isOptional:!0,description:"Predicted time to mastery (minutes)"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),learner:j.belongsTo("Learner",["learnerId"],["id"],{onDelete:"Cascade"})},indexes:[q.unique(["learnerId","skillId"],{name:"skill_map_unique"}),q.on(["skillId","level"]),q.on(["learnerId","level"])]}),H=z({name:"LearningPath",description:"AI-generated personalized learning path.",schema:"lssm_learning",map:"learning_path",fields:{id:j.id({description:"Unique path identifier"}),learnerId:j.foreignKey({description:"Learner"}),name:j.string({description:"Path name"}),description:j.string({isOptional:!0,description:"Path description"}),goal:j.string({isOptional:!0,description:"Path goal"}),steps:j.json({description:"Ordered list of learning steps"}),currentStepIndex:j.int({default:0,description:"Current step index"}),progress:j.int({default:0,description:"Completion percentage"}),completedSteps:j.int({default:0,description:"Steps completed"}),totalSteps:j.int({default:0,description:"Total steps"}),generatedAt:j.dateTime({description:"When path was generated"}),adaptedFrom:j.string({isOptional:!0,description:"Original path ID if adapted"}),generationParams:j.json({isOptional:!0,description:"AI generation parameters"}),adaptationHistory:j.json({isOptional:!0,description:"Path adaptation history"}),isActive:j.boolean({default:!0,description:"Whether path is active"}),isCompleted:j.boolean({default:!1,description:"Whether path is completed"}),startedAt:j.dateTime({isOptional:!0,description:"When started"}),completedAt:j.dateTime({isOptional:!0,description:"When completed"}),estimatedCompletionDate:j.dateTime({isOptional:!0,description:"Estimated completion"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),learner:j.belongsTo("Learner",["learnerId"],["id"],{onDelete:"Cascade"})},indexes:[q.on(["learnerId","isActive"]),q.on(["generatedAt"])]}),I=z({name:"Recommendation",description:"AI-powered learning recommendation.",schema:"lssm_learning",map:"recommendation",fields:{id:j.id({description:"Unique recommendation identifier"}),learnerId:j.foreignKey({description:"Learner"}),type:j.enum("RecommendationType",{description:"Recommendation type"}),itemId:j.string({description:"Recommended item ID"}),itemType:j.string({description:"Item type (course, lesson, deck, etc.)"}),score:j.decimal({description:"Recommendation score (0-1)"}),confidence:j.decimal({description:"Confidence in recommendation"}),reason:j.string({description:"Human-readable reason"}),factors:j.json({isOptional:!0,description:"Factors that contributed to recommendation"}),status:j.string({default:'"pending"',description:"Status: pending, viewed, accepted, dismissed"}),viewedAt:j.dateTime({isOptional:!0,description:"When viewed"}),acceptedAt:j.dateTime({isOptional:!0,description:"When accepted"}),dismissedAt:j.dateTime({isOptional:!0,description:"When dismissed"}),feedback:j.string({isOptional:!0,description:"User feedback"}),feedbackRating:j.int({isOptional:!0,description:"Feedback rating (1-5)"}),expiresAt:j.dateTime({isOptional:!0,description:"When recommendation expires"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),learner:j.belongsTo("Learner",["learnerId"],["id"],{onDelete:"Cascade"})},indexes:[q.on(["learnerId","status","score"]),q.on(["type","status"]),q.on(["expiresAt"])],enums:[C]}),J=z({name:"LearningGap",description:"Identified learning gap.",schema:"lssm_learning",map:"learning_gap",fields:{id:j.id({description:"Unique gap identifier"}),learnerId:j.foreignKey({description:"Learner"}),skillId:j.string({description:"Skill with gap"}),skillName:j.string({description:"Skill name"}),severity:j.string({default:'"moderate"',description:"Gap severity: minor, moderate, major"}),confidence:j.decimal({description:"Confidence in gap detection"}),evidence:j.json({isOptional:!0,description:"Evidence for gap"}),relatedQuestions:j.json({isOptional:!0,description:"Questions that revealed gap"}),suggestedRemediation:j.json({isOptional:!0,description:"Suggested remediation"}),remediationProgress:j.int({default:0,description:"Remediation progress"}),status:j.string({default:'"open"',description:"Status: open, in_progress, resolved"}),resolvedAt:j.dateTime({isOptional:!0,description:"When resolved"}),detectedAt:j.dateTime({description:"When gap was detected"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),learner:j.belongsTo("Learner",["learnerId"],["id"],{onDelete:"Cascade"})},indexes:[q.on(["learnerId","status"]),q.on(["skillId","status"]),q.on(["severity","status"])]}),N=[D,F,H,I,J],O=[B,C];export{O as aiEnums,N as aiEntities,F as SkillMapEntity,C as RecommendationTypeEnum,I as RecommendationEntity,B as LearningStyleEnum,H as LearningPathEntity,J as LearningGapEntity,D as LearnerProfileEntity};
|
package/dist/entities/course.js
CHANGED
|
@@ -1,277 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
defineEntity,
|
|
5
|
-
defineEntityEnum,
|
|
6
|
-
field,
|
|
7
|
-
index
|
|
8
|
-
} from "@contractspec/lib.schema";
|
|
9
|
-
var CourseDifficultyEnum = defineEntityEnum({
|
|
10
|
-
name: "CourseDifficulty",
|
|
11
|
-
values: ["BEGINNER", "INTERMEDIATE", "ADVANCED", "EXPERT"],
|
|
12
|
-
schema: "lssm_learning",
|
|
13
|
-
description: "Difficulty level of a course."
|
|
14
|
-
});
|
|
15
|
-
var CourseStatusEnum = defineEntityEnum({
|
|
16
|
-
name: "CourseStatus",
|
|
17
|
-
values: ["DRAFT", "PUBLISHED", "ARCHIVED"],
|
|
18
|
-
schema: "lssm_learning",
|
|
19
|
-
description: "Publication status of a course."
|
|
20
|
-
});
|
|
21
|
-
var LessonTypeEnum = defineEntityEnum({
|
|
22
|
-
name: "LessonType",
|
|
23
|
-
values: [
|
|
24
|
-
"CONTENT",
|
|
25
|
-
"VIDEO",
|
|
26
|
-
"INTERACTIVE",
|
|
27
|
-
"QUIZ",
|
|
28
|
-
"PRACTICE",
|
|
29
|
-
"PROJECT"
|
|
30
|
-
],
|
|
31
|
-
schema: "lssm_learning",
|
|
32
|
-
description: "Type of lesson content."
|
|
33
|
-
});
|
|
34
|
-
var ContentTypeEnum = defineEntityEnum({
|
|
35
|
-
name: "ContentType",
|
|
36
|
-
values: ["MARKDOWN", "VIDEO", "AUDIO", "EMBED", "SCORM", "CUSTOM"],
|
|
37
|
-
schema: "lssm_learning",
|
|
38
|
-
description: "Type of lesson content format."
|
|
39
|
-
});
|
|
40
|
-
var CourseEntity = defineEntity({
|
|
41
|
-
name: "Course",
|
|
42
|
-
description: "A structured learning course.",
|
|
43
|
-
schema: "lssm_learning",
|
|
44
|
-
map: "course",
|
|
45
|
-
fields: {
|
|
46
|
-
id: field.id({ description: "Unique course identifier" }),
|
|
47
|
-
title: field.string({ description: "Course title" }),
|
|
48
|
-
slug: field.string({ isUnique: true, description: "URL-friendly slug" }),
|
|
49
|
-
description: field.string({
|
|
50
|
-
isOptional: true,
|
|
51
|
-
description: "Course description"
|
|
52
|
-
}),
|
|
53
|
-
summary: field.string({ isOptional: true, description: "Short summary" }),
|
|
54
|
-
difficulty: field.enum("CourseDifficulty", {
|
|
55
|
-
default: "BEGINNER",
|
|
56
|
-
description: "Difficulty level"
|
|
57
|
-
}),
|
|
58
|
-
category: field.string({
|
|
59
|
-
isOptional: true,
|
|
60
|
-
description: "Course category"
|
|
61
|
-
}),
|
|
62
|
-
tags: field.json({ isOptional: true, description: "Tags for discovery" }),
|
|
63
|
-
prerequisites: field.json({
|
|
64
|
-
isOptional: true,
|
|
65
|
-
description: "Required course IDs"
|
|
66
|
-
}),
|
|
67
|
-
requiredSkills: field.json({
|
|
68
|
-
isOptional: true,
|
|
69
|
-
description: "Required skill levels"
|
|
70
|
-
}),
|
|
71
|
-
estimatedDuration: field.int({
|
|
72
|
-
isOptional: true,
|
|
73
|
-
description: "Estimated duration in minutes"
|
|
74
|
-
}),
|
|
75
|
-
thumbnailUrl: field.string({
|
|
76
|
-
isOptional: true,
|
|
77
|
-
description: "Thumbnail image URL"
|
|
78
|
-
}),
|
|
79
|
-
coverImageUrl: field.string({
|
|
80
|
-
isOptional: true,
|
|
81
|
-
description: "Cover image URL"
|
|
82
|
-
}),
|
|
83
|
-
promoVideoUrl: field.string({
|
|
84
|
-
isOptional: true,
|
|
85
|
-
description: "Promo video URL"
|
|
86
|
-
}),
|
|
87
|
-
status: field.enum("CourseStatus", {
|
|
88
|
-
default: "DRAFT",
|
|
89
|
-
description: "Publication status"
|
|
90
|
-
}),
|
|
91
|
-
publishedAt: field.dateTime({
|
|
92
|
-
isOptional: true,
|
|
93
|
-
description: "When published"
|
|
94
|
-
}),
|
|
95
|
-
authorId: field.string({ description: "Author user ID" }),
|
|
96
|
-
orgId: field.string({
|
|
97
|
-
isOptional: true,
|
|
98
|
-
description: "Organization scope"
|
|
99
|
-
}),
|
|
100
|
-
isPublic: field.boolean({
|
|
101
|
-
default: false,
|
|
102
|
-
description: "Whether course is publicly accessible"
|
|
103
|
-
}),
|
|
104
|
-
isFeatured: field.boolean({
|
|
105
|
-
default: false,
|
|
106
|
-
description: "Whether course is featured"
|
|
107
|
-
}),
|
|
108
|
-
certificateEnabled: field.boolean({
|
|
109
|
-
default: false,
|
|
110
|
-
description: "Award certificate on completion"
|
|
111
|
-
}),
|
|
112
|
-
metadata: field.json({
|
|
113
|
-
isOptional: true,
|
|
114
|
-
description: "Additional metadata"
|
|
115
|
-
}),
|
|
116
|
-
createdAt: field.createdAt(),
|
|
117
|
-
updatedAt: field.updatedAt(),
|
|
118
|
-
modules: field.hasMany("CourseModule"),
|
|
119
|
-
enrollments: field.hasMany("Enrollment")
|
|
120
|
-
},
|
|
121
|
-
indexes: [
|
|
122
|
-
index.on(["orgId", "status"]),
|
|
123
|
-
index.on(["category"]),
|
|
124
|
-
index.on(["difficulty"]),
|
|
125
|
-
index.on(["authorId"])
|
|
126
|
-
],
|
|
127
|
-
enums: [CourseDifficultyEnum, CourseStatusEnum]
|
|
128
|
-
});
|
|
129
|
-
var CourseModuleEntity = defineEntity({
|
|
130
|
-
name: "CourseModule",
|
|
131
|
-
description: "A module (section) within a course.",
|
|
132
|
-
schema: "lssm_learning",
|
|
133
|
-
map: "course_module",
|
|
134
|
-
fields: {
|
|
135
|
-
id: field.id({ description: "Unique module identifier" }),
|
|
136
|
-
courseId: field.foreignKey({ description: "Parent course" }),
|
|
137
|
-
title: field.string({ description: "Module title" }),
|
|
138
|
-
description: field.string({
|
|
139
|
-
isOptional: true,
|
|
140
|
-
description: "Module description"
|
|
141
|
-
}),
|
|
142
|
-
order: field.int({ default: 0, description: "Display order" }),
|
|
143
|
-
unlockCondition: field.json({
|
|
144
|
-
isOptional: true,
|
|
145
|
-
description: "Conditions to unlock module"
|
|
146
|
-
}),
|
|
147
|
-
prerequisiteModuleIds: field.json({
|
|
148
|
-
isOptional: true,
|
|
149
|
-
description: "Required modules to complete first"
|
|
150
|
-
}),
|
|
151
|
-
estimatedDuration: field.int({
|
|
152
|
-
isOptional: true,
|
|
153
|
-
description: "Estimated duration in minutes"
|
|
154
|
-
}),
|
|
155
|
-
createdAt: field.createdAt(),
|
|
156
|
-
updatedAt: field.updatedAt(),
|
|
157
|
-
course: field.belongsTo("Course", ["courseId"], ["id"], {
|
|
158
|
-
onDelete: "Cascade"
|
|
159
|
-
}),
|
|
160
|
-
lessons: field.hasMany("Lesson"),
|
|
161
|
-
completions: field.hasMany("ModuleCompletion")
|
|
162
|
-
},
|
|
163
|
-
indexes: [index.on(["courseId", "order"])]
|
|
164
|
-
});
|
|
165
|
-
var LessonEntity = defineEntity({
|
|
166
|
-
name: "Lesson",
|
|
167
|
-
description: "An individual lesson within a module.",
|
|
168
|
-
schema: "lssm_learning",
|
|
169
|
-
map: "lesson",
|
|
170
|
-
fields: {
|
|
171
|
-
id: field.id({ description: "Unique lesson identifier" }),
|
|
172
|
-
moduleId: field.foreignKey({ description: "Parent module" }),
|
|
173
|
-
title: field.string({ description: "Lesson title" }),
|
|
174
|
-
description: field.string({
|
|
175
|
-
isOptional: true,
|
|
176
|
-
description: "Lesson description"
|
|
177
|
-
}),
|
|
178
|
-
type: field.enum("LessonType", {
|
|
179
|
-
default: "CONTENT",
|
|
180
|
-
description: "Lesson type"
|
|
181
|
-
}),
|
|
182
|
-
order: field.int({ default: 0, description: "Display order" }),
|
|
183
|
-
estimatedDuration: field.int({
|
|
184
|
-
isOptional: true,
|
|
185
|
-
description: "Estimated duration in minutes"
|
|
186
|
-
}),
|
|
187
|
-
xpReward: field.int({
|
|
188
|
-
default: 10,
|
|
189
|
-
description: "XP awarded on completion"
|
|
190
|
-
}),
|
|
191
|
-
isFree: field.boolean({
|
|
192
|
-
default: false,
|
|
193
|
-
description: "Whether lesson is free preview"
|
|
194
|
-
}),
|
|
195
|
-
isRequired: field.boolean({
|
|
196
|
-
default: true,
|
|
197
|
-
description: "Whether lesson is required for completion"
|
|
198
|
-
}),
|
|
199
|
-
metadata: field.json({
|
|
200
|
-
isOptional: true,
|
|
201
|
-
description: "Additional metadata"
|
|
202
|
-
}),
|
|
203
|
-
createdAt: field.createdAt(),
|
|
204
|
-
updatedAt: field.updatedAt(),
|
|
205
|
-
module: field.belongsTo("CourseModule", ["moduleId"], ["id"], {
|
|
206
|
-
onDelete: "Cascade"
|
|
207
|
-
}),
|
|
208
|
-
contents: field.hasMany("LessonContent"),
|
|
209
|
-
progress: field.hasMany("LessonProgress"),
|
|
210
|
-
quizzes: field.hasMany("Quiz")
|
|
211
|
-
},
|
|
212
|
-
indexes: [index.on(["moduleId", "order"]), index.on(["type"])],
|
|
213
|
-
enums: [LessonTypeEnum]
|
|
214
|
-
});
|
|
215
|
-
var LessonContentEntity = defineEntity({
|
|
216
|
-
name: "LessonContent",
|
|
217
|
-
description: "Content block within a lesson.",
|
|
218
|
-
schema: "lssm_learning",
|
|
219
|
-
map: "lesson_content",
|
|
220
|
-
fields: {
|
|
221
|
-
id: field.id({ description: "Unique content identifier" }),
|
|
222
|
-
lessonId: field.foreignKey({ description: "Parent lesson" }),
|
|
223
|
-
contentType: field.enum("ContentType", { description: "Content format" }),
|
|
224
|
-
content: field.string({
|
|
225
|
-
isOptional: true,
|
|
226
|
-
description: "Text content (markdown, etc.)"
|
|
227
|
-
}),
|
|
228
|
-
mediaUrl: field.string({
|
|
229
|
-
isOptional: true,
|
|
230
|
-
description: "Media URL for video/audio"
|
|
231
|
-
}),
|
|
232
|
-
embedData: field.json({
|
|
233
|
-
isOptional: true,
|
|
234
|
-
description: "Embed data for external content"
|
|
235
|
-
}),
|
|
236
|
-
order: field.int({ default: 0, description: "Display order" }),
|
|
237
|
-
duration: field.int({
|
|
238
|
-
isOptional: true,
|
|
239
|
-
description: "Content duration in seconds"
|
|
240
|
-
}),
|
|
241
|
-
metadata: field.json({
|
|
242
|
-
isOptional: true,
|
|
243
|
-
description: "Additional metadata"
|
|
244
|
-
}),
|
|
245
|
-
createdAt: field.createdAt(),
|
|
246
|
-
updatedAt: field.updatedAt(),
|
|
247
|
-
lesson: field.belongsTo("Lesson", ["lessonId"], ["id"], {
|
|
248
|
-
onDelete: "Cascade"
|
|
249
|
-
})
|
|
250
|
-
},
|
|
251
|
-
indexes: [index.on(["lessonId", "order"])],
|
|
252
|
-
enums: [ContentTypeEnum]
|
|
253
|
-
});
|
|
254
|
-
var courseEntities = [
|
|
255
|
-
CourseEntity,
|
|
256
|
-
CourseModuleEntity,
|
|
257
|
-
LessonEntity,
|
|
258
|
-
LessonContentEntity
|
|
259
|
-
];
|
|
260
|
-
var courseEnums = [
|
|
261
|
-
CourseDifficultyEnum,
|
|
262
|
-
CourseStatusEnum,
|
|
263
|
-
LessonTypeEnum,
|
|
264
|
-
ContentTypeEnum
|
|
265
|
-
];
|
|
266
|
-
export {
|
|
267
|
-
courseEnums,
|
|
268
|
-
courseEntities,
|
|
269
|
-
LessonTypeEnum,
|
|
270
|
-
LessonEntity,
|
|
271
|
-
LessonContentEntity,
|
|
272
|
-
CourseStatusEnum,
|
|
273
|
-
CourseModuleEntity,
|
|
274
|
-
CourseEntity,
|
|
275
|
-
CourseDifficultyEnum,
|
|
276
|
-
ContentTypeEnum
|
|
277
|
-
};
|
|
2
|
+
import{defineEntity as v,defineEntityEnum as z,field as j,index as q}from"@contractspec/lib.schema";var A=z({name:"CourseDifficulty",values:["BEGINNER","INTERMEDIATE","ADVANCED","EXPERT"],schema:"lssm_learning",description:"Difficulty level of a course."}),B=z({name:"CourseStatus",values:["DRAFT","PUBLISHED","ARCHIVED"],schema:"lssm_learning",description:"Publication status of a course."}),F=z({name:"LessonType",values:["CONTENT","VIDEO","INTERACTIVE","QUIZ","PRACTICE","PROJECT"],schema:"lssm_learning",description:"Type of lesson content."}),G=z({name:"ContentType",values:["MARKDOWN","VIDEO","AUDIO","EMBED","SCORM","CUSTOM"],schema:"lssm_learning",description:"Type of lesson content format."}),H=v({name:"Course",description:"A structured learning course.",schema:"lssm_learning",map:"course",fields:{id:j.id({description:"Unique course identifier"}),title:j.string({description:"Course title"}),slug:j.string({isUnique:!0,description:"URL-friendly slug"}),description:j.string({isOptional:!0,description:"Course description"}),summary:j.string({isOptional:!0,description:"Short summary"}),difficulty:j.enum("CourseDifficulty",{default:"BEGINNER",description:"Difficulty level"}),category:j.string({isOptional:!0,description:"Course category"}),tags:j.json({isOptional:!0,description:"Tags for discovery"}),prerequisites:j.json({isOptional:!0,description:"Required course IDs"}),requiredSkills:j.json({isOptional:!0,description:"Required skill levels"}),estimatedDuration:j.int({isOptional:!0,description:"Estimated duration in minutes"}),thumbnailUrl:j.string({isOptional:!0,description:"Thumbnail image URL"}),coverImageUrl:j.string({isOptional:!0,description:"Cover image URL"}),promoVideoUrl:j.string({isOptional:!0,description:"Promo video URL"}),status:j.enum("CourseStatus",{default:"DRAFT",description:"Publication status"}),publishedAt:j.dateTime({isOptional:!0,description:"When published"}),authorId:j.string({description:"Author user ID"}),orgId:j.string({isOptional:!0,description:"Organization scope"}),isPublic:j.boolean({default:!1,description:"Whether course is publicly accessible"}),isFeatured:j.boolean({default:!1,description:"Whether course is featured"}),certificateEnabled:j.boolean({default:!1,description:"Award certificate on completion"}),metadata:j.json({isOptional:!0,description:"Additional metadata"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),modules:j.hasMany("CourseModule"),enrollments:j.hasMany("Enrollment")},indexes:[q.on(["orgId","status"]),q.on(["category"]),q.on(["difficulty"]),q.on(["authorId"])],enums:[A,B]}),I=v({name:"CourseModule",description:"A module (section) within a course.",schema:"lssm_learning",map:"course_module",fields:{id:j.id({description:"Unique module identifier"}),courseId:j.foreignKey({description:"Parent course"}),title:j.string({description:"Module title"}),description:j.string({isOptional:!0,description:"Module description"}),order:j.int({default:0,description:"Display order"}),unlockCondition:j.json({isOptional:!0,description:"Conditions to unlock module"}),prerequisiteModuleIds:j.json({isOptional:!0,description:"Required modules to complete first"}),estimatedDuration:j.int({isOptional:!0,description:"Estimated duration in minutes"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),course:j.belongsTo("Course",["courseId"],["id"],{onDelete:"Cascade"}),lessons:j.hasMany("Lesson"),completions:j.hasMany("ModuleCompletion")},indexes:[q.on(["courseId","order"])]}),J=v({name:"Lesson",description:"An individual lesson within a module.",schema:"lssm_learning",map:"lesson",fields:{id:j.id({description:"Unique lesson identifier"}),moduleId:j.foreignKey({description:"Parent module"}),title:j.string({description:"Lesson title"}),description:j.string({isOptional:!0,description:"Lesson description"}),type:j.enum("LessonType",{default:"CONTENT",description:"Lesson type"}),order:j.int({default:0,description:"Display order"}),estimatedDuration:j.int({isOptional:!0,description:"Estimated duration in minutes"}),xpReward:j.int({default:10,description:"XP awarded on completion"}),isFree:j.boolean({default:!1,description:"Whether lesson is free preview"}),isRequired:j.boolean({default:!0,description:"Whether lesson is required for completion"}),metadata:j.json({isOptional:!0,description:"Additional metadata"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),module:j.belongsTo("CourseModule",["moduleId"],["id"],{onDelete:"Cascade"}),contents:j.hasMany("LessonContent"),progress:j.hasMany("LessonProgress"),quizzes:j.hasMany("Quiz")},indexes:[q.on(["moduleId","order"]),q.on(["type"])],enums:[F]}),K=v({name:"LessonContent",description:"Content block within a lesson.",schema:"lssm_learning",map:"lesson_content",fields:{id:j.id({description:"Unique content identifier"}),lessonId:j.foreignKey({description:"Parent lesson"}),contentType:j.enum("ContentType",{description:"Content format"}),content:j.string({isOptional:!0,description:"Text content (markdown, etc.)"}),mediaUrl:j.string({isOptional:!0,description:"Media URL for video/audio"}),embedData:j.json({isOptional:!0,description:"Embed data for external content"}),order:j.int({default:0,description:"Display order"}),duration:j.int({isOptional:!0,description:"Content duration in seconds"}),metadata:j.json({isOptional:!0,description:"Additional metadata"}),createdAt:j.createdAt(),updatedAt:j.updatedAt(),lesson:j.belongsTo("Lesson",["lessonId"],["id"],{onDelete:"Cascade"})},indexes:[q.on(["lessonId","order"])],enums:[G]}),P=[H,I,J,K],Q=[A,B,F,G];export{Q as courseEnums,P as courseEntities,F as LessonTypeEnum,J as LessonEntity,K as LessonContentEntity,B as CourseStatusEnum,I as CourseModuleEntity,H as CourseEntity,A as CourseDifficultyEnum,G as ContentTypeEnum};
|