@contractspec/module.learning-journey 3.7.16 → 3.7.17

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 (94) hide show
  1. package/dist/browser/contracts/index.js +1 -578
  2. package/dist/browser/contracts/models.js +1 -193
  3. package/dist/browser/contracts/onboarding.js +1 -417
  4. package/dist/browser/contracts/operations.js +1 -326
  5. package/dist/browser/contracts/shared.js +1 -5
  6. package/dist/browser/docs/index.js +7 -51
  7. package/dist/browser/docs/learning-journey.docblock.js +7 -51
  8. package/dist/browser/engines/index.js +1 -675
  9. package/dist/browser/engines/srs.js +1 -198
  10. package/dist/browser/engines/streak.js +1 -159
  11. package/dist/browser/engines/xp.js +1 -320
  12. package/dist/browser/entities/ai.js +1 -343
  13. package/dist/browser/entities/course.js +1 -276
  14. package/dist/browser/entities/flashcard.js +1 -222
  15. package/dist/browser/entities/gamification.js +1 -340
  16. package/dist/browser/entities/index.js +1 -2140
  17. package/dist/browser/entities/learner.js +1 -333
  18. package/dist/browser/entities/onboarding.js +1 -301
  19. package/dist/browser/entities/quiz.js +1 -304
  20. package/dist/browser/events.js +1 -423
  21. package/dist/browser/i18n/catalogs/en.js +1 -43
  22. package/dist/browser/i18n/catalogs/es.js +1 -43
  23. package/dist/browser/i18n/catalogs/fr.js +1 -43
  24. package/dist/browser/i18n/catalogs/index.js +1 -127
  25. package/dist/browser/i18n/index.js +1 -169
  26. package/dist/browser/i18n/keys.js +1 -16
  27. package/dist/browser/i18n/locale.js +1 -13
  28. package/dist/browser/i18n/messages.js +1 -139
  29. package/dist/browser/index.js +7 -3914
  30. package/dist/browser/learning-journey.capability.js +1 -43
  31. package/dist/browser/learning-journey.feature.js +1 -56
  32. package/dist/contracts/index.js +1 -578
  33. package/dist/contracts/models.js +1 -193
  34. package/dist/contracts/onboarding.js +1 -417
  35. package/dist/contracts/operations.js +1 -326
  36. package/dist/contracts/shared.js +1 -5
  37. package/dist/docs/index.js +7 -51
  38. package/dist/docs/learning-journey.docblock.js +7 -51
  39. package/dist/engines/index.js +1 -675
  40. package/dist/engines/srs.js +1 -198
  41. package/dist/engines/streak.js +1 -159
  42. package/dist/engines/xp.js +1 -320
  43. package/dist/entities/ai.js +1 -343
  44. package/dist/entities/course.js +1 -276
  45. package/dist/entities/flashcard.js +1 -222
  46. package/dist/entities/gamification.js +1 -340
  47. package/dist/entities/index.js +1 -2140
  48. package/dist/entities/learner.js +1 -333
  49. package/dist/entities/onboarding.js +1 -301
  50. package/dist/entities/quiz.js +1 -304
  51. package/dist/events.js +1 -423
  52. package/dist/i18n/catalogs/en.js +1 -43
  53. package/dist/i18n/catalogs/es.js +1 -43
  54. package/dist/i18n/catalogs/fr.js +1 -43
  55. package/dist/i18n/catalogs/index.js +1 -127
  56. package/dist/i18n/index.js +1 -169
  57. package/dist/i18n/keys.js +1 -16
  58. package/dist/i18n/locale.js +1 -13
  59. package/dist/i18n/messages.js +1 -139
  60. package/dist/index.js +7 -3914
  61. package/dist/learning-journey.capability.js +1 -43
  62. package/dist/learning-journey.feature.js +1 -56
  63. package/dist/node/contracts/index.js +1 -578
  64. package/dist/node/contracts/models.js +1 -193
  65. package/dist/node/contracts/onboarding.js +1 -417
  66. package/dist/node/contracts/operations.js +1 -326
  67. package/dist/node/contracts/shared.js +1 -5
  68. package/dist/node/docs/index.js +7 -51
  69. package/dist/node/docs/learning-journey.docblock.js +7 -51
  70. package/dist/node/engines/index.js +1 -675
  71. package/dist/node/engines/srs.js +1 -198
  72. package/dist/node/engines/streak.js +1 -159
  73. package/dist/node/engines/xp.js +1 -320
  74. package/dist/node/entities/ai.js +1 -343
  75. package/dist/node/entities/course.js +1 -276
  76. package/dist/node/entities/flashcard.js +1 -222
  77. package/dist/node/entities/gamification.js +1 -340
  78. package/dist/node/entities/index.js +1 -2140
  79. package/dist/node/entities/learner.js +1 -333
  80. package/dist/node/entities/onboarding.js +1 -301
  81. package/dist/node/entities/quiz.js +1 -304
  82. package/dist/node/events.js +1 -423
  83. package/dist/node/i18n/catalogs/en.js +1 -43
  84. package/dist/node/i18n/catalogs/es.js +1 -43
  85. package/dist/node/i18n/catalogs/fr.js +1 -43
  86. package/dist/node/i18n/catalogs/index.js +1 -127
  87. package/dist/node/i18n/index.js +1 -169
  88. package/dist/node/i18n/keys.js +1 -16
  89. package/dist/node/i18n/locale.js +1 -13
  90. package/dist/node/i18n/messages.js +1 -139
  91. package/dist/node/index.js +7 -3914
  92. package/dist/node/learning-journey.capability.js +1 -43
  93. package/dist/node/learning-journey.feature.js +1 -56
  94. package/package.json +5 -5
@@ -1,423 +1 @@
1
- // src/contracts/shared.ts
2
- var LEARNING_JOURNEY_OWNERS = ["modules.learning-journey"];
3
-
4
- // src/events.ts
5
- import { defineEvent } from "@contractspec/lib.contracts-spec";
6
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
7
- var CoursePublishedPayload = defineSchemaModel({
8
- name: "CoursePublishedEventPayload",
9
- description: "Payload when a course is published",
10
- fields: {
11
- courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
12
- title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
13
- authorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
- publishedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
15
- }
16
- });
17
- var CoursePublishedEvent = defineEvent({
18
- meta: {
19
- key: "course.published",
20
- version: "1.0.0",
21
- description: "A course has been published.",
22
- stability: "stable",
23
- owners: [...LEARNING_JOURNEY_OWNERS],
24
- tags: ["learning", "course"]
25
- },
26
- payload: CoursePublishedPayload
27
- });
28
- var EnrollmentCreatedPayload = defineSchemaModel({
29
- name: "EnrollmentCreatedEventPayload",
30
- description: "Payload when a learner enrolls in a course",
31
- fields: {
32
- enrollmentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
33
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
34
- courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
35
- enrolledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
36
- }
37
- });
38
- var EnrollmentCreatedEvent = defineEvent({
39
- meta: {
40
- key: "enrollment.created",
41
- version: "1.0.0",
42
- description: "A learner has enrolled in a course.",
43
- stability: "stable",
44
- owners: [...LEARNING_JOURNEY_OWNERS],
45
- tags: ["learning", "enrollment"]
46
- },
47
- payload: EnrollmentCreatedPayload
48
- });
49
- var LessonCompletedPayload = defineSchemaModel({
50
- name: "LessonCompletedEventPayload",
51
- description: "Payload when a lesson is completed",
52
- fields: {
53
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
54
- lessonId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
55
- courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
56
- score: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
57
- xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
58
- timeSpent: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
59
- completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
60
- }
61
- });
62
- var LessonCompletedEvent = defineEvent({
63
- meta: {
64
- key: "lesson.completed",
65
- version: "1.0.0",
66
- description: "A learner has completed a lesson.",
67
- stability: "stable",
68
- owners: [...LEARNING_JOURNEY_OWNERS],
69
- tags: ["learning", "progress", "lesson"]
70
- },
71
- payload: LessonCompletedPayload
72
- });
73
- var CourseCompletedPayload = defineSchemaModel({
74
- name: "CourseCompletedEventPayload",
75
- description: "Payload when a course is completed",
76
- fields: {
77
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
78
- courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
79
- enrollmentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
80
- score: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
81
- xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
82
- certificateId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
83
- completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
84
- }
85
- });
86
- var CourseCompletedEvent = defineEvent({
87
- meta: {
88
- key: "course.completed",
89
- version: "1.0.0",
90
- description: "A learner has completed a course.",
91
- stability: "stable",
92
- owners: [...LEARNING_JOURNEY_OWNERS],
93
- tags: ["learning", "progress", "course"]
94
- },
95
- payload: CourseCompletedPayload
96
- });
97
- var OnboardingStartedPayload = defineSchemaModel({
98
- name: "OnboardingStartedEventPayload",
99
- description: "Payload when onboarding starts",
100
- fields: {
101
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
102
- trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
103
- productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
104
- startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
105
- }
106
- });
107
- var OnboardingStartedEvent = defineEvent({
108
- meta: {
109
- key: "onboarding.started",
110
- version: "1.0.0",
111
- description: "A learner has started onboarding.",
112
- stability: "stable",
113
- owners: [...LEARNING_JOURNEY_OWNERS],
114
- tags: ["learning", "onboarding"]
115
- },
116
- payload: OnboardingStartedPayload
117
- });
118
- var OnboardingStepCompletedPayload = defineSchemaModel({
119
- name: "OnboardingStepCompletedEventPayload",
120
- description: "Payload when an onboarding step is completed",
121
- fields: {
122
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
123
- trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
124
- stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
125
- triggeringEvent: {
126
- type: ScalarTypeEnum.String_unsecure(),
127
- isOptional: true
128
- },
129
- xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
130
- completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
131
- }
132
- });
133
- var OnboardingStepCompletedEvent = defineEvent({
134
- meta: {
135
- key: "onboarding.step_completed",
136
- version: "1.0.0",
137
- description: "An onboarding step has been completed.",
138
- stability: "stable",
139
- owners: [...LEARNING_JOURNEY_OWNERS],
140
- tags: ["learning", "onboarding"]
141
- },
142
- payload: OnboardingStepCompletedPayload
143
- });
144
- var OnboardingCompletedPayload = defineSchemaModel({
145
- name: "OnboardingCompletedEventPayload",
146
- description: "Payload when onboarding is completed",
147
- fields: {
148
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
149
- trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
150
- productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
151
- xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
152
- completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
153
- }
154
- });
155
- var OnboardingCompletedEvent = defineEvent({
156
- meta: {
157
- key: "onboarding.completed",
158
- version: "1.0.0",
159
- description: "A learner has completed onboarding.",
160
- stability: "stable",
161
- owners: [...LEARNING_JOURNEY_OWNERS],
162
- tags: ["learning", "onboarding"]
163
- },
164
- payload: OnboardingCompletedPayload
165
- });
166
- var CardReviewedPayload = defineSchemaModel({
167
- name: "CardReviewedEventPayload",
168
- description: "Payload when a flashcard is reviewed",
169
- fields: {
170
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
171
- cardId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
172
- deckId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
173
- rating: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
174
- responseTimeMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
175
- reviewedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
176
- }
177
- });
178
- var CardReviewedEvent = defineEvent({
179
- meta: {
180
- key: "flashcard.reviewed",
181
- version: "1.0.0",
182
- description: "A flashcard has been reviewed.",
183
- stability: "stable",
184
- owners: [...LEARNING_JOURNEY_OWNERS],
185
- tags: ["learning", "flashcards"]
186
- },
187
- payload: CardReviewedPayload
188
- });
189
- var QuizStartedPayload = defineSchemaModel({
190
- name: "QuizStartedEventPayload",
191
- description: "Payload when a quiz is started",
192
- fields: {
193
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
194
- quizId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
195
- attemptId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
196
- attemptNumber: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
197
- startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
198
- }
199
- });
200
- var QuizStartedEvent = defineEvent({
201
- meta: {
202
- key: "quiz.started",
203
- version: "1.0.0",
204
- description: "A quiz attempt has started.",
205
- stability: "stable",
206
- owners: [...LEARNING_JOURNEY_OWNERS],
207
- tags: ["learning", "quiz"]
208
- },
209
- payload: QuizStartedPayload
210
- });
211
- var QuizCompletedPayload = defineSchemaModel({
212
- name: "QuizCompletedEventPayload",
213
- description: "Payload when a quiz is completed",
214
- fields: {
215
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
216
- quizId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
217
- attemptId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
218
- score: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
219
- percentageScore: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
220
- passed: { type: ScalarTypeEnum.Boolean(), isOptional: false },
221
- xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
222
- timeSpent: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
223
- completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
224
- }
225
- });
226
- var QuizCompletedEvent = defineEvent({
227
- meta: {
228
- key: "quiz.completed",
229
- version: "1.0.0",
230
- description: "A quiz attempt has been completed.",
231
- stability: "stable",
232
- owners: [...LEARNING_JOURNEY_OWNERS],
233
- tags: ["learning", "quiz"]
234
- },
235
- payload: QuizCompletedPayload
236
- });
237
- var XpEarnedPayload = defineSchemaModel({
238
- name: "XpEarnedEventPayload",
239
- description: "Payload when XP is earned",
240
- fields: {
241
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
242
- amount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
243
- source: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
244
- sourceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
245
- totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
246
- earnedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
247
- }
248
- });
249
- var XpEarnedEvent = defineEvent({
250
- meta: {
251
- key: "xp.earned",
252
- version: "1.0.0",
253
- description: "XP has been earned.",
254
- stability: "stable",
255
- owners: [...LEARNING_JOURNEY_OWNERS],
256
- tags: ["learning", "gamification", "xp"]
257
- },
258
- payload: XpEarnedPayload
259
- });
260
- var LevelUpPayload = defineSchemaModel({
261
- name: "LevelUpEventPayload",
262
- description: "Payload when a learner levels up",
263
- fields: {
264
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
265
- previousLevel: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
266
- newLevel: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
267
- totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
268
- leveledUpAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
269
- }
270
- });
271
- var LevelUpEvent = defineEvent({
272
- meta: {
273
- key: "level.up",
274
- version: "1.0.0",
275
- description: "A learner has leveled up.",
276
- stability: "stable",
277
- owners: [...LEARNING_JOURNEY_OWNERS],
278
- tags: ["learning", "gamification", "level"]
279
- },
280
- payload: LevelUpPayload
281
- });
282
- var StreakUpdatedPayload = defineSchemaModel({
283
- name: "StreakUpdatedEventPayload",
284
- description: "Payload when a streak is updated",
285
- fields: {
286
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
287
- previousStreak: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
288
- currentStreak: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
289
- longestStreak: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
290
- freezeUsed: { type: ScalarTypeEnum.Boolean(), isOptional: false },
291
- updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
292
- }
293
- });
294
- var StreakUpdatedEvent = defineEvent({
295
- meta: {
296
- key: "streak.updated",
297
- version: "1.0.0",
298
- description: "A streak has been updated.",
299
- stability: "stable",
300
- owners: [...LEARNING_JOURNEY_OWNERS],
301
- tags: ["learning", "gamification", "streak"]
302
- },
303
- payload: StreakUpdatedPayload
304
- });
305
- var AchievementUnlockedPayload = defineSchemaModel({
306
- name: "AchievementUnlockedEventPayload",
307
- description: "Payload when an achievement is unlocked",
308
- fields: {
309
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
310
- achievementId: {
311
- type: ScalarTypeEnum.String_unsecure(),
312
- isOptional: false
313
- },
314
- achievementKey: {
315
- type: ScalarTypeEnum.String_unsecure(),
316
- isOptional: false
317
- },
318
- achievementName: {
319
- type: ScalarTypeEnum.String_unsecure(),
320
- isOptional: false
321
- },
322
- xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
323
- unlockedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
324
- }
325
- });
326
- var AchievementUnlockedEvent = defineEvent({
327
- meta: {
328
- key: "achievement.unlocked",
329
- version: "1.0.0",
330
- description: "An achievement has been unlocked.",
331
- stability: "stable",
332
- owners: [...LEARNING_JOURNEY_OWNERS],
333
- tags: ["learning", "gamification", "achievement"]
334
- },
335
- payload: AchievementUnlockedPayload
336
- });
337
- var DailyGoalCompletedPayload = defineSchemaModel({
338
- name: "DailyGoalCompletedEventPayload",
339
- description: "Payload when a daily goal is completed",
340
- fields: {
341
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
342
- date: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
343
- targetXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
344
- actualXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
345
- completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
346
- }
347
- });
348
- var DailyGoalCompletedEvent = defineEvent({
349
- meta: {
350
- key: "daily_goal.completed",
351
- version: "1.0.0",
352
- description: "A daily goal has been completed.",
353
- stability: "stable",
354
- owners: [...LEARNING_JOURNEY_OWNERS],
355
- tags: ["learning", "gamification", "goal"]
356
- },
357
- payload: DailyGoalCompletedPayload
358
- });
359
- var CertificateIssuedPayload = defineSchemaModel({
360
- name: "CertificateIssuedEventPayload",
361
- description: "Payload when a certificate is issued",
362
- fields: {
363
- certificateId: {
364
- type: ScalarTypeEnum.String_unsecure(),
365
- isOptional: false
366
- },
367
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
368
- courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
369
- certificateNumber: {
370
- type: ScalarTypeEnum.String_unsecure(),
371
- isOptional: false
372
- },
373
- issuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
374
- }
375
- });
376
- var CertificateIssuedEvent = defineEvent({
377
- meta: {
378
- key: "certificate.issued",
379
- version: "1.0.0",
380
- description: "A certificate has been issued.",
381
- stability: "stable",
382
- owners: [...LEARNING_JOURNEY_OWNERS],
383
- tags: ["learning", "certificate"]
384
- },
385
- payload: CertificateIssuedPayload
386
- });
387
- var LearningJourneyEvents = {
388
- CoursePublishedEvent,
389
- EnrollmentCreatedEvent,
390
- LessonCompletedEvent,
391
- CourseCompletedEvent,
392
- OnboardingStartedEvent,
393
- OnboardingStepCompletedEvent,
394
- OnboardingCompletedEvent,
395
- CardReviewedEvent,
396
- QuizStartedEvent,
397
- QuizCompletedEvent,
398
- XpEarnedEvent,
399
- LevelUpEvent,
400
- StreakUpdatedEvent,
401
- AchievementUnlockedEvent,
402
- DailyGoalCompletedEvent,
403
- CertificateIssuedEvent
404
- };
405
- export {
406
- XpEarnedEvent,
407
- StreakUpdatedEvent,
408
- QuizStartedEvent,
409
- QuizCompletedEvent,
410
- OnboardingStepCompletedEvent,
411
- OnboardingStartedEvent,
412
- OnboardingCompletedEvent,
413
- LevelUpEvent,
414
- LessonCompletedEvent,
415
- LearningJourneyEvents,
416
- EnrollmentCreatedEvent,
417
- DailyGoalCompletedEvent,
418
- CoursePublishedEvent,
419
- CourseCompletedEvent,
420
- CertificateIssuedEvent,
421
- CardReviewedEvent,
422
- AchievementUnlockedEvent
423
- };
1
+ var x=["modules.learning-journey"];import{defineEvent as q}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as B,ScalarTypeEnum as j}from"@contractspec/lib.schema";var F=B({name:"CoursePublishedEventPayload",description:"Payload when a course is published",fields:{courseId:{type:j.String_unsecure(),isOptional:!1},title:{type:j.String_unsecure(),isOptional:!1},authorId:{type:j.String_unsecure(),isOptional:!1},publishedAt:{type:j.DateTime(),isOptional:!1}}}),H=q({meta:{key:"course.published",version:"1.0.0",description:"A course has been published.",stability:"stable",owners:[...x],tags:["learning","course"]},payload:F}),K=B({name:"EnrollmentCreatedEventPayload",description:"Payload when a learner enrolls in a course",fields:{enrollmentId:{type:j.String_unsecure(),isOptional:!1},learnerId:{type:j.String_unsecure(),isOptional:!1},courseId:{type:j.String_unsecure(),isOptional:!1},enrolledAt:{type:j.DateTime(),isOptional:!1}}}),V=q({meta:{key:"enrollment.created",version:"1.0.0",description:"A learner has enrolled in a course.",stability:"stable",owners:[...x],tags:["learning","enrollment"]},payload:K}),Z=B({name:"LessonCompletedEventPayload",description:"Payload when a lesson is completed",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},lessonId:{type:j.String_unsecure(),isOptional:!1},courseId:{type:j.String_unsecure(),isOptional:!1},score:{type:j.Int_unsecure(),isOptional:!0},xpEarned:{type:j.Int_unsecure(),isOptional:!1},timeSpent:{type:j.Int_unsecure(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!1}}}),$=q({meta:{key:"lesson.completed",version:"1.0.0",description:"A learner has completed a lesson.",stability:"stable",owners:[...x],tags:["learning","progress","lesson"]},payload:Z}),w=B({name:"CourseCompletedEventPayload",description:"Payload when a course is completed",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},courseId:{type:j.String_unsecure(),isOptional:!1},enrollmentId:{type:j.String_unsecure(),isOptional:!1},score:{type:j.Int_unsecure(),isOptional:!0},xpEarned:{type:j.Int_unsecure(),isOptional:!1},certificateId:{type:j.String_unsecure(),isOptional:!0},completedAt:{type:j.DateTime(),isOptional:!1}}}),D=q({meta:{key:"course.completed",version:"1.0.0",description:"A learner has completed a course.",stability:"stable",owners:[...x],tags:["learning","progress","course"]},payload:w}),X=B({name:"OnboardingStartedEventPayload",description:"Payload when onboarding starts",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},trackId:{type:j.String_unsecure(),isOptional:!1},productId:{type:j.String_unsecure(),isOptional:!1},startedAt:{type:j.DateTime(),isOptional:!1}}}),k=q({meta:{key:"onboarding.started",version:"1.0.0",description:"A learner has started onboarding.",stability:"stable",owners:[...x],tags:["learning","onboarding"]},payload:X}),z=B({name:"OnboardingStepCompletedEventPayload",description:"Payload when an onboarding step is completed",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},trackId:{type:j.String_unsecure(),isOptional:!1},stepId:{type:j.String_unsecure(),isOptional:!1},triggeringEvent:{type:j.String_unsecure(),isOptional:!0},xpEarned:{type:j.Int_unsecure(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!1}}}),Q=q({meta:{key:"onboarding.step_completed",version:"1.0.0",description:"An onboarding step has been completed.",stability:"stable",owners:[...x],tags:["learning","onboarding"]},payload:z}),g=B({name:"OnboardingCompletedEventPayload",description:"Payload when onboarding is completed",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},trackId:{type:j.String_unsecure(),isOptional:!1},productId:{type:j.String_unsecure(),isOptional:!1},xpEarned:{type:j.Int_unsecure(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!1}}}),b=q({meta:{key:"onboarding.completed",version:"1.0.0",description:"A learner has completed onboarding.",stability:"stable",owners:[...x],tags:["learning","onboarding"]},payload:g}),J=B({name:"CardReviewedEventPayload",description:"Payload when a flashcard is reviewed",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},cardId:{type:j.String_unsecure(),isOptional:!1},deckId:{type:j.String_unsecure(),isOptional:!1},rating:{type:j.String_unsecure(),isOptional:!1},responseTimeMs:{type:j.Int_unsecure(),isOptional:!0},reviewedAt:{type:j.DateTime(),isOptional:!1}}}),W=q({meta:{key:"flashcard.reviewed",version:"1.0.0",description:"A flashcard has been reviewed.",stability:"stable",owners:[...x],tags:["learning","flashcards"]},payload:J}),Y=B({name:"QuizStartedEventPayload",description:"Payload when a quiz is started",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},quizId:{type:j.String_unsecure(),isOptional:!1},attemptId:{type:j.String_unsecure(),isOptional:!1},attemptNumber:{type:j.Int_unsecure(),isOptional:!1},startedAt:{type:j.DateTime(),isOptional:!1}}}),M=q({meta:{key:"quiz.started",version:"1.0.0",description:"A quiz attempt has started.",stability:"stable",owners:[...x],tags:["learning","quiz"]},payload:Y}),s=B({name:"QuizCompletedEventPayload",description:"Payload when a quiz is completed",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},quizId:{type:j.String_unsecure(),isOptional:!1},attemptId:{type:j.String_unsecure(),isOptional:!1},score:{type:j.Int_unsecure(),isOptional:!1},percentageScore:{type:j.Int_unsecure(),isOptional:!1},passed:{type:j.Boolean(),isOptional:!1},xpEarned:{type:j.Int_unsecure(),isOptional:!1},timeSpent:{type:j.Int_unsecure(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!1}}}),A=q({meta:{key:"quiz.completed",version:"1.0.0",description:"A quiz attempt has been completed.",stability:"stable",owners:[...x],tags:["learning","quiz"]},payload:s}),G=B({name:"XpEarnedEventPayload",description:"Payload when XP is earned",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},amount:{type:j.Int_unsecure(),isOptional:!1},source:{type:j.String_unsecure(),isOptional:!1},sourceId:{type:j.String_unsecure(),isOptional:!0},totalXp:{type:j.Int_unsecure(),isOptional:!1},earnedAt:{type:j.DateTime(),isOptional:!1}}}),I=q({meta:{key:"xp.earned",version:"1.0.0",description:"XP has been earned.",stability:"stable",owners:[...x],tags:["learning","gamification","xp"]},payload:G}),P=B({name:"LevelUpEventPayload",description:"Payload when a learner levels up",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},previousLevel:{type:j.Int_unsecure(),isOptional:!1},newLevel:{type:j.Int_unsecure(),isOptional:!1},totalXp:{type:j.Int_unsecure(),isOptional:!1},leveledUpAt:{type:j.DateTime(),isOptional:!1}}}),L=q({meta:{key:"level.up",version:"1.0.0",description:"A learner has leveled up.",stability:"stable",owners:[...x],tags:["learning","gamification","level"]},payload:P}),U=B({name:"StreakUpdatedEventPayload",description:"Payload when a streak is updated",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},previousStreak:{type:j.Int_unsecure(),isOptional:!1},currentStreak:{type:j.Int_unsecure(),isOptional:!1},longestStreak:{type:j.Int_unsecure(),isOptional:!1},freezeUsed:{type:j.Boolean(),isOptional:!1},updatedAt:{type:j.DateTime(),isOptional:!1}}}),h=q({meta:{key:"streak.updated",version:"1.0.0",description:"A streak has been updated.",stability:"stable",owners:[...x],tags:["learning","gamification","streak"]},payload:U}),C=B({name:"AchievementUnlockedEventPayload",description:"Payload when an achievement is unlocked",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},achievementId:{type:j.String_unsecure(),isOptional:!1},achievementKey:{type:j.String_unsecure(),isOptional:!1},achievementName:{type:j.String_unsecure(),isOptional:!1},xpEarned:{type:j.Int_unsecure(),isOptional:!1},unlockedAt:{type:j.DateTime(),isOptional:!1}}}),_=q({meta:{key:"achievement.unlocked",version:"1.0.0",description:"An achievement has been unlocked.",stability:"stable",owners:[...x],tags:["learning","gamification","achievement"]},payload:C}),f=B({name:"DailyGoalCompletedEventPayload",description:"Payload when a daily goal is completed",fields:{learnerId:{type:j.String_unsecure(),isOptional:!1},date:{type:j.String_unsecure(),isOptional:!1},targetXp:{type:j.Int_unsecure(),isOptional:!1},actualXp:{type:j.Int_unsecure(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!1}}}),O=q({meta:{key:"daily_goal.completed",version:"1.0.0",description:"A daily goal has been completed.",stability:"stable",owners:[...x],tags:["learning","gamification","goal"]},payload:f}),v=B({name:"CertificateIssuedEventPayload",description:"Payload when a certificate is issued",fields:{certificateId:{type:j.String_unsecure(),isOptional:!1},learnerId:{type:j.String_unsecure(),isOptional:!1},courseId:{type:j.String_unsecure(),isOptional:!1},certificateNumber:{type:j.String_unsecure(),isOptional:!1},issuedAt:{type:j.DateTime(),isOptional:!1}}}),R=q({meta:{key:"certificate.issued",version:"1.0.0",description:"A certificate has been issued.",stability:"stable",owners:[...x],tags:["learning","certificate"]},payload:v}),T={CoursePublishedEvent:H,EnrollmentCreatedEvent:V,LessonCompletedEvent:$,CourseCompletedEvent:D,OnboardingStartedEvent:k,OnboardingStepCompletedEvent:Q,OnboardingCompletedEvent:b,CardReviewedEvent:W,QuizStartedEvent:M,QuizCompletedEvent:A,XpEarnedEvent:I,LevelUpEvent:L,StreakUpdatedEvent:h,AchievementUnlockedEvent:_,DailyGoalCompletedEvent:O,CertificateIssuedEvent:R};export{I as XpEarnedEvent,h as StreakUpdatedEvent,M as QuizStartedEvent,A as QuizCompletedEvent,Q as OnboardingStepCompletedEvent,k as OnboardingStartedEvent,b as OnboardingCompletedEvent,L as LevelUpEvent,$ as LessonCompletedEvent,T as LearningJourneyEvents,V as EnrollmentCreatedEvent,O as DailyGoalCompletedEvent,H as CoursePublishedEvent,D as CourseCompletedEvent,R as CertificateIssuedEvent,W as CardReviewedEvent,_ as AchievementUnlockedEvent};
@@ -1,43 +1 @@
1
- // src/i18n/catalogs/en.ts
2
- import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
3
- var enMessages = defineTranslation({
4
- meta: {
5
- key: "learning-journey.messages",
6
- version: "1.0.0",
7
- domain: "learning-journey",
8
- description: "XP source labels for the learning-journey module",
9
- owners: ["platform"],
10
- stability: "experimental"
11
- },
12
- locale: "en",
13
- fallback: "en",
14
- messages: {
15
- "xp.source.base": {
16
- value: "Base",
17
- description: "XP breakdown label for base XP"
18
- },
19
- "xp.source.scoreBonus": {
20
- value: "Score Bonus",
21
- description: "XP breakdown label for score-based bonus"
22
- },
23
- "xp.source.perfectScore": {
24
- value: "Perfect Score",
25
- description: "XP breakdown label for perfect score bonus"
26
- },
27
- "xp.source.firstAttempt": {
28
- value: "First Attempt",
29
- description: "XP breakdown label for first attempt bonus"
30
- },
31
- "xp.source.retryPenalty": {
32
- value: "Retry Penalty",
33
- description: "XP breakdown label for retry penalty"
34
- },
35
- "xp.source.streakBonus": {
36
- value: "Streak Bonus",
37
- description: "XP breakdown label for streak bonus"
38
- }
39
- }
40
- });
41
- export {
42
- enMessages
43
- };
1
+ import{defineTranslation as g}from"@contractspec/lib.contracts-spec/translations";var j=g({meta:{key:"learning-journey.messages",version:"1.0.0",domain:"learning-journey",description:"XP source labels for the learning-journey module",owners:["platform"],stability:"experimental"},locale:"en",fallback:"en",messages:{"xp.source.base":{value:"Base",description:"XP breakdown label for base XP"},"xp.source.scoreBonus":{value:"Score Bonus",description:"XP breakdown label for score-based bonus"},"xp.source.perfectScore":{value:"Perfect Score",description:"XP breakdown label for perfect score bonus"},"xp.source.firstAttempt":{value:"First Attempt",description:"XP breakdown label for first attempt bonus"},"xp.source.retryPenalty":{value:"Retry Penalty",description:"XP breakdown label for retry penalty"},"xp.source.streakBonus":{value:"Streak Bonus",description:"XP breakdown label for streak bonus"}}});export{j as enMessages};
@@ -1,43 +1 @@
1
- // src/i18n/catalogs/es.ts
2
- import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
3
- var esMessages = defineTranslation({
4
- meta: {
5
- key: "learning-journey.messages",
6
- version: "1.0.0",
7
- domain: "learning-journey",
8
- description: "XP source labels (Spanish)",
9
- owners: ["platform"],
10
- stability: "experimental"
11
- },
12
- locale: "es",
13
- fallback: "en",
14
- messages: {
15
- "xp.source.base": {
16
- value: "Base",
17
- description: "XP breakdown label for base XP"
18
- },
19
- "xp.source.scoreBonus": {
20
- value: "Bonificación por puntuación",
21
- description: "XP breakdown label for score-based bonus"
22
- },
23
- "xp.source.perfectScore": {
24
- value: "Puntuación perfecta",
25
- description: "XP breakdown label for perfect score bonus"
26
- },
27
- "xp.source.firstAttempt": {
28
- value: "Primer intento",
29
- description: "XP breakdown label for first attempt bonus"
30
- },
31
- "xp.source.retryPenalty": {
32
- value: "Penalización por reintento",
33
- description: "XP breakdown label for retry penalty"
34
- },
35
- "xp.source.streakBonus": {
36
- value: "Bonificación por racha",
37
- description: "XP breakdown label for streak bonus"
38
- }
39
- }
40
- });
41
- export {
42
- esMessages
43
- };
1
+ import{defineTranslation as g}from"@contractspec/lib.contracts-spec/translations";var j=g({meta:{key:"learning-journey.messages",version:"1.0.0",domain:"learning-journey",description:"XP source labels (Spanish)",owners:["platform"],stability:"experimental"},locale:"es",fallback:"en",messages:{"xp.source.base":{value:"Base",description:"XP breakdown label for base XP"},"xp.source.scoreBonus":{value:"Bonificación por puntuación",description:"XP breakdown label for score-based bonus"},"xp.source.perfectScore":{value:"Puntuación perfecta",description:"XP breakdown label for perfect score bonus"},"xp.source.firstAttempt":{value:"Primer intento",description:"XP breakdown label for first attempt bonus"},"xp.source.retryPenalty":{value:"Penalización por reintento",description:"XP breakdown label for retry penalty"},"xp.source.streakBonus":{value:"Bonificación por racha",description:"XP breakdown label for streak bonus"}}});export{j as esMessages};
@@ -1,43 +1 @@
1
- // src/i18n/catalogs/fr.ts
2
- import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
3
- var frMessages = defineTranslation({
4
- meta: {
5
- key: "learning-journey.messages",
6
- version: "1.0.0",
7
- domain: "learning-journey",
8
- description: "XP source labels (French)",
9
- owners: ["platform"],
10
- stability: "experimental"
11
- },
12
- locale: "fr",
13
- fallback: "en",
14
- messages: {
15
- "xp.source.base": {
16
- value: "Base",
17
- description: "XP breakdown label for base XP"
18
- },
19
- "xp.source.scoreBonus": {
20
- value: "Bonus de score",
21
- description: "XP breakdown label for score-based bonus"
22
- },
23
- "xp.source.perfectScore": {
24
- value: "Score parfait",
25
- description: "XP breakdown label for perfect score bonus"
26
- },
27
- "xp.source.firstAttempt": {
28
- value: "Premier essai",
29
- description: "XP breakdown label for first attempt bonus"
30
- },
31
- "xp.source.retryPenalty": {
32
- value: "Pénalité de réessai",
33
- description: "XP breakdown label for retry penalty"
34
- },
35
- "xp.source.streakBonus": {
36
- value: "Bonus de série",
37
- description: "XP breakdown label for streak bonus"
38
- }
39
- }
40
- });
41
- export {
42
- frMessages
43
- };
1
+ import{defineTranslation as g}from"@contractspec/lib.contracts-spec/translations";var j=g({meta:{key:"learning-journey.messages",version:"1.0.0",domain:"learning-journey",description:"XP source labels (French)",owners:["platform"],stability:"experimental"},locale:"fr",fallback:"en",messages:{"xp.source.base":{value:"Base",description:"XP breakdown label for base XP"},"xp.source.scoreBonus":{value:"Bonus de score",description:"XP breakdown label for score-based bonus"},"xp.source.perfectScore":{value:"Score parfait",description:"XP breakdown label for perfect score bonus"},"xp.source.firstAttempt":{value:"Premier essai",description:"XP breakdown label for first attempt bonus"},"xp.source.retryPenalty":{value:"Pénalité de réessai",description:"XP breakdown label for retry penalty"},"xp.source.streakBonus":{value:"Bonus de série",description:"XP breakdown label for streak bonus"}}});export{j as frMessages};