@lssm/module.learning-journey 1.41.1 → 1.42.2
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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/contracts/index.d.ts +5 -0
- package/dist/contracts/index.js +6 -1
- package/dist/contracts/models.d.ts +451 -0
- package/dist/contracts/models.d.ts.map +1 -0
- package/dist/contracts/models.js +388 -1
- package/dist/contracts/models.js.map +1 -0
- package/dist/contracts/onboarding.d.ts +666 -0
- package/dist/contracts/onboarding.d.ts.map +1 -0
- package/dist/contracts/onboarding.js +402 -1
- package/dist/contracts/onboarding.js.map +1 -0
- package/dist/contracts/operations.d.ts +280 -0
- package/dist/contracts/operations.d.ts.map +1 -0
- package/dist/contracts/operations.js +151 -1
- package/dist/contracts/operations.js.map +1 -0
- package/dist/contracts/shared.d.ts +5 -0
- package/dist/contracts/shared.d.ts.map +1 -0
- package/dist/contracts/shared.js +6 -1
- package/dist/contracts/shared.js.map +1 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -1
- package/dist/docs/learning-journey.docblock.d.ts +1 -0
- package/dist/docs/learning-journey.docblock.js +61 -5
- package/dist/docs/learning-journey.docblock.js.map +1 -0
- package/dist/engines/index.d.ts +4 -0
- package/dist/engines/index.js +5 -1
- package/dist/engines/srs.d.ts +111 -0
- package/dist/engines/srs.d.ts.map +1 -0
- package/dist/engines/srs.js +219 -1
- package/dist/engines/srs.js.map +1 -0
- package/dist/engines/streak.d.ts +100 -0
- package/dist/engines/streak.d.ts.map +1 -0
- package/dist/engines/streak.js +194 -1
- package/dist/engines/streak.js.map +1 -0
- package/dist/engines/xp.d.ts +97 -0
- package/dist/engines/xp.d.ts.map +1 -0
- package/dist/engines/xp.js +213 -1
- package/dist/engines/xp.js.map +1 -0
- package/dist/entities/ai.d.ts +232 -0
- package/dist/entities/ai.d.ts.map +1 -0
- package/dist/entities/ai.js +376 -1
- package/dist/entities/ai.js.map +1 -0
- package/dist/entities/course.d.ts +184 -0
- package/dist/entities/course.d.ts.map +1 -0
- package/dist/entities/course.js +316 -1
- package/dist/entities/course.js.map +1 -0
- package/dist/entities/flashcard.d.ts +170 -0
- package/dist/entities/flashcard.d.ts.map +1 -0
- package/dist/entities/flashcard.js +249 -1
- package/dist/entities/flashcard.js.map +1 -0
- package/dist/entities/gamification.d.ts +238 -0
- package/dist/entities/gamification.d.ts.map +1 -0
- package/dist/entities/gamification.js +392 -1
- package/dist/entities/gamification.js.map +1 -0
- package/dist/entities/index.d.ts +629 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +45 -1
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/learner.d.ts +224 -0
- package/dist/entities/learner.d.ts.map +1 -0
- package/dist/entities/learner.js +365 -1
- package/dist/entities/learner.js.map +1 -0
- package/dist/entities/onboarding.d.ts +190 -0
- package/dist/entities/onboarding.d.ts.map +1 -0
- package/dist/entities/onboarding.js +307 -1
- package/dist/entities/onboarding.js.map +1 -0
- package/dist/entities/quiz.d.ts +220 -0
- package/dist/entities/quiz.d.ts.map +1 -0
- package/dist/entities/quiz.js +370 -1
- package/dist/entities/quiz.js.map +1 -0
- package/dist/events.d.ts +796 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +690 -1
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +22 -1
- package/dist/learning-journey.feature.d.ts +12 -0
- package/dist/learning-journey.feature.d.ts.map +1 -0
- package/dist/learning-journey.feature.js +150 -1
- package/dist/learning-journey.feature.js.map +1 -0
- package/dist/track-spec.d.ts +129 -0
- package/dist/track-spec.d.ts.map +1 -0
- package/package.json +37 -30
|
@@ -1 +1,402 @@
|
|
|
1
|
-
import{LEARNING_JOURNEY_OWNERS
|
|
1
|
+
import { LEARNING_JOURNEY_OWNERS } from "./shared.js";
|
|
2
|
+
import { SuccessOutput } from "./models.js";
|
|
3
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@lssm/lib.schema";
|
|
4
|
+
import { defineCommand, defineQuery } from "@lssm/lib.contracts";
|
|
5
|
+
|
|
6
|
+
//#region src/contracts/onboarding.ts
|
|
7
|
+
const OnboardingStepConditionModel = defineSchemaModel({
|
|
8
|
+
name: "OnboardingStepCondition",
|
|
9
|
+
description: "Structured completion condition for onboarding steps.",
|
|
10
|
+
fields: {
|
|
11
|
+
eventName: {
|
|
12
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
13
|
+
isOptional: false
|
|
14
|
+
},
|
|
15
|
+
eventVersion: {
|
|
16
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
17
|
+
isOptional: true
|
|
18
|
+
},
|
|
19
|
+
sourceModule: {
|
|
20
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
+
isOptional: true
|
|
22
|
+
},
|
|
23
|
+
payloadFilter: {
|
|
24
|
+
type: ScalarTypeEnum.JSON(),
|
|
25
|
+
isOptional: true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const OnboardingStepModel = defineSchemaModel({
|
|
30
|
+
name: "OnboardingStep",
|
|
31
|
+
description: "Declarative onboarding step definition.",
|
|
32
|
+
fields: {
|
|
33
|
+
id: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isOptional: false
|
|
36
|
+
},
|
|
37
|
+
trackId: {
|
|
38
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
39
|
+
isOptional: false
|
|
40
|
+
},
|
|
41
|
+
title: {
|
|
42
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
43
|
+
isOptional: false
|
|
44
|
+
},
|
|
45
|
+
description: {
|
|
46
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
47
|
+
isOptional: true
|
|
48
|
+
},
|
|
49
|
+
instructions: {
|
|
50
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
51
|
+
isOptional: true
|
|
52
|
+
},
|
|
53
|
+
helpUrl: {
|
|
54
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
55
|
+
isOptional: true
|
|
56
|
+
},
|
|
57
|
+
order: {
|
|
58
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
59
|
+
isOptional: false
|
|
60
|
+
},
|
|
61
|
+
completionEvent: {
|
|
62
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
63
|
+
isOptional: false
|
|
64
|
+
},
|
|
65
|
+
completionCondition: {
|
|
66
|
+
type: OnboardingStepConditionModel,
|
|
67
|
+
isOptional: true
|
|
68
|
+
},
|
|
69
|
+
xpReward: {
|
|
70
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
71
|
+
isOptional: true
|
|
72
|
+
},
|
|
73
|
+
isRequired: {
|
|
74
|
+
type: ScalarTypeEnum.Boolean(),
|
|
75
|
+
isOptional: true
|
|
76
|
+
},
|
|
77
|
+
canSkip: {
|
|
78
|
+
type: ScalarTypeEnum.Boolean(),
|
|
79
|
+
isOptional: true
|
|
80
|
+
},
|
|
81
|
+
actionUrl: {
|
|
82
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
83
|
+
isOptional: true
|
|
84
|
+
},
|
|
85
|
+
actionLabel: {
|
|
86
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
87
|
+
isOptional: true
|
|
88
|
+
},
|
|
89
|
+
metadata: {
|
|
90
|
+
type: ScalarTypeEnum.JSON(),
|
|
91
|
+
isOptional: true
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const OnboardingTrackModel = defineSchemaModel({
|
|
96
|
+
name: "OnboardingTrack",
|
|
97
|
+
description: "Onboarding track metadata and steps.",
|
|
98
|
+
fields: {
|
|
99
|
+
id: {
|
|
100
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
101
|
+
isOptional: false
|
|
102
|
+
},
|
|
103
|
+
productId: {
|
|
104
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
105
|
+
isOptional: true
|
|
106
|
+
},
|
|
107
|
+
name: {
|
|
108
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
109
|
+
isOptional: false
|
|
110
|
+
},
|
|
111
|
+
description: {
|
|
112
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
113
|
+
isOptional: true
|
|
114
|
+
},
|
|
115
|
+
targetUserSegment: {
|
|
116
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
117
|
+
isOptional: true
|
|
118
|
+
},
|
|
119
|
+
targetRole: {
|
|
120
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
121
|
+
isOptional: true
|
|
122
|
+
},
|
|
123
|
+
isActive: {
|
|
124
|
+
type: ScalarTypeEnum.Boolean(),
|
|
125
|
+
isOptional: true
|
|
126
|
+
},
|
|
127
|
+
isRequired: {
|
|
128
|
+
type: ScalarTypeEnum.Boolean(),
|
|
129
|
+
isOptional: true
|
|
130
|
+
},
|
|
131
|
+
canSkip: {
|
|
132
|
+
type: ScalarTypeEnum.Boolean(),
|
|
133
|
+
isOptional: true
|
|
134
|
+
},
|
|
135
|
+
totalXp: {
|
|
136
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
137
|
+
isOptional: true
|
|
138
|
+
},
|
|
139
|
+
completionXpBonus: {
|
|
140
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
141
|
+
isOptional: true
|
|
142
|
+
},
|
|
143
|
+
completionBadgeKey: {
|
|
144
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
145
|
+
isOptional: true
|
|
146
|
+
},
|
|
147
|
+
streakHoursWindow: {
|
|
148
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
149
|
+
isOptional: true
|
|
150
|
+
},
|
|
151
|
+
streakBonusXp: {
|
|
152
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
153
|
+
isOptional: true
|
|
154
|
+
},
|
|
155
|
+
metadata: {
|
|
156
|
+
type: ScalarTypeEnum.JSON(),
|
|
157
|
+
isOptional: true
|
|
158
|
+
},
|
|
159
|
+
steps: {
|
|
160
|
+
type: OnboardingStepModel,
|
|
161
|
+
isArray: true,
|
|
162
|
+
isOptional: false
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const OnboardingStepProgressModel = defineSchemaModel({
|
|
167
|
+
name: "OnboardingStepProgress",
|
|
168
|
+
description: "Progress for a specific onboarding step.",
|
|
169
|
+
fields: {
|
|
170
|
+
stepId: {
|
|
171
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
172
|
+
isOptional: false
|
|
173
|
+
},
|
|
174
|
+
status: {
|
|
175
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
176
|
+
isOptional: false
|
|
177
|
+
},
|
|
178
|
+
xpEarned: {
|
|
179
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
180
|
+
isOptional: true
|
|
181
|
+
},
|
|
182
|
+
triggeringEvent: {
|
|
183
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
184
|
+
isOptional: true
|
|
185
|
+
},
|
|
186
|
+
eventPayload: {
|
|
187
|
+
type: ScalarTypeEnum.JSON(),
|
|
188
|
+
isOptional: true
|
|
189
|
+
},
|
|
190
|
+
completedAt: {
|
|
191
|
+
type: ScalarTypeEnum.DateTime(),
|
|
192
|
+
isOptional: true
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
const OnboardingProgressModel = defineSchemaModel({
|
|
197
|
+
name: "OnboardingProgress",
|
|
198
|
+
description: "Aggregated progress for an onboarding track.",
|
|
199
|
+
fields: {
|
|
200
|
+
learnerId: {
|
|
201
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
202
|
+
isOptional: true
|
|
203
|
+
},
|
|
204
|
+
trackId: {
|
|
205
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
206
|
+
isOptional: false
|
|
207
|
+
},
|
|
208
|
+
progress: {
|
|
209
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
210
|
+
isOptional: false
|
|
211
|
+
},
|
|
212
|
+
isCompleted: {
|
|
213
|
+
type: ScalarTypeEnum.Boolean(),
|
|
214
|
+
isOptional: false
|
|
215
|
+
},
|
|
216
|
+
xpEarned: {
|
|
217
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
218
|
+
isOptional: true
|
|
219
|
+
},
|
|
220
|
+
startedAt: {
|
|
221
|
+
type: ScalarTypeEnum.DateTime(),
|
|
222
|
+
isOptional: true
|
|
223
|
+
},
|
|
224
|
+
completedAt: {
|
|
225
|
+
type: ScalarTypeEnum.DateTime(),
|
|
226
|
+
isOptional: true
|
|
227
|
+
},
|
|
228
|
+
lastActivityAt: {
|
|
229
|
+
type: ScalarTypeEnum.DateTime(),
|
|
230
|
+
isOptional: true
|
|
231
|
+
},
|
|
232
|
+
steps: {
|
|
233
|
+
type: OnboardingStepProgressModel,
|
|
234
|
+
isArray: true,
|
|
235
|
+
isOptional: true
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
const ListOnboardingTracksInput = defineSchemaModel({
|
|
240
|
+
name: "ListOnboardingTracksInput",
|
|
241
|
+
description: "Filters for listing onboarding tracks.",
|
|
242
|
+
fields: {
|
|
243
|
+
learnerId: {
|
|
244
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
245
|
+
isOptional: true
|
|
246
|
+
},
|
|
247
|
+
productId: {
|
|
248
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
249
|
+
isOptional: true
|
|
250
|
+
},
|
|
251
|
+
trackIds: {
|
|
252
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
253
|
+
isArray: true,
|
|
254
|
+
isOptional: true
|
|
255
|
+
},
|
|
256
|
+
includeProgress: {
|
|
257
|
+
type: ScalarTypeEnum.Boolean(),
|
|
258
|
+
isOptional: true
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
const ListOnboardingTracksOutput = defineSchemaModel({
|
|
263
|
+
name: "ListOnboardingTracksOutput",
|
|
264
|
+
description: "Available onboarding tracks with optional progress.",
|
|
265
|
+
fields: {
|
|
266
|
+
tracks: {
|
|
267
|
+
type: OnboardingTrackModel,
|
|
268
|
+
isArray: true,
|
|
269
|
+
isOptional: false
|
|
270
|
+
},
|
|
271
|
+
progress: {
|
|
272
|
+
type: OnboardingProgressModel,
|
|
273
|
+
isArray: true,
|
|
274
|
+
isOptional: true
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
const GetOnboardingProgressInput = defineSchemaModel({
|
|
279
|
+
name: "GetOnboardingProgressInput",
|
|
280
|
+
description: "Input for fetching onboarding progress for a track.",
|
|
281
|
+
fields: {
|
|
282
|
+
trackId: {
|
|
283
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
284
|
+
isOptional: false
|
|
285
|
+
},
|
|
286
|
+
learnerId: {
|
|
287
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
288
|
+
isOptional: true
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
const RecordOnboardingEventInput = defineSchemaModel({
|
|
293
|
+
name: "RecordOnboardingEventInput",
|
|
294
|
+
description: "Record a domain event to advance onboarding progress via completion conditions.",
|
|
295
|
+
fields: {
|
|
296
|
+
learnerId: {
|
|
297
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
298
|
+
isOptional: false
|
|
299
|
+
},
|
|
300
|
+
trackId: {
|
|
301
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
302
|
+
isOptional: true
|
|
303
|
+
},
|
|
304
|
+
eventName: {
|
|
305
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
306
|
+
isOptional: false
|
|
307
|
+
},
|
|
308
|
+
eventVersion: {
|
|
309
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
310
|
+
isOptional: true
|
|
311
|
+
},
|
|
312
|
+
eventPayload: {
|
|
313
|
+
type: ScalarTypeEnum.JSON(),
|
|
314
|
+
isOptional: true
|
|
315
|
+
},
|
|
316
|
+
occurredAt: {
|
|
317
|
+
type: ScalarTypeEnum.DateTime(),
|
|
318
|
+
isOptional: true
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
const ListOnboardingTracksContract = defineQuery({
|
|
323
|
+
meta: {
|
|
324
|
+
key: "learning.onboarding.listTracks",
|
|
325
|
+
version: 1,
|
|
326
|
+
stability: "stable",
|
|
327
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
328
|
+
tags: [
|
|
329
|
+
"learning",
|
|
330
|
+
"onboarding",
|
|
331
|
+
"journey"
|
|
332
|
+
],
|
|
333
|
+
description: "List onboarding tracks available to a learner or product.",
|
|
334
|
+
goal: "Expose track catalog for UI/API surfaces.",
|
|
335
|
+
context: "Called when showing onboarding/learning journey catalog."
|
|
336
|
+
},
|
|
337
|
+
io: {
|
|
338
|
+
input: ListOnboardingTracksInput,
|
|
339
|
+
output: ListOnboardingTracksOutput
|
|
340
|
+
},
|
|
341
|
+
policy: { auth: "user" }
|
|
342
|
+
});
|
|
343
|
+
const GetOnboardingProgressContract = defineQuery({
|
|
344
|
+
meta: {
|
|
345
|
+
key: "learning.onboarding.getProgress",
|
|
346
|
+
version: 1,
|
|
347
|
+
stability: "stable",
|
|
348
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
349
|
+
tags: [
|
|
350
|
+
"learning",
|
|
351
|
+
"onboarding",
|
|
352
|
+
"journey"
|
|
353
|
+
],
|
|
354
|
+
description: "Fetch onboarding progress for a specific track.",
|
|
355
|
+
goal: "Display learner progress and remaining steps.",
|
|
356
|
+
context: "Called when rendering a track detail or widget."
|
|
357
|
+
},
|
|
358
|
+
io: {
|
|
359
|
+
input: GetOnboardingProgressInput,
|
|
360
|
+
output: OnboardingProgressModel
|
|
361
|
+
},
|
|
362
|
+
policy: { auth: "user" }
|
|
363
|
+
});
|
|
364
|
+
const RecordOnboardingEventContract = defineCommand({
|
|
365
|
+
meta: {
|
|
366
|
+
key: "learning.onboarding.recordEvent",
|
|
367
|
+
version: 1,
|
|
368
|
+
stability: "stable",
|
|
369
|
+
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
370
|
+
tags: [
|
|
371
|
+
"learning",
|
|
372
|
+
"onboarding",
|
|
373
|
+
"events"
|
|
374
|
+
],
|
|
375
|
+
description: "Record a domain event to evaluate onboarding step completion conditions.",
|
|
376
|
+
goal: "Advance onboarding automatically from product events.",
|
|
377
|
+
context: "Called by event bus handlers when relevant product events fire (e.g., deal.created)."
|
|
378
|
+
},
|
|
379
|
+
io: {
|
|
380
|
+
input: RecordOnboardingEventInput,
|
|
381
|
+
output: SuccessOutput,
|
|
382
|
+
errors: {
|
|
383
|
+
TRACK_NOT_FOUND: {
|
|
384
|
+
description: "Track not found for event routing",
|
|
385
|
+
http: 404,
|
|
386
|
+
gqlCode: "TRACK_NOT_FOUND",
|
|
387
|
+
when: "Track ID or routing context is invalid"
|
|
388
|
+
},
|
|
389
|
+
STEP_NOT_FOUND: {
|
|
390
|
+
description: "Step not found for completion condition",
|
|
391
|
+
http: 404,
|
|
392
|
+
gqlCode: "STEP_NOT_FOUND",
|
|
393
|
+
when: "No step matches the incoming event"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
policy: { auth: "user" }
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
//#endregion
|
|
401
|
+
export { GetOnboardingProgressContract, ListOnboardingTracksContract, OnboardingProgressModel, OnboardingStepModel, OnboardingStepProgressModel, OnboardingTrackModel, RecordOnboardingEventContract };
|
|
402
|
+
//# sourceMappingURL=onboarding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding.js","names":[],"sources":["../../src/contracts/onboarding.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@lssm/lib.schema';\nimport { defineCommand, defineQuery } from '@lssm/lib.contracts';\n\nimport { SuccessOutput } from './models';\nimport { LEARNING_JOURNEY_OWNERS } from './shared';\n\nconst OnboardingStepConditionModel = defineSchemaModel({\n name: 'OnboardingStepCondition',\n description: 'Structured completion condition for onboarding steps.',\n fields: {\n eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n eventVersion: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n payloadFilter: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nexport const OnboardingStepModel = defineSchemaModel({\n name: 'OnboardingStep',\n description: 'Declarative onboarding step definition.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n instructions: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n helpUrl: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n completionEvent: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n completionCondition: {\n type: OnboardingStepConditionModel,\n isOptional: true,\n },\n xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n canSkip: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n actionUrl: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n actionLabel: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nexport const OnboardingTrackModel = defineSchemaModel({\n name: 'OnboardingTrack',\n description: 'Onboarding track metadata and steps.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n targetUserSegment: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n targetRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n isRequired: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n canSkip: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n completionXpBonus: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n completionBadgeKey: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n streakHoursWindow: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n steps: { type: OnboardingStepModel, isArray: true, isOptional: false },\n },\n});\n\nexport const OnboardingStepProgressModel = defineSchemaModel({\n name: 'OnboardingStepProgress',\n description: 'Progress for a specific onboarding step.',\n fields: {\n stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n triggeringEvent: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n eventPayload: { type: ScalarTypeEnum.JSON(), isOptional: true },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\nexport const OnboardingProgressModel = defineSchemaModel({\n name: 'OnboardingProgress',\n description: 'Aggregated progress for an onboarding track.',\n fields: {\n learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n progress: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n isCompleted: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n xpEarned: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n lastActivityAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n steps: {\n type: OnboardingStepProgressModel,\n isArray: true,\n isOptional: true,\n },\n },\n});\n\nconst ListOnboardingTracksInput = defineSchemaModel({\n name: 'ListOnboardingTracksInput',\n description: 'Filters for listing onboarding tracks.',\n fields: {\n learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n trackIds: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: true,\n },\n includeProgress: {\n type: ScalarTypeEnum.Boolean(),\n isOptional: true,\n },\n },\n});\n\nconst ListOnboardingTracksOutput = defineSchemaModel({\n name: 'ListOnboardingTracksOutput',\n description: 'Available onboarding tracks with optional progress.',\n fields: {\n tracks: { type: OnboardingTrackModel, isArray: true, isOptional: false },\n progress: {\n type: OnboardingProgressModel,\n isArray: true,\n isOptional: true,\n },\n },\n});\n\nconst GetOnboardingProgressInput = defineSchemaModel({\n name: 'GetOnboardingProgressInput',\n description: 'Input for fetching onboarding progress for a track.',\n fields: {\n trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nconst RecordOnboardingEventInput = defineSchemaModel({\n name: 'RecordOnboardingEventInput',\n description:\n 'Record a domain event to advance onboarding progress via completion conditions.',\n fields: {\n learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n trackId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n eventVersion: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n eventPayload: { type: ScalarTypeEnum.JSON(), isOptional: true },\n occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\nexport const ListOnboardingTracksContract = defineQuery({\n meta: {\n key: 'learning.onboarding.listTracks',\n version: 1,\n stability: 'stable',\n owners: [...LEARNING_JOURNEY_OWNERS],\n tags: ['learning', 'onboarding', 'journey'],\n description: 'List onboarding tracks available to a learner or product.',\n goal: 'Expose track catalog for UI/API surfaces.',\n context: 'Called when showing onboarding/learning journey catalog.',\n },\n io: {\n input: ListOnboardingTracksInput,\n output: ListOnboardingTracksOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n\nexport const GetOnboardingProgressContract = defineQuery({\n meta: {\n key: 'learning.onboarding.getProgress',\n version: 1,\n stability: 'stable',\n owners: [...LEARNING_JOURNEY_OWNERS],\n tags: ['learning', 'onboarding', 'journey'],\n description: 'Fetch onboarding progress for a specific track.',\n goal: 'Display learner progress and remaining steps.',\n context: 'Called when rendering a track detail or widget.',\n },\n io: {\n input: GetOnboardingProgressInput,\n output: OnboardingProgressModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\nexport const RecordOnboardingEventContract = defineCommand({\n meta: {\n key: 'learning.onboarding.recordEvent',\n version: 1,\n stability: 'stable',\n owners: [...LEARNING_JOURNEY_OWNERS],\n tags: ['learning', 'onboarding', 'events'],\n description:\n 'Record a domain event to evaluate onboarding step completion conditions.',\n goal: 'Advance onboarding automatically from product events.',\n context:\n 'Called by event bus handlers when relevant product events fire (e.g., deal.created).',\n },\n io: {\n input: RecordOnboardingEventInput,\n output: SuccessOutput,\n errors: {\n TRACK_NOT_FOUND: {\n description: 'Track not found for event routing',\n http: 404,\n gqlCode: 'TRACK_NOT_FOUND',\n when: 'Track ID or routing context is invalid',\n },\n STEP_NOT_FOUND: {\n description: 'Step not found for completion condition',\n http: 404,\n gqlCode: 'STEP_NOT_FOUND',\n when: 'No step matches the incoming event',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n"],"mappings":";;;;;;AAMA,MAAM,+BAA+B,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,WAAW;GAAE,MAAM,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