@contractspec/module.learning-journey 1.57.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/contracts/index.js +578 -0
- package/dist/browser/contracts/models.js +193 -0
- package/dist/browser/contracts/onboarding.js +417 -0
- package/dist/browser/contracts/operations.js +326 -0
- package/dist/browser/contracts/shared.js +5 -0
- package/dist/browser/docs/index.js +124 -0
- package/dist/browser/docs/learning-journey.docblock.js +124 -0
- package/dist/browser/engines/index.js +526 -0
- package/dist/browser/engines/srs.js +198 -0
- package/dist/browser/engines/streak.js +159 -0
- package/dist/browser/engines/xp.js +171 -0
- package/dist/browser/entities/ai.js +343 -0
- package/dist/browser/entities/course.js +276 -0
- package/dist/browser/entities/flashcard.js +222 -0
- package/dist/browser/entities/gamification.js +340 -0
- package/dist/browser/entities/index.js +2136 -0
- package/dist/browser/entities/learner.js +329 -0
- package/dist/browser/entities/onboarding.js +301 -0
- package/dist/browser/entities/quiz.js +304 -0
- package/dist/browser/events.js +423 -0
- package/dist/browser/index.js +3833 -0
- package/dist/browser/learning-journey.capability.js +40 -0
- package/dist/browser/learning-journey.feature.js +56 -0
- package/dist/browser/track-spec.js +0 -0
- package/dist/contracts/index.d.ts +5 -5
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +578 -5
- package/dist/contracts/models.d.ts +426 -431
- package/dist/contracts/models.d.ts.map +1 -1
- package/dist/contracts/models.js +178 -372
- package/dist/contracts/onboarding.d.ts +621 -627
- package/dist/contracts/onboarding.d.ts.map +1 -1
- package/dist/contracts/onboarding.js +404 -388
- package/dist/contracts/operations.d.ts +243 -249
- package/dist/contracts/operations.d.ts.map +1 -1
- package/dist/contracts/operations.js +324 -148
- package/dist/contracts/shared.d.ts +1 -4
- package/dist/contracts/shared.d.ts.map +1 -1
- package/dist/contracts/shared.js +6 -6
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +125 -1
- package/dist/docs/learning-journey.docblock.d.ts +2 -1
- package/dist/docs/learning-journey.docblock.d.ts.map +1 -0
- package/dist/docs/learning-journey.docblock.js +47 -58
- package/dist/engines/index.d.ts +4 -4
- package/dist/engines/index.d.ts.map +1 -0
- package/dist/engines/index.js +526 -4
- package/dist/engines/srs.d.ts +89 -92
- package/dist/engines/srs.d.ts.map +1 -1
- package/dist/engines/srs.js +197 -217
- package/dist/engines/streak.d.ts +84 -87
- package/dist/engines/streak.d.ts.map +1 -1
- package/dist/engines/streak.js +158 -192
- package/dist/engines/xp.d.ts +80 -83
- package/dist/engines/xp.d.ts.map +1 -1
- package/dist/engines/xp.js +170 -211
- package/dist/entities/ai.d.ts +199 -204
- package/dist/entities/ai.d.ts.map +1 -1
- package/dist/entities/ai.js +336 -368
- package/dist/entities/course.d.ts +149 -154
- package/dist/entities/course.d.ts.map +1 -1
- package/dist/entities/course.js +267 -306
- package/dist/entities/flashcard.d.ts +144 -149
- package/dist/entities/flashcard.d.ts.map +1 -1
- package/dist/entities/flashcard.js +217 -243
- package/dist/entities/gamification.d.ts +197 -202
- package/dist/entities/gamification.d.ts.map +1 -1
- package/dist/entities/gamification.js +331 -382
- package/dist/entities/index.d.ts +613 -618
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +2135 -43
- package/dist/entities/learner.d.ts +191 -196
- package/dist/entities/learner.d.ts.map +1 -1
- package/dist/entities/learner.js +322 -357
- package/dist/entities/onboarding.d.ts +164 -169
- package/dist/entities/onboarding.d.ts.map +1 -1
- package/dist/entities/onboarding.js +296 -301
- package/dist/entities/quiz.d.ts +184 -189
- package/dist/entities/quiz.d.ts.map +1 -1
- package/dist/entities/quiz.js +296 -361
- package/dist/events.d.ts +608 -614
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +421 -687
- package/dist/index.d.ts +8 -20
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3834 -22
- package/dist/learning-journey.capability.d.ts +3 -8
- package/dist/learning-journey.capability.d.ts.map +1 -1
- package/dist/learning-journey.capability.js +41 -46
- package/dist/learning-journey.feature.d.ts +1 -6
- package/dist/learning-journey.feature.d.ts.map +1 -1
- package/dist/learning-journey.feature.js +55 -155
- package/dist/node/contracts/index.js +578 -0
- package/dist/node/contracts/models.js +193 -0
- package/dist/node/contracts/onboarding.js +417 -0
- package/dist/node/contracts/operations.js +326 -0
- package/dist/node/contracts/shared.js +5 -0
- package/dist/node/docs/index.js +124 -0
- package/dist/node/docs/learning-journey.docblock.js +124 -0
- package/dist/node/engines/index.js +526 -0
- package/dist/node/engines/srs.js +198 -0
- package/dist/node/engines/streak.js +159 -0
- package/dist/node/engines/xp.js +171 -0
- package/dist/node/entities/ai.js +343 -0
- package/dist/node/entities/course.js +276 -0
- package/dist/node/entities/flashcard.js +222 -0
- package/dist/node/entities/gamification.js +340 -0
- package/dist/node/entities/index.js +2136 -0
- package/dist/node/entities/learner.js +329 -0
- package/dist/node/entities/onboarding.js +301 -0
- package/dist/node/entities/quiz.js +304 -0
- package/dist/node/events.js +423 -0
- package/dist/node/index.js +3833 -0
- package/dist/node/learning-journey.capability.js +40 -0
- package/dist/node/learning-journey.feature.js +56 -0
- package/dist/node/track-spec.js +0 -0
- package/dist/track-spec.d.ts +115 -118
- package/dist/track-spec.d.ts.map +1 -1
- package/dist/track-spec.js +1 -0
- package/package.json +237 -60
- package/dist/contracts/models.js.map +0 -1
- package/dist/contracts/onboarding.js.map +0 -1
- package/dist/contracts/operations.js.map +0 -1
- package/dist/contracts/shared.js.map +0 -1
- package/dist/docs/learning-journey.docblock.js.map +0 -1
- package/dist/engines/srs.js.map +0 -1
- package/dist/engines/streak.js.map +0 -1
- package/dist/engines/xp.js.map +0 -1
- package/dist/entities/ai.js.map +0 -1
- package/dist/entities/course.js.map +0 -1
- package/dist/entities/flashcard.js.map +0 -1
- package/dist/entities/gamification.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/learner.js.map +0 -1
- package/dist/entities/onboarding.js.map +0 -1
- package/dist/entities/quiz.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/learning-journey.capability.js.map +0 -1
- package/dist/learning-journey.feature.js.map +0 -1
package/dist/events.js
CHANGED
|
@@ -1,690 +1,424 @@
|
|
|
1
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/contracts/shared.ts
|
|
3
|
+
var LEARNING_JOURNEY_OWNERS = ["modules.learning-journey"];
|
|
4
|
+
|
|
5
|
+
// src/events.ts
|
|
2
6
|
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
7
|
import { defineEvent } from "@contractspec/lib.contracts";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
amount: {
|
|
421
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
422
|
-
isOptional: false
|
|
423
|
-
},
|
|
424
|
-
source: {
|
|
425
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
426
|
-
isOptional: false
|
|
427
|
-
},
|
|
428
|
-
sourceId: {
|
|
429
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
430
|
-
isOptional: true
|
|
431
|
-
},
|
|
432
|
-
totalXp: {
|
|
433
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
434
|
-
isOptional: false
|
|
435
|
-
},
|
|
436
|
-
earnedAt: {
|
|
437
|
-
type: ScalarTypeEnum.DateTime(),
|
|
438
|
-
isOptional: false
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
const XpEarnedEvent = defineEvent({
|
|
443
|
-
meta: {
|
|
444
|
-
key: "xp.earned",
|
|
445
|
-
version: "1.0.0",
|
|
446
|
-
description: "XP has been earned.",
|
|
447
|
-
stability: "stable",
|
|
448
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
449
|
-
tags: [
|
|
450
|
-
"learning",
|
|
451
|
-
"gamification",
|
|
452
|
-
"xp"
|
|
453
|
-
]
|
|
454
|
-
},
|
|
455
|
-
payload: XpEarnedPayload
|
|
456
|
-
});
|
|
457
|
-
const LevelUpPayload = defineSchemaModel({
|
|
458
|
-
name: "LevelUpEventPayload",
|
|
459
|
-
description: "Payload when a learner levels up",
|
|
460
|
-
fields: {
|
|
461
|
-
learnerId: {
|
|
462
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
463
|
-
isOptional: false
|
|
464
|
-
},
|
|
465
|
-
previousLevel: {
|
|
466
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
467
|
-
isOptional: false
|
|
468
|
-
},
|
|
469
|
-
newLevel: {
|
|
470
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
471
|
-
isOptional: false
|
|
472
|
-
},
|
|
473
|
-
totalXp: {
|
|
474
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
475
|
-
isOptional: false
|
|
476
|
-
},
|
|
477
|
-
leveledUpAt: {
|
|
478
|
-
type: ScalarTypeEnum.DateTime(),
|
|
479
|
-
isOptional: false
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
const LevelUpEvent = defineEvent({
|
|
484
|
-
meta: {
|
|
485
|
-
key: "level.up",
|
|
486
|
-
version: "1.0.0",
|
|
487
|
-
description: "A learner has leveled up.",
|
|
488
|
-
stability: "stable",
|
|
489
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
490
|
-
tags: [
|
|
491
|
-
"learning",
|
|
492
|
-
"gamification",
|
|
493
|
-
"level"
|
|
494
|
-
]
|
|
495
|
-
},
|
|
496
|
-
payload: LevelUpPayload
|
|
497
|
-
});
|
|
498
|
-
const StreakUpdatedPayload = defineSchemaModel({
|
|
499
|
-
name: "StreakUpdatedEventPayload",
|
|
500
|
-
description: "Payload when a streak is updated",
|
|
501
|
-
fields: {
|
|
502
|
-
learnerId: {
|
|
503
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
504
|
-
isOptional: false
|
|
505
|
-
},
|
|
506
|
-
previousStreak: {
|
|
507
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
508
|
-
isOptional: false
|
|
509
|
-
},
|
|
510
|
-
currentStreak: {
|
|
511
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
512
|
-
isOptional: false
|
|
513
|
-
},
|
|
514
|
-
longestStreak: {
|
|
515
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
516
|
-
isOptional: false
|
|
517
|
-
},
|
|
518
|
-
freezeUsed: {
|
|
519
|
-
type: ScalarTypeEnum.Boolean(),
|
|
520
|
-
isOptional: false
|
|
521
|
-
},
|
|
522
|
-
updatedAt: {
|
|
523
|
-
type: ScalarTypeEnum.DateTime(),
|
|
524
|
-
isOptional: false
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
const StreakUpdatedEvent = defineEvent({
|
|
529
|
-
meta: {
|
|
530
|
-
key: "streak.updated",
|
|
531
|
-
version: "1.0.0",
|
|
532
|
-
description: "A streak has been updated.",
|
|
533
|
-
stability: "stable",
|
|
534
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
535
|
-
tags: [
|
|
536
|
-
"learning",
|
|
537
|
-
"gamification",
|
|
538
|
-
"streak"
|
|
539
|
-
]
|
|
540
|
-
},
|
|
541
|
-
payload: StreakUpdatedPayload
|
|
542
|
-
});
|
|
543
|
-
const AchievementUnlockedPayload = defineSchemaModel({
|
|
544
|
-
name: "AchievementUnlockedEventPayload",
|
|
545
|
-
description: "Payload when an achievement is unlocked",
|
|
546
|
-
fields: {
|
|
547
|
-
learnerId: {
|
|
548
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
549
|
-
isOptional: false
|
|
550
|
-
},
|
|
551
|
-
achievementId: {
|
|
552
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
553
|
-
isOptional: false
|
|
554
|
-
},
|
|
555
|
-
achievementKey: {
|
|
556
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
557
|
-
isOptional: false
|
|
558
|
-
},
|
|
559
|
-
achievementName: {
|
|
560
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
561
|
-
isOptional: false
|
|
562
|
-
},
|
|
563
|
-
xpEarned: {
|
|
564
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
565
|
-
isOptional: false
|
|
566
|
-
},
|
|
567
|
-
unlockedAt: {
|
|
568
|
-
type: ScalarTypeEnum.DateTime(),
|
|
569
|
-
isOptional: false
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
});
|
|
573
|
-
const AchievementUnlockedEvent = defineEvent({
|
|
574
|
-
meta: {
|
|
575
|
-
key: "achievement.unlocked",
|
|
576
|
-
version: "1.0.0",
|
|
577
|
-
description: "An achievement has been unlocked.",
|
|
578
|
-
stability: "stable",
|
|
579
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
580
|
-
tags: [
|
|
581
|
-
"learning",
|
|
582
|
-
"gamification",
|
|
583
|
-
"achievement"
|
|
584
|
-
]
|
|
585
|
-
},
|
|
586
|
-
payload: AchievementUnlockedPayload
|
|
587
|
-
});
|
|
588
|
-
const DailyGoalCompletedPayload = defineSchemaModel({
|
|
589
|
-
name: "DailyGoalCompletedEventPayload",
|
|
590
|
-
description: "Payload when a daily goal is completed",
|
|
591
|
-
fields: {
|
|
592
|
-
learnerId: {
|
|
593
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
594
|
-
isOptional: false
|
|
595
|
-
},
|
|
596
|
-
date: {
|
|
597
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
598
|
-
isOptional: false
|
|
599
|
-
},
|
|
600
|
-
targetXp: {
|
|
601
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
602
|
-
isOptional: false
|
|
603
|
-
},
|
|
604
|
-
actualXp: {
|
|
605
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
606
|
-
isOptional: false
|
|
607
|
-
},
|
|
608
|
-
completedAt: {
|
|
609
|
-
type: ScalarTypeEnum.DateTime(),
|
|
610
|
-
isOptional: false
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
const DailyGoalCompletedEvent = defineEvent({
|
|
615
|
-
meta: {
|
|
616
|
-
key: "daily_goal.completed",
|
|
617
|
-
version: "1.0.0",
|
|
618
|
-
description: "A daily goal has been completed.",
|
|
619
|
-
stability: "stable",
|
|
620
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
621
|
-
tags: [
|
|
622
|
-
"learning",
|
|
623
|
-
"gamification",
|
|
624
|
-
"goal"
|
|
625
|
-
]
|
|
626
|
-
},
|
|
627
|
-
payload: DailyGoalCompletedPayload
|
|
628
|
-
});
|
|
629
|
-
const CertificateIssuedPayload = defineSchemaModel({
|
|
630
|
-
name: "CertificateIssuedEventPayload",
|
|
631
|
-
description: "Payload when a certificate is issued",
|
|
632
|
-
fields: {
|
|
633
|
-
certificateId: {
|
|
634
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
635
|
-
isOptional: false
|
|
636
|
-
},
|
|
637
|
-
learnerId: {
|
|
638
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
639
|
-
isOptional: false
|
|
640
|
-
},
|
|
641
|
-
courseId: {
|
|
642
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
643
|
-
isOptional: false
|
|
644
|
-
},
|
|
645
|
-
certificateNumber: {
|
|
646
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
647
|
-
isOptional: false
|
|
648
|
-
},
|
|
649
|
-
issuedAt: {
|
|
650
|
-
type: ScalarTypeEnum.DateTime(),
|
|
651
|
-
isOptional: false
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
|
-
const CertificateIssuedEvent = defineEvent({
|
|
656
|
-
meta: {
|
|
657
|
-
key: "certificate.issued",
|
|
658
|
-
version: "1.0.0",
|
|
659
|
-
description: "A certificate has been issued.",
|
|
660
|
-
stability: "stable",
|
|
661
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
662
|
-
tags: ["learning", "certificate"]
|
|
663
|
-
},
|
|
664
|
-
payload: CertificateIssuedPayload
|
|
665
|
-
});
|
|
666
|
-
/**
|
|
667
|
-
* All learning journey events.
|
|
668
|
-
*/
|
|
669
|
-
const LearningJourneyEvents = {
|
|
670
|
-
CoursePublishedEvent,
|
|
671
|
-
EnrollmentCreatedEvent,
|
|
672
|
-
LessonCompletedEvent,
|
|
673
|
-
CourseCompletedEvent,
|
|
674
|
-
OnboardingStartedEvent,
|
|
675
|
-
OnboardingStepCompletedEvent,
|
|
676
|
-
OnboardingCompletedEvent,
|
|
677
|
-
CardReviewedEvent,
|
|
678
|
-
QuizStartedEvent,
|
|
679
|
-
QuizCompletedEvent,
|
|
680
|
-
XpEarnedEvent,
|
|
681
|
-
LevelUpEvent,
|
|
682
|
-
StreakUpdatedEvent,
|
|
683
|
-
AchievementUnlockedEvent,
|
|
684
|
-
DailyGoalCompletedEvent,
|
|
685
|
-
CertificateIssuedEvent
|
|
8
|
+
var CoursePublishedPayload = defineSchemaModel({
|
|
9
|
+
name: "CoursePublishedEventPayload",
|
|
10
|
+
description: "Payload when a course is published",
|
|
11
|
+
fields: {
|
|
12
|
+
courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
14
|
+
authorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
15
|
+
publishedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var CoursePublishedEvent = defineEvent({
|
|
19
|
+
meta: {
|
|
20
|
+
key: "course.published",
|
|
21
|
+
version: "1.0.0",
|
|
22
|
+
description: "A course has been published.",
|
|
23
|
+
stability: "stable",
|
|
24
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
25
|
+
tags: ["learning", "course"]
|
|
26
|
+
},
|
|
27
|
+
payload: CoursePublishedPayload
|
|
28
|
+
});
|
|
29
|
+
var EnrollmentCreatedPayload = defineSchemaModel({
|
|
30
|
+
name: "EnrollmentCreatedEventPayload",
|
|
31
|
+
description: "Payload when a learner enrolls in a course",
|
|
32
|
+
fields: {
|
|
33
|
+
enrollmentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
34
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
35
|
+
courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
36
|
+
enrolledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var EnrollmentCreatedEvent = defineEvent({
|
|
40
|
+
meta: {
|
|
41
|
+
key: "enrollment.created",
|
|
42
|
+
version: "1.0.0",
|
|
43
|
+
description: "A learner has enrolled in a course.",
|
|
44
|
+
stability: "stable",
|
|
45
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
46
|
+
tags: ["learning", "enrollment"]
|
|
47
|
+
},
|
|
48
|
+
payload: EnrollmentCreatedPayload
|
|
49
|
+
});
|
|
50
|
+
var LessonCompletedPayload = defineSchemaModel({
|
|
51
|
+
name: "LessonCompletedEventPayload",
|
|
52
|
+
description: "Payload when a lesson is completed",
|
|
53
|
+
fields: {
|
|
54
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
55
|
+
lessonId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
56
|
+
courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
57
|
+
score: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
58
|
+
xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
59
|
+
timeSpent: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
60
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var LessonCompletedEvent = defineEvent({
|
|
64
|
+
meta: {
|
|
65
|
+
key: "lesson.completed",
|
|
66
|
+
version: "1.0.0",
|
|
67
|
+
description: "A learner has completed a lesson.",
|
|
68
|
+
stability: "stable",
|
|
69
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
70
|
+
tags: ["learning", "progress", "lesson"]
|
|
71
|
+
},
|
|
72
|
+
payload: LessonCompletedPayload
|
|
73
|
+
});
|
|
74
|
+
var CourseCompletedPayload = defineSchemaModel({
|
|
75
|
+
name: "CourseCompletedEventPayload",
|
|
76
|
+
description: "Payload when a course is completed",
|
|
77
|
+
fields: {
|
|
78
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
79
|
+
courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
80
|
+
enrollmentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
81
|
+
score: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
82
|
+
xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
83
|
+
certificateId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
84
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
var CourseCompletedEvent = defineEvent({
|
|
88
|
+
meta: {
|
|
89
|
+
key: "course.completed",
|
|
90
|
+
version: "1.0.0",
|
|
91
|
+
description: "A learner has completed a course.",
|
|
92
|
+
stability: "stable",
|
|
93
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
94
|
+
tags: ["learning", "progress", "course"]
|
|
95
|
+
},
|
|
96
|
+
payload: CourseCompletedPayload
|
|
97
|
+
});
|
|
98
|
+
var OnboardingStartedPayload = defineSchemaModel({
|
|
99
|
+
name: "OnboardingStartedEventPayload",
|
|
100
|
+
description: "Payload when onboarding starts",
|
|
101
|
+
fields: {
|
|
102
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
103
|
+
trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
104
|
+
productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
105
|
+
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
var OnboardingStartedEvent = defineEvent({
|
|
109
|
+
meta: {
|
|
110
|
+
key: "onboarding.started",
|
|
111
|
+
version: "1.0.0",
|
|
112
|
+
description: "A learner has started onboarding.",
|
|
113
|
+
stability: "stable",
|
|
114
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
115
|
+
tags: ["learning", "onboarding"]
|
|
116
|
+
},
|
|
117
|
+
payload: OnboardingStartedPayload
|
|
118
|
+
});
|
|
119
|
+
var OnboardingStepCompletedPayload = defineSchemaModel({
|
|
120
|
+
name: "OnboardingStepCompletedEventPayload",
|
|
121
|
+
description: "Payload when an onboarding step is completed",
|
|
122
|
+
fields: {
|
|
123
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
124
|
+
trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
125
|
+
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
126
|
+
triggeringEvent: {
|
|
127
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
128
|
+
isOptional: true
|
|
129
|
+
},
|
|
130
|
+
xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
131
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
var OnboardingStepCompletedEvent = defineEvent({
|
|
135
|
+
meta: {
|
|
136
|
+
key: "onboarding.step_completed",
|
|
137
|
+
version: "1.0.0",
|
|
138
|
+
description: "An onboarding step has been completed.",
|
|
139
|
+
stability: "stable",
|
|
140
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
141
|
+
tags: ["learning", "onboarding"]
|
|
142
|
+
},
|
|
143
|
+
payload: OnboardingStepCompletedPayload
|
|
144
|
+
});
|
|
145
|
+
var OnboardingCompletedPayload = defineSchemaModel({
|
|
146
|
+
name: "OnboardingCompletedEventPayload",
|
|
147
|
+
description: "Payload when onboarding is completed",
|
|
148
|
+
fields: {
|
|
149
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
150
|
+
trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
151
|
+
productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
152
|
+
xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
153
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
var OnboardingCompletedEvent = defineEvent({
|
|
157
|
+
meta: {
|
|
158
|
+
key: "onboarding.completed",
|
|
159
|
+
version: "1.0.0",
|
|
160
|
+
description: "A learner has completed onboarding.",
|
|
161
|
+
stability: "stable",
|
|
162
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
163
|
+
tags: ["learning", "onboarding"]
|
|
164
|
+
},
|
|
165
|
+
payload: OnboardingCompletedPayload
|
|
166
|
+
});
|
|
167
|
+
var CardReviewedPayload = defineSchemaModel({
|
|
168
|
+
name: "CardReviewedEventPayload",
|
|
169
|
+
description: "Payload when a flashcard is reviewed",
|
|
170
|
+
fields: {
|
|
171
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
172
|
+
cardId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
173
|
+
deckId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
174
|
+
rating: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
175
|
+
responseTimeMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
176
|
+
reviewedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
var CardReviewedEvent = defineEvent({
|
|
180
|
+
meta: {
|
|
181
|
+
key: "flashcard.reviewed",
|
|
182
|
+
version: "1.0.0",
|
|
183
|
+
description: "A flashcard has been reviewed.",
|
|
184
|
+
stability: "stable",
|
|
185
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
186
|
+
tags: ["learning", "flashcards"]
|
|
187
|
+
},
|
|
188
|
+
payload: CardReviewedPayload
|
|
189
|
+
});
|
|
190
|
+
var QuizStartedPayload = defineSchemaModel({
|
|
191
|
+
name: "QuizStartedEventPayload",
|
|
192
|
+
description: "Payload when a quiz is started",
|
|
193
|
+
fields: {
|
|
194
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
195
|
+
quizId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
196
|
+
attemptId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
197
|
+
attemptNumber: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
198
|
+
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
var QuizStartedEvent = defineEvent({
|
|
202
|
+
meta: {
|
|
203
|
+
key: "quiz.started",
|
|
204
|
+
version: "1.0.0",
|
|
205
|
+
description: "A quiz attempt has started.",
|
|
206
|
+
stability: "stable",
|
|
207
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
208
|
+
tags: ["learning", "quiz"]
|
|
209
|
+
},
|
|
210
|
+
payload: QuizStartedPayload
|
|
211
|
+
});
|
|
212
|
+
var QuizCompletedPayload = defineSchemaModel({
|
|
213
|
+
name: "QuizCompletedEventPayload",
|
|
214
|
+
description: "Payload when a quiz is completed",
|
|
215
|
+
fields: {
|
|
216
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
217
|
+
quizId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
218
|
+
attemptId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
219
|
+
score: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
220
|
+
percentageScore: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
221
|
+
passed: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
222
|
+
xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
223
|
+
timeSpent: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
224
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
var QuizCompletedEvent = defineEvent({
|
|
228
|
+
meta: {
|
|
229
|
+
key: "quiz.completed",
|
|
230
|
+
version: "1.0.0",
|
|
231
|
+
description: "A quiz attempt has been completed.",
|
|
232
|
+
stability: "stable",
|
|
233
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
234
|
+
tags: ["learning", "quiz"]
|
|
235
|
+
},
|
|
236
|
+
payload: QuizCompletedPayload
|
|
237
|
+
});
|
|
238
|
+
var XpEarnedPayload = defineSchemaModel({
|
|
239
|
+
name: "XpEarnedEventPayload",
|
|
240
|
+
description: "Payload when XP is earned",
|
|
241
|
+
fields: {
|
|
242
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
243
|
+
amount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
244
|
+
source: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
245
|
+
sourceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
246
|
+
totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
247
|
+
earnedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
var XpEarnedEvent = defineEvent({
|
|
251
|
+
meta: {
|
|
252
|
+
key: "xp.earned",
|
|
253
|
+
version: "1.0.0",
|
|
254
|
+
description: "XP has been earned.",
|
|
255
|
+
stability: "stable",
|
|
256
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
257
|
+
tags: ["learning", "gamification", "xp"]
|
|
258
|
+
},
|
|
259
|
+
payload: XpEarnedPayload
|
|
260
|
+
});
|
|
261
|
+
var LevelUpPayload = defineSchemaModel({
|
|
262
|
+
name: "LevelUpEventPayload",
|
|
263
|
+
description: "Payload when a learner levels up",
|
|
264
|
+
fields: {
|
|
265
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
266
|
+
previousLevel: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
267
|
+
newLevel: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
268
|
+
totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
269
|
+
leveledUpAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
var LevelUpEvent = defineEvent({
|
|
273
|
+
meta: {
|
|
274
|
+
key: "level.up",
|
|
275
|
+
version: "1.0.0",
|
|
276
|
+
description: "A learner has leveled up.",
|
|
277
|
+
stability: "stable",
|
|
278
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
279
|
+
tags: ["learning", "gamification", "level"]
|
|
280
|
+
},
|
|
281
|
+
payload: LevelUpPayload
|
|
282
|
+
});
|
|
283
|
+
var StreakUpdatedPayload = defineSchemaModel({
|
|
284
|
+
name: "StreakUpdatedEventPayload",
|
|
285
|
+
description: "Payload when a streak is updated",
|
|
286
|
+
fields: {
|
|
287
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
288
|
+
previousStreak: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
289
|
+
currentStreak: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
290
|
+
longestStreak: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
291
|
+
freezeUsed: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
292
|
+
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
var StreakUpdatedEvent = defineEvent({
|
|
296
|
+
meta: {
|
|
297
|
+
key: "streak.updated",
|
|
298
|
+
version: "1.0.0",
|
|
299
|
+
description: "A streak has been updated.",
|
|
300
|
+
stability: "stable",
|
|
301
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
302
|
+
tags: ["learning", "gamification", "streak"]
|
|
303
|
+
},
|
|
304
|
+
payload: StreakUpdatedPayload
|
|
305
|
+
});
|
|
306
|
+
var AchievementUnlockedPayload = defineSchemaModel({
|
|
307
|
+
name: "AchievementUnlockedEventPayload",
|
|
308
|
+
description: "Payload when an achievement is unlocked",
|
|
309
|
+
fields: {
|
|
310
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
311
|
+
achievementId: {
|
|
312
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
313
|
+
isOptional: false
|
|
314
|
+
},
|
|
315
|
+
achievementKey: {
|
|
316
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
317
|
+
isOptional: false
|
|
318
|
+
},
|
|
319
|
+
achievementName: {
|
|
320
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
321
|
+
isOptional: false
|
|
322
|
+
},
|
|
323
|
+
xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
324
|
+
unlockedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
var AchievementUnlockedEvent = defineEvent({
|
|
328
|
+
meta: {
|
|
329
|
+
key: "achievement.unlocked",
|
|
330
|
+
version: "1.0.0",
|
|
331
|
+
description: "An achievement has been unlocked.",
|
|
332
|
+
stability: "stable",
|
|
333
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
334
|
+
tags: ["learning", "gamification", "achievement"]
|
|
335
|
+
},
|
|
336
|
+
payload: AchievementUnlockedPayload
|
|
337
|
+
});
|
|
338
|
+
var DailyGoalCompletedPayload = defineSchemaModel({
|
|
339
|
+
name: "DailyGoalCompletedEventPayload",
|
|
340
|
+
description: "Payload when a daily goal is completed",
|
|
341
|
+
fields: {
|
|
342
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
343
|
+
date: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
344
|
+
targetXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
345
|
+
actualXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
346
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
var DailyGoalCompletedEvent = defineEvent({
|
|
350
|
+
meta: {
|
|
351
|
+
key: "daily_goal.completed",
|
|
352
|
+
version: "1.0.0",
|
|
353
|
+
description: "A daily goal has been completed.",
|
|
354
|
+
stability: "stable",
|
|
355
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
356
|
+
tags: ["learning", "gamification", "goal"]
|
|
357
|
+
},
|
|
358
|
+
payload: DailyGoalCompletedPayload
|
|
359
|
+
});
|
|
360
|
+
var CertificateIssuedPayload = defineSchemaModel({
|
|
361
|
+
name: "CertificateIssuedEventPayload",
|
|
362
|
+
description: "Payload when a certificate is issued",
|
|
363
|
+
fields: {
|
|
364
|
+
certificateId: {
|
|
365
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
366
|
+
isOptional: false
|
|
367
|
+
},
|
|
368
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
369
|
+
courseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
370
|
+
certificateNumber: {
|
|
371
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
372
|
+
isOptional: false
|
|
373
|
+
},
|
|
374
|
+
issuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
var CertificateIssuedEvent = defineEvent({
|
|
378
|
+
meta: {
|
|
379
|
+
key: "certificate.issued",
|
|
380
|
+
version: "1.0.0",
|
|
381
|
+
description: "A certificate has been issued.",
|
|
382
|
+
stability: "stable",
|
|
383
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
384
|
+
tags: ["learning", "certificate"]
|
|
385
|
+
},
|
|
386
|
+
payload: CertificateIssuedPayload
|
|
387
|
+
});
|
|
388
|
+
var LearningJourneyEvents = {
|
|
389
|
+
CoursePublishedEvent,
|
|
390
|
+
EnrollmentCreatedEvent,
|
|
391
|
+
LessonCompletedEvent,
|
|
392
|
+
CourseCompletedEvent,
|
|
393
|
+
OnboardingStartedEvent,
|
|
394
|
+
OnboardingStepCompletedEvent,
|
|
395
|
+
OnboardingCompletedEvent,
|
|
396
|
+
CardReviewedEvent,
|
|
397
|
+
QuizStartedEvent,
|
|
398
|
+
QuizCompletedEvent,
|
|
399
|
+
XpEarnedEvent,
|
|
400
|
+
LevelUpEvent,
|
|
401
|
+
StreakUpdatedEvent,
|
|
402
|
+
AchievementUnlockedEvent,
|
|
403
|
+
DailyGoalCompletedEvent,
|
|
404
|
+
CertificateIssuedEvent
|
|
405
|
+
};
|
|
406
|
+
export {
|
|
407
|
+
XpEarnedEvent,
|
|
408
|
+
StreakUpdatedEvent,
|
|
409
|
+
QuizStartedEvent,
|
|
410
|
+
QuizCompletedEvent,
|
|
411
|
+
OnboardingStepCompletedEvent,
|
|
412
|
+
OnboardingStartedEvent,
|
|
413
|
+
OnboardingCompletedEvent,
|
|
414
|
+
LevelUpEvent,
|
|
415
|
+
LessonCompletedEvent,
|
|
416
|
+
LearningJourneyEvents,
|
|
417
|
+
EnrollmentCreatedEvent,
|
|
418
|
+
DailyGoalCompletedEvent,
|
|
419
|
+
CoursePublishedEvent,
|
|
420
|
+
CourseCompletedEvent,
|
|
421
|
+
CertificateIssuedEvent,
|
|
422
|
+
CardReviewedEvent,
|
|
423
|
+
AchievementUnlockedEvent
|
|
686
424
|
};
|
|
687
|
-
|
|
688
|
-
//#endregion
|
|
689
|
-
export { AchievementUnlockedEvent, CardReviewedEvent, CertificateIssuedEvent, CourseCompletedEvent, CoursePublishedEvent, DailyGoalCompletedEvent, EnrollmentCreatedEvent, LearningJourneyEvents, LessonCompletedEvent, LevelUpEvent, OnboardingCompletedEvent, OnboardingStartedEvent, OnboardingStepCompletedEvent, QuizCompletedEvent, QuizStartedEvent, StreakUpdatedEvent, XpEarnedEvent };
|
|
690
|
-
//# sourceMappingURL=events.js.map
|