@lssm/module.learning-journey 0.0.0-canary-20251217080011 → 1.41.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/contracts/index.js +1 -6
- package/dist/contracts/models.js +1 -389
- package/dist/contracts/onboarding.js +1 -404
- package/dist/contracts/operations.js +1 -151
- package/dist/contracts/shared.js +1 -5
- package/dist/docs/index.js +1 -1
- package/dist/docs/learning-journey.docblock.js +5 -61
- package/dist/engines/index.js +1 -5
- package/dist/engines/srs.js +1 -219
- package/dist/engines/streak.js +1 -193
- package/dist/engines/xp.js +1 -212
- package/dist/entities/ai.js +1 -376
- package/dist/entities/course.js +1 -316
- package/dist/entities/flashcard.js +1 -249
- package/dist/entities/gamification.js +1 -392
- package/dist/entities/index.js +1 -44
- package/dist/entities/learner.js +1 -365
- package/dist/entities/onboarding.js +1 -307
- package/dist/entities/quiz.js +1 -370
- package/dist/events.js +1 -583
- package/dist/index.js +1 -22
- package/dist/learning-journey.feature.js +1 -148
- package/package.json +28 -29
- package/dist/contracts/index.d.ts +0 -5
- package/dist/contracts/models.d.ts +0 -450
- package/dist/contracts/onboarding.d.ts +0 -665
- package/dist/contracts/operations.d.ts +0 -279
- package/dist/contracts/shared.d.ts +0 -4
- package/dist/docs/index.d.ts +0 -1
- package/dist/docs/learning-journey.docblock.d.ts +0 -1
- package/dist/engines/index.d.ts +0 -4
- package/dist/engines/srs.d.ts +0 -110
- package/dist/engines/streak.d.ts +0 -99
- package/dist/engines/xp.d.ts +0 -96
- package/dist/entities/ai.d.ts +0 -231
- package/dist/entities/course.d.ts +0 -183
- package/dist/entities/flashcard.d.ts +0 -169
- package/dist/entities/gamification.d.ts +0 -237
- package/dist/entities/index.d.ts +0 -628
- package/dist/entities/learner.d.ts +0 -223
- package/dist/entities/onboarding.d.ts +0 -189
- package/dist/entities/quiz.d.ts +0 -219
- package/dist/events.d.ts +0 -795
- package/dist/index.d.ts +0 -19
- package/dist/learning-journey.feature.d.ts +0 -11
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/contracts/dist/events.js +0 -10
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -71
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
- package/dist/libs/contracts/dist/integrations/index.js +0 -18
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/jsonschema.js +0 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/libs/contracts/dist/knowledge/index.js +0 -7
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/llm/exporters.js +0 -19
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -1
- package/dist/libs/contracts/dist/onboarding-base.js +0 -196
- package/dist/libs/contracts/dist/openapi.js +0 -1
- package/dist/libs/contracts/dist/ownership.js +0 -21
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -11
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -1
- package/dist/libs/contracts/dist/regenerator/service.js +0 -6
- package/dist/libs/contracts/dist/registry.js +0 -2
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -34
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -2
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/schema/dist/EnumType.js +0 -2
- package/dist/libs/schema/dist/FieldType.js +0 -49
- package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/schema/dist/SchemaModel.js +0 -39
- package/dist/libs/schema/dist/entity/defineEntity.js +0 -236
- package/dist/libs/schema/dist/entity/index.js +0 -2
- package/dist/libs/schema/dist/entity/types.js +0 -1
- package/dist/libs/schema/dist/index.js +0 -6
- package/dist/track-spec.d.ts +0 -128
|
@@ -1,404 +1 @@
|
|
|
1
|
-
import { ScalarTypeEnum }
|
|
2
|
-
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
3
|
-
import "../libs/schema/dist/index.js";
|
|
4
|
-
import { defineCommand, defineQuery } from "../libs/contracts/dist/spec.js";
|
|
5
|
-
import "../libs/contracts/dist/index.js";
|
|
6
|
-
import { LEARNING_JOURNEY_OWNERS } from "./shared.js";
|
|
7
|
-
import { SuccessOutput } from "./models.js";
|
|
8
|
-
|
|
9
|
-
//#region src/contracts/onboarding.ts
|
|
10
|
-
const OnboardingStepConditionModel = defineSchemaModel({
|
|
11
|
-
name: "OnboardingStepCondition",
|
|
12
|
-
description: "Structured completion condition for onboarding steps.",
|
|
13
|
-
fields: {
|
|
14
|
-
eventName: {
|
|
15
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
16
|
-
isOptional: false
|
|
17
|
-
},
|
|
18
|
-
eventVersion: {
|
|
19
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
20
|
-
isOptional: true
|
|
21
|
-
},
|
|
22
|
-
sourceModule: {
|
|
23
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
24
|
-
isOptional: true
|
|
25
|
-
},
|
|
26
|
-
payloadFilter: {
|
|
27
|
-
type: ScalarTypeEnum.JSON(),
|
|
28
|
-
isOptional: true
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const OnboardingStepModel = defineSchemaModel({
|
|
33
|
-
name: "OnboardingStep",
|
|
34
|
-
description: "Declarative onboarding step definition.",
|
|
35
|
-
fields: {
|
|
36
|
-
id: {
|
|
37
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
38
|
-
isOptional: false
|
|
39
|
-
},
|
|
40
|
-
trackId: {
|
|
41
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
42
|
-
isOptional: false
|
|
43
|
-
},
|
|
44
|
-
title: {
|
|
45
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
-
isOptional: false
|
|
47
|
-
},
|
|
48
|
-
description: {
|
|
49
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
-
isOptional: true
|
|
51
|
-
},
|
|
52
|
-
instructions: {
|
|
53
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
54
|
-
isOptional: true
|
|
55
|
-
},
|
|
56
|
-
helpUrl: {
|
|
57
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
58
|
-
isOptional: true
|
|
59
|
-
},
|
|
60
|
-
order: {
|
|
61
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
62
|
-
isOptional: false
|
|
63
|
-
},
|
|
64
|
-
completionEvent: {
|
|
65
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
66
|
-
isOptional: false
|
|
67
|
-
},
|
|
68
|
-
completionCondition: {
|
|
69
|
-
type: OnboardingStepConditionModel,
|
|
70
|
-
isOptional: true
|
|
71
|
-
},
|
|
72
|
-
xpReward: {
|
|
73
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
74
|
-
isOptional: true
|
|
75
|
-
},
|
|
76
|
-
isRequired: {
|
|
77
|
-
type: ScalarTypeEnum.Boolean(),
|
|
78
|
-
isOptional: true
|
|
79
|
-
},
|
|
80
|
-
canSkip: {
|
|
81
|
-
type: ScalarTypeEnum.Boolean(),
|
|
82
|
-
isOptional: true
|
|
83
|
-
},
|
|
84
|
-
actionUrl: {
|
|
85
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
-
isOptional: true
|
|
87
|
-
},
|
|
88
|
-
actionLabel: {
|
|
89
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
90
|
-
isOptional: true
|
|
91
|
-
},
|
|
92
|
-
metadata: {
|
|
93
|
-
type: ScalarTypeEnum.JSON(),
|
|
94
|
-
isOptional: true
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const OnboardingTrackModel = defineSchemaModel({
|
|
99
|
-
name: "OnboardingTrack",
|
|
100
|
-
description: "Onboarding track metadata and steps.",
|
|
101
|
-
fields: {
|
|
102
|
-
id: {
|
|
103
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
104
|
-
isOptional: false
|
|
105
|
-
},
|
|
106
|
-
productId: {
|
|
107
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
108
|
-
isOptional: true
|
|
109
|
-
},
|
|
110
|
-
name: {
|
|
111
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
112
|
-
isOptional: false
|
|
113
|
-
},
|
|
114
|
-
description: {
|
|
115
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
116
|
-
isOptional: true
|
|
117
|
-
},
|
|
118
|
-
targetUserSegment: {
|
|
119
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
120
|
-
isOptional: true
|
|
121
|
-
},
|
|
122
|
-
targetRole: {
|
|
123
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
124
|
-
isOptional: true
|
|
125
|
-
},
|
|
126
|
-
isActive: {
|
|
127
|
-
type: ScalarTypeEnum.Boolean(),
|
|
128
|
-
isOptional: true
|
|
129
|
-
},
|
|
130
|
-
isRequired: {
|
|
131
|
-
type: ScalarTypeEnum.Boolean(),
|
|
132
|
-
isOptional: true
|
|
133
|
-
},
|
|
134
|
-
canSkip: {
|
|
135
|
-
type: ScalarTypeEnum.Boolean(),
|
|
136
|
-
isOptional: true
|
|
137
|
-
},
|
|
138
|
-
totalXp: {
|
|
139
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
140
|
-
isOptional: true
|
|
141
|
-
},
|
|
142
|
-
completionXpBonus: {
|
|
143
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
144
|
-
isOptional: true
|
|
145
|
-
},
|
|
146
|
-
completionBadgeKey: {
|
|
147
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
148
|
-
isOptional: true
|
|
149
|
-
},
|
|
150
|
-
streakHoursWindow: {
|
|
151
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
152
|
-
isOptional: true
|
|
153
|
-
},
|
|
154
|
-
streakBonusXp: {
|
|
155
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
156
|
-
isOptional: true
|
|
157
|
-
},
|
|
158
|
-
metadata: {
|
|
159
|
-
type: ScalarTypeEnum.JSON(),
|
|
160
|
-
isOptional: true
|
|
161
|
-
},
|
|
162
|
-
steps: {
|
|
163
|
-
type: OnboardingStepModel,
|
|
164
|
-
isArray: true,
|
|
165
|
-
isOptional: false
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
const OnboardingStepProgressModel = defineSchemaModel({
|
|
170
|
-
name: "OnboardingStepProgress",
|
|
171
|
-
description: "Progress for a specific onboarding step.",
|
|
172
|
-
fields: {
|
|
173
|
-
stepId: {
|
|
174
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
175
|
-
isOptional: false
|
|
176
|
-
},
|
|
177
|
-
status: {
|
|
178
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
179
|
-
isOptional: false
|
|
180
|
-
},
|
|
181
|
-
xpEarned: {
|
|
182
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
183
|
-
isOptional: true
|
|
184
|
-
},
|
|
185
|
-
triggeringEvent: {
|
|
186
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
187
|
-
isOptional: true
|
|
188
|
-
},
|
|
189
|
-
eventPayload: {
|
|
190
|
-
type: ScalarTypeEnum.JSON(),
|
|
191
|
-
isOptional: true
|
|
192
|
-
},
|
|
193
|
-
completedAt: {
|
|
194
|
-
type: ScalarTypeEnum.DateTime(),
|
|
195
|
-
isOptional: true
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
const OnboardingProgressModel = defineSchemaModel({
|
|
200
|
-
name: "OnboardingProgress",
|
|
201
|
-
description: "Aggregated progress for an onboarding track.",
|
|
202
|
-
fields: {
|
|
203
|
-
learnerId: {
|
|
204
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
205
|
-
isOptional: true
|
|
206
|
-
},
|
|
207
|
-
trackId: {
|
|
208
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
209
|
-
isOptional: false
|
|
210
|
-
},
|
|
211
|
-
progress: {
|
|
212
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
213
|
-
isOptional: false
|
|
214
|
-
},
|
|
215
|
-
isCompleted: {
|
|
216
|
-
type: ScalarTypeEnum.Boolean(),
|
|
217
|
-
isOptional: false
|
|
218
|
-
},
|
|
219
|
-
xpEarned: {
|
|
220
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
221
|
-
isOptional: true
|
|
222
|
-
},
|
|
223
|
-
startedAt: {
|
|
224
|
-
type: ScalarTypeEnum.DateTime(),
|
|
225
|
-
isOptional: true
|
|
226
|
-
},
|
|
227
|
-
completedAt: {
|
|
228
|
-
type: ScalarTypeEnum.DateTime(),
|
|
229
|
-
isOptional: true
|
|
230
|
-
},
|
|
231
|
-
lastActivityAt: {
|
|
232
|
-
type: ScalarTypeEnum.DateTime(),
|
|
233
|
-
isOptional: true
|
|
234
|
-
},
|
|
235
|
-
steps: {
|
|
236
|
-
type: OnboardingStepProgressModel,
|
|
237
|
-
isArray: true,
|
|
238
|
-
isOptional: true
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
const ListOnboardingTracksInput = defineSchemaModel({
|
|
243
|
-
name: "ListOnboardingTracksInput",
|
|
244
|
-
description: "Filters for listing onboarding tracks.",
|
|
245
|
-
fields: {
|
|
246
|
-
learnerId: {
|
|
247
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
248
|
-
isOptional: true
|
|
249
|
-
},
|
|
250
|
-
productId: {
|
|
251
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
252
|
-
isOptional: true
|
|
253
|
-
},
|
|
254
|
-
trackIds: {
|
|
255
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
256
|
-
isArray: true,
|
|
257
|
-
isOptional: true
|
|
258
|
-
},
|
|
259
|
-
includeProgress: {
|
|
260
|
-
type: ScalarTypeEnum.Boolean(),
|
|
261
|
-
isOptional: true
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
const ListOnboardingTracksOutput = defineSchemaModel({
|
|
266
|
-
name: "ListOnboardingTracksOutput",
|
|
267
|
-
description: "Available onboarding tracks with optional progress.",
|
|
268
|
-
fields: {
|
|
269
|
-
tracks: {
|
|
270
|
-
type: OnboardingTrackModel,
|
|
271
|
-
isArray: true,
|
|
272
|
-
isOptional: false
|
|
273
|
-
},
|
|
274
|
-
progress: {
|
|
275
|
-
type: OnboardingProgressModel,
|
|
276
|
-
isArray: true,
|
|
277
|
-
isOptional: true
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
const GetOnboardingProgressInput = defineSchemaModel({
|
|
282
|
-
name: "GetOnboardingProgressInput",
|
|
283
|
-
description: "Input for fetching onboarding progress for a track.",
|
|
284
|
-
fields: {
|
|
285
|
-
trackId: {
|
|
286
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
287
|
-
isOptional: false
|
|
288
|
-
},
|
|
289
|
-
learnerId: {
|
|
290
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
291
|
-
isOptional: true
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
const RecordOnboardingEventInput = defineSchemaModel({
|
|
296
|
-
name: "RecordOnboardingEventInput",
|
|
297
|
-
description: "Record a domain event to advance onboarding progress via completion conditions.",
|
|
298
|
-
fields: {
|
|
299
|
-
learnerId: {
|
|
300
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
301
|
-
isOptional: false
|
|
302
|
-
},
|
|
303
|
-
trackId: {
|
|
304
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
305
|
-
isOptional: true
|
|
306
|
-
},
|
|
307
|
-
eventName: {
|
|
308
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
309
|
-
isOptional: false
|
|
310
|
-
},
|
|
311
|
-
eventVersion: {
|
|
312
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
313
|
-
isOptional: true
|
|
314
|
-
},
|
|
315
|
-
eventPayload: {
|
|
316
|
-
type: ScalarTypeEnum.JSON(),
|
|
317
|
-
isOptional: true
|
|
318
|
-
},
|
|
319
|
-
occurredAt: {
|
|
320
|
-
type: ScalarTypeEnum.DateTime(),
|
|
321
|
-
isOptional: true
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
const ListOnboardingTracksContract = defineQuery({
|
|
326
|
-
meta: {
|
|
327
|
-
name: "learning.onboarding.listTracks",
|
|
328
|
-
version: 1,
|
|
329
|
-
stability: "stable",
|
|
330
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
331
|
-
tags: [
|
|
332
|
-
"learning",
|
|
333
|
-
"onboarding",
|
|
334
|
-
"journey"
|
|
335
|
-
],
|
|
336
|
-
description: "List onboarding tracks available to a learner or product.",
|
|
337
|
-
goal: "Expose track catalog for UI/API surfaces.",
|
|
338
|
-
context: "Called when showing onboarding/learning journey catalog."
|
|
339
|
-
},
|
|
340
|
-
io: {
|
|
341
|
-
input: ListOnboardingTracksInput,
|
|
342
|
-
output: ListOnboardingTracksOutput
|
|
343
|
-
},
|
|
344
|
-
policy: { auth: "user" }
|
|
345
|
-
});
|
|
346
|
-
const GetOnboardingProgressContract = defineQuery({
|
|
347
|
-
meta: {
|
|
348
|
-
name: "learning.onboarding.getProgress",
|
|
349
|
-
version: 1,
|
|
350
|
-
stability: "stable",
|
|
351
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
352
|
-
tags: [
|
|
353
|
-
"learning",
|
|
354
|
-
"onboarding",
|
|
355
|
-
"journey"
|
|
356
|
-
],
|
|
357
|
-
description: "Fetch onboarding progress for a specific track.",
|
|
358
|
-
goal: "Display learner progress and remaining steps.",
|
|
359
|
-
context: "Called when rendering a track detail or widget."
|
|
360
|
-
},
|
|
361
|
-
io: {
|
|
362
|
-
input: GetOnboardingProgressInput,
|
|
363
|
-
output: OnboardingProgressModel
|
|
364
|
-
},
|
|
365
|
-
policy: { auth: "user" }
|
|
366
|
-
});
|
|
367
|
-
const RecordOnboardingEventContract = defineCommand({
|
|
368
|
-
meta: {
|
|
369
|
-
name: "learning.onboarding.recordEvent",
|
|
370
|
-
version: 1,
|
|
371
|
-
stability: "stable",
|
|
372
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
373
|
-
tags: [
|
|
374
|
-
"learning",
|
|
375
|
-
"onboarding",
|
|
376
|
-
"events"
|
|
377
|
-
],
|
|
378
|
-
description: "Record a domain event to evaluate onboarding step completion conditions.",
|
|
379
|
-
goal: "Advance onboarding automatically from product events.",
|
|
380
|
-
context: "Called by event bus handlers when relevant product events fire (e.g., deal.created)."
|
|
381
|
-
},
|
|
382
|
-
io: {
|
|
383
|
-
input: RecordOnboardingEventInput,
|
|
384
|
-
output: SuccessOutput,
|
|
385
|
-
errors: {
|
|
386
|
-
TRACK_NOT_FOUND: {
|
|
387
|
-
description: "Track not found for event routing",
|
|
388
|
-
http: 404,
|
|
389
|
-
gqlCode: "TRACK_NOT_FOUND",
|
|
390
|
-
when: "Track ID or routing context is invalid"
|
|
391
|
-
},
|
|
392
|
-
STEP_NOT_FOUND: {
|
|
393
|
-
description: "Step not found for completion condition",
|
|
394
|
-
http: 404,
|
|
395
|
-
gqlCode: "STEP_NOT_FOUND",
|
|
396
|
-
when: "No step matches the incoming event"
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
|
-
policy: { auth: "user" }
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
//#endregion
|
|
404
|
-
export { GetOnboardingProgressContract, ListOnboardingTracksContract, OnboardingProgressModel, OnboardingStepModel, OnboardingStepProgressModel, OnboardingTrackModel, RecordOnboardingEventContract };
|
|
1
|
+
import{LEARNING_JOURNEY_OWNERS as e}from"./shared.js";import{SuccessOutput as t}from"./models.js";import{ScalarTypeEnum as n,defineSchemaModel as r}from"@lssm/lib.schema";import{defineCommand as i,defineQuery as a}from"@lssm/lib.contracts";const o=r({name:`OnboardingStepCondition`,description:`Structured completion condition for onboarding steps.`,fields:{eventName:{type:n.String_unsecure(),isOptional:!1},eventVersion:{type:n.Int_unsecure(),isOptional:!0},sourceModule:{type:n.String_unsecure(),isOptional:!0},payloadFilter:{type:n.JSON(),isOptional:!0}}}),s=r({name:`OnboardingStep`,description:`Declarative onboarding step definition.`,fields:{id:{type:n.String_unsecure(),isOptional:!1},trackId:{type:n.String_unsecure(),isOptional:!1},title:{type:n.String_unsecure(),isOptional:!1},description:{type:n.String_unsecure(),isOptional:!0},instructions:{type:n.String_unsecure(),isOptional:!0},helpUrl:{type:n.String_unsecure(),isOptional:!0},order:{type:n.Int_unsecure(),isOptional:!1},completionEvent:{type:n.String_unsecure(),isOptional:!1},completionCondition:{type:o,isOptional:!0},xpReward:{type:n.Int_unsecure(),isOptional:!0},isRequired:{type:n.Boolean(),isOptional:!0},canSkip:{type:n.Boolean(),isOptional:!0},actionUrl:{type:n.String_unsecure(),isOptional:!0},actionLabel:{type:n.String_unsecure(),isOptional:!0},metadata:{type:n.JSON(),isOptional:!0}}}),c=r({name:`OnboardingTrack`,description:`Onboarding track metadata and steps.`,fields:{id:{type:n.String_unsecure(),isOptional:!1},productId:{type:n.String_unsecure(),isOptional:!0},name:{type:n.String_unsecure(),isOptional:!1},description:{type:n.String_unsecure(),isOptional:!0},targetUserSegment:{type:n.String_unsecure(),isOptional:!0},targetRole:{type:n.String_unsecure(),isOptional:!0},isActive:{type:n.Boolean(),isOptional:!0},isRequired:{type:n.Boolean(),isOptional:!0},canSkip:{type:n.Boolean(),isOptional:!0},totalXp:{type:n.Int_unsecure(),isOptional:!0},completionXpBonus:{type:n.Int_unsecure(),isOptional:!0},completionBadgeKey:{type:n.String_unsecure(),isOptional:!0},streakHoursWindow:{type:n.Int_unsecure(),isOptional:!0},streakBonusXp:{type:n.Int_unsecure(),isOptional:!0},metadata:{type:n.JSON(),isOptional:!0},steps:{type:s,isArray:!0,isOptional:!1}}}),l=r({name:`OnboardingStepProgress`,description:`Progress for a specific onboarding step.`,fields:{stepId:{type:n.String_unsecure(),isOptional:!1},status:{type:n.String_unsecure(),isOptional:!1},xpEarned:{type:n.Int_unsecure(),isOptional:!0},triggeringEvent:{type:n.String_unsecure(),isOptional:!0},eventPayload:{type:n.JSON(),isOptional:!0},completedAt:{type:n.DateTime(),isOptional:!0}}}),u=r({name:`OnboardingProgress`,description:`Aggregated progress for an onboarding track.`,fields:{learnerId:{type:n.String_unsecure(),isOptional:!0},trackId:{type:n.String_unsecure(),isOptional:!1},progress:{type:n.Int_unsecure(),isOptional:!1},isCompleted:{type:n.Boolean(),isOptional:!1},xpEarned:{type:n.Int_unsecure(),isOptional:!0},startedAt:{type:n.DateTime(),isOptional:!0},completedAt:{type:n.DateTime(),isOptional:!0},lastActivityAt:{type:n.DateTime(),isOptional:!0},steps:{type:l,isArray:!0,isOptional:!0}}}),d=r({name:`ListOnboardingTracksInput`,description:`Filters for listing onboarding tracks.`,fields:{learnerId:{type:n.String_unsecure(),isOptional:!0},productId:{type:n.String_unsecure(),isOptional:!0},trackIds:{type:n.String_unsecure(),isArray:!0,isOptional:!0},includeProgress:{type:n.Boolean(),isOptional:!0}}}),f=r({name:`ListOnboardingTracksOutput`,description:`Available onboarding tracks with optional progress.`,fields:{tracks:{type:c,isArray:!0,isOptional:!1},progress:{type:u,isArray:!0,isOptional:!0}}}),p=r({name:`GetOnboardingProgressInput`,description:`Input for fetching onboarding progress for a track.`,fields:{trackId:{type:n.String_unsecure(),isOptional:!1},learnerId:{type:n.String_unsecure(),isOptional:!0}}}),m=r({name:`RecordOnboardingEventInput`,description:`Record a domain event to advance onboarding progress via completion conditions.`,fields:{learnerId:{type:n.String_unsecure(),isOptional:!1},trackId:{type:n.String_unsecure(),isOptional:!0},eventName:{type:n.String_unsecure(),isOptional:!1},eventVersion:{type:n.Int_unsecure(),isOptional:!0},eventPayload:{type:n.JSON(),isOptional:!0},occurredAt:{type:n.DateTime(),isOptional:!0}}}),h=a({meta:{name:`learning.onboarding.listTracks`,version:1,stability:`stable`,owners:[...e],tags:[`learning`,`onboarding`,`journey`],description:`List onboarding tracks available to a learner or product.`,goal:`Expose track catalog for UI/API surfaces.`,context:`Called when showing onboarding/learning journey catalog.`},io:{input:d,output:f},policy:{auth:`user`}}),g=a({meta:{name:`learning.onboarding.getProgress`,version:1,stability:`stable`,owners:[...e],tags:[`learning`,`onboarding`,`journey`],description:`Fetch onboarding progress for a specific track.`,goal:`Display learner progress and remaining steps.`,context:`Called when rendering a track detail or widget.`},io:{input:p,output:u},policy:{auth:`user`}}),_=i({meta:{name:`learning.onboarding.recordEvent`,version:1,stability:`stable`,owners:[...e],tags:[`learning`,`onboarding`,`events`],description:`Record a domain event to evaluate onboarding step completion conditions.`,goal:`Advance onboarding automatically from product events.`,context:`Called by event bus handlers when relevant product events fire (e.g., deal.created).`},io:{input:m,output:t,errors:{TRACK_NOT_FOUND:{description:`Track not found for event routing`,http:404,gqlCode:`TRACK_NOT_FOUND`,when:`Track ID or routing context is invalid`},STEP_NOT_FOUND:{description:`Step not found for completion condition`,http:404,gqlCode:`STEP_NOT_FOUND`,when:`No step matches the incoming event`}}},policy:{auth:`user`}});export{g as GetOnboardingProgressContract,h as ListOnboardingTracksContract,u as OnboardingProgressModel,s as OnboardingStepModel,l as OnboardingStepProgressModel,c as OnboardingTrackModel,_ as RecordOnboardingEventContract};
|
|
@@ -1,151 +1 @@
|
|
|
1
|
-
import { defineCommand,
|
|
2
|
-
import "../libs/contracts/dist/index.js";
|
|
3
|
-
import { LEARNING_JOURNEY_OWNERS } from "./shared.js";
|
|
4
|
-
import { CompleteLessonInput, EnrollInCourseInput, EnrollmentModel, GetDueCardsInput, GetDueCardsOutput, GetLearnerDashboardInput, LearnerDashboardModel, SubmitCardReviewInput, SuccessOutput } from "./models.js";
|
|
5
|
-
|
|
6
|
-
//#region src/contracts/operations.ts
|
|
7
|
-
/**
|
|
8
|
-
* Enroll in a course.
|
|
9
|
-
*/
|
|
10
|
-
const EnrollInCourseContract = defineCommand({
|
|
11
|
-
meta: {
|
|
12
|
-
name: "learning.enroll",
|
|
13
|
-
version: 1,
|
|
14
|
-
stability: "stable",
|
|
15
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
16
|
-
tags: ["learning", "enrollment"],
|
|
17
|
-
description: "Enroll in a course.",
|
|
18
|
-
goal: "Start learning a new course.",
|
|
19
|
-
context: "Called when a learner wants to start a course."
|
|
20
|
-
},
|
|
21
|
-
io: {
|
|
22
|
-
input: EnrollInCourseInput,
|
|
23
|
-
output: EnrollmentModel,
|
|
24
|
-
errors: {
|
|
25
|
-
COURSE_NOT_FOUND: {
|
|
26
|
-
description: "Course does not exist",
|
|
27
|
-
http: 404,
|
|
28
|
-
gqlCode: "COURSE_NOT_FOUND",
|
|
29
|
-
when: "Course ID is invalid"
|
|
30
|
-
},
|
|
31
|
-
ALREADY_ENROLLED: {
|
|
32
|
-
description: "Already enrolled in course",
|
|
33
|
-
http: 409,
|
|
34
|
-
gqlCode: "ALREADY_ENROLLED",
|
|
35
|
-
when: "Learner is already enrolled"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
policy: { auth: "user" }
|
|
40
|
-
});
|
|
41
|
-
/**
|
|
42
|
-
* Complete a lesson.
|
|
43
|
-
*/
|
|
44
|
-
const CompleteLessonContract = defineCommand({
|
|
45
|
-
meta: {
|
|
46
|
-
name: "learning.completeLesson",
|
|
47
|
-
version: 1,
|
|
48
|
-
stability: "stable",
|
|
49
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
50
|
-
tags: ["learning", "progress"],
|
|
51
|
-
description: "Mark a lesson as completed.",
|
|
52
|
-
goal: "Record lesson completion and earn XP.",
|
|
53
|
-
context: "Called when a learner finishes a lesson."
|
|
54
|
-
},
|
|
55
|
-
io: {
|
|
56
|
-
input: CompleteLessonInput,
|
|
57
|
-
output: SuccessOutput,
|
|
58
|
-
errors: {
|
|
59
|
-
LESSON_NOT_FOUND: {
|
|
60
|
-
description: "Lesson does not exist",
|
|
61
|
-
http: 404,
|
|
62
|
-
gqlCode: "LESSON_NOT_FOUND",
|
|
63
|
-
when: "Lesson ID is invalid"
|
|
64
|
-
},
|
|
65
|
-
NOT_ENROLLED: {
|
|
66
|
-
description: "Not enrolled in course",
|
|
67
|
-
http: 403,
|
|
68
|
-
gqlCode: "NOT_ENROLLED",
|
|
69
|
-
when: "Learner is not enrolled in the course"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
policy: { auth: "user" }
|
|
74
|
-
});
|
|
75
|
-
/**
|
|
76
|
-
* Submit a card review.
|
|
77
|
-
*/
|
|
78
|
-
const SubmitCardReviewContract = defineCommand({
|
|
79
|
-
meta: {
|
|
80
|
-
name: "learning.submitCardReview",
|
|
81
|
-
version: 1,
|
|
82
|
-
stability: "stable",
|
|
83
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
84
|
-
tags: ["learning", "flashcards"],
|
|
85
|
-
description: "Submit a flashcard review.",
|
|
86
|
-
goal: "Record review and update SRS schedule.",
|
|
87
|
-
context: "Called when reviewing flashcards."
|
|
88
|
-
},
|
|
89
|
-
io: {
|
|
90
|
-
input: SubmitCardReviewInput,
|
|
91
|
-
output: SuccessOutput,
|
|
92
|
-
errors: {
|
|
93
|
-
CARD_NOT_FOUND: {
|
|
94
|
-
description: "Card does not exist",
|
|
95
|
-
http: 404,
|
|
96
|
-
gqlCode: "CARD_NOT_FOUND",
|
|
97
|
-
when: "Card ID is invalid"
|
|
98
|
-
},
|
|
99
|
-
INVALID_RATING: {
|
|
100
|
-
description: "Invalid rating",
|
|
101
|
-
http: 400,
|
|
102
|
-
gqlCode: "INVALID_RATING",
|
|
103
|
-
when: "Rating must be AGAIN, HARD, GOOD, or EASY"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
policy: { auth: "user" }
|
|
108
|
-
});
|
|
109
|
-
/**
|
|
110
|
-
* Get cards due for review.
|
|
111
|
-
*/
|
|
112
|
-
const GetDueCardsContract = defineQuery({
|
|
113
|
-
meta: {
|
|
114
|
-
name: "learning.getDueCards",
|
|
115
|
-
version: 1,
|
|
116
|
-
stability: "stable",
|
|
117
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
118
|
-
tags: ["learning", "flashcards"],
|
|
119
|
-
description: "Get flashcards due for review.",
|
|
120
|
-
goal: "Get the next batch of cards to review.",
|
|
121
|
-
context: "Called when starting a review session."
|
|
122
|
-
},
|
|
123
|
-
io: {
|
|
124
|
-
input: GetDueCardsInput,
|
|
125
|
-
output: GetDueCardsOutput
|
|
126
|
-
},
|
|
127
|
-
policy: { auth: "user" }
|
|
128
|
-
});
|
|
129
|
-
/**
|
|
130
|
-
* Get learner dashboard.
|
|
131
|
-
*/
|
|
132
|
-
const GetLearnerDashboardContract = defineQuery({
|
|
133
|
-
meta: {
|
|
134
|
-
name: "learning.getDashboard",
|
|
135
|
-
version: 1,
|
|
136
|
-
stability: "stable",
|
|
137
|
-
owners: [...LEARNING_JOURNEY_OWNERS],
|
|
138
|
-
tags: ["learning", "dashboard"],
|
|
139
|
-
description: "Get learner dashboard data.",
|
|
140
|
-
goal: "Display learner progress and stats.",
|
|
141
|
-
context: "Called when viewing the learning dashboard."
|
|
142
|
-
},
|
|
143
|
-
io: {
|
|
144
|
-
input: GetLearnerDashboardInput,
|
|
145
|
-
output: LearnerDashboardModel
|
|
146
|
-
},
|
|
147
|
-
policy: { auth: "user" }
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
//#endregion
|
|
151
|
-
export { CompleteLessonContract, EnrollInCourseContract, GetDueCardsContract, GetLearnerDashboardContract, SubmitCardReviewContract };
|
|
1
|
+
import{LEARNING_JOURNEY_OWNERS as e}from"./shared.js";import{CompleteLessonInput as t,EnrollInCourseInput as n,EnrollmentModel as r,GetDueCardsInput as i,GetDueCardsOutput as a,GetLearnerDashboardInput as o,LearnerDashboardModel as s,SubmitCardReviewInput as c,SuccessOutput as l}from"./models.js";import{defineCommand as u,defineQuery as d}from"@lssm/lib.contracts";const f=u({meta:{name:`learning.enroll`,version:1,stability:`stable`,owners:[...e],tags:[`learning`,`enrollment`],description:`Enroll in a course.`,goal:`Start learning a new course.`,context:`Called when a learner wants to start a course.`},io:{input:n,output:r,errors:{COURSE_NOT_FOUND:{description:`Course does not exist`,http:404,gqlCode:`COURSE_NOT_FOUND`,when:`Course ID is invalid`},ALREADY_ENROLLED:{description:`Already enrolled in course`,http:409,gqlCode:`ALREADY_ENROLLED`,when:`Learner is already enrolled`}}},policy:{auth:`user`}}),p=u({meta:{name:`learning.completeLesson`,version:1,stability:`stable`,owners:[...e],tags:[`learning`,`progress`],description:`Mark a lesson as completed.`,goal:`Record lesson completion and earn XP.`,context:`Called when a learner finishes a lesson.`},io:{input:t,output:l,errors:{LESSON_NOT_FOUND:{description:`Lesson does not exist`,http:404,gqlCode:`LESSON_NOT_FOUND`,when:`Lesson ID is invalid`},NOT_ENROLLED:{description:`Not enrolled in course`,http:403,gqlCode:`NOT_ENROLLED`,when:`Learner is not enrolled in the course`}}},policy:{auth:`user`}}),m=u({meta:{name:`learning.submitCardReview`,version:1,stability:`stable`,owners:[...e],tags:[`learning`,`flashcards`],description:`Submit a flashcard review.`,goal:`Record review and update SRS schedule.`,context:`Called when reviewing flashcards.`},io:{input:c,output:l,errors:{CARD_NOT_FOUND:{description:`Card does not exist`,http:404,gqlCode:`CARD_NOT_FOUND`,when:`Card ID is invalid`},INVALID_RATING:{description:`Invalid rating`,http:400,gqlCode:`INVALID_RATING`,when:`Rating must be AGAIN, HARD, GOOD, or EASY`}}},policy:{auth:`user`}}),h=d({meta:{name:`learning.getDueCards`,version:1,stability:`stable`,owners:[...e],tags:[`learning`,`flashcards`],description:`Get flashcards due for review.`,goal:`Get the next batch of cards to review.`,context:`Called when starting a review session.`},io:{input:i,output:a},policy:{auth:`user`}}),g=d({meta:{name:`learning.getDashboard`,version:1,stability:`stable`,owners:[...e],tags:[`learning`,`dashboard`],description:`Get learner dashboard data.`,goal:`Display learner progress and stats.`,context:`Called when viewing the learning dashboard.`},io:{input:o,output:s},policy:{auth:`user`}});export{p as CompleteLessonContract,f as EnrollInCourseContract,h as GetDueCardsContract,g as GetLearnerDashboardContract,m as SubmitCardReviewContract};
|
package/dist/contracts/shared.js
CHANGED
package/dist/docs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"./learning-journey.docblock.js";
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../libs/contracts/dist/docs/index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/docs/learning-journey.docblock.ts
|
|
5
|
-
registerDocBlocks([
|
|
6
|
-
{
|
|
7
|
-
id: "docs.learning-journey.engine",
|
|
8
|
-
title: "Learning Journey Engine",
|
|
9
|
-
summary: "Tracks learners, tracks/modules/steps, progress, quizzes, streaks, XP, and AI coaching hooks for product-integrated onboarding.",
|
|
10
|
-
kind: "reference",
|
|
11
|
-
visibility: "public",
|
|
12
|
-
route: "/docs/learning-journey/engine",
|
|
13
|
-
tags: [
|
|
14
|
-
"learning",
|
|
15
|
-
"onboarding",
|
|
16
|
-
"journey",
|
|
17
|
-
"education"
|
|
18
|
-
],
|
|
19
|
-
body: `## Capabilities
|
|
1
|
+
import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.learning-journey.engine`,title:`Learning Journey Engine`,summary:`Tracks learners, tracks/modules/steps, progress, quizzes, streaks, XP, and AI coaching hooks for product-integrated onboarding.`,kind:`reference`,visibility:`public`,route:`/docs/learning-journey/engine`,tags:[`learning`,`onboarding`,`journey`,`education`],body:`## Capabilities
|
|
20
2
|
|
|
21
3
|
- **Entities**: Learner, Track, Module, Step, Progress, Quiz, Flashcard, AI Coach, Gamification (XP, streaks, badges).
|
|
22
4
|
- **Contracts**: enroll/resume/advance steps, complete quizzes, record streaks, assign XP, fetch progress dashboards, onboarding list/progress/recordEvent.
|
|
@@ -60,17 +42,7 @@ const updated = streak.compute({ lastActiveAt: new Date(), today: new Date() });
|
|
|
60
42
|
- Avoid storing PII in content; keep org/user scoping for multi-tenant isolation.
|
|
61
43
|
- Emit analytics and audit logs for completions; respect \`prefers-reduced-motion\` in UIs consuming these specs.
|
|
62
44
|
- Track completion bonuses: \`completionXpBonus\`, \`completionBadgeKey\`, optional \`streakHoursWindow\` + \`streakBonusXp\`.
|
|
63
|
-
`
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: "docs.learning-journey.goal",
|
|
67
|
-
title: "Learning Journey — Goal",
|
|
68
|
-
summary: "Why the learning journey engine exists and the outcomes it targets.",
|
|
69
|
-
kind: "goal",
|
|
70
|
-
visibility: "public",
|
|
71
|
-
route: "/docs/learning-journey/goal",
|
|
72
|
-
tags: ["learning", "goal"],
|
|
73
|
-
body: `## Why it matters
|
|
45
|
+
`},{id:`docs.learning-journey.goal`,title:`Learning Journey — Goal`,summary:`Why the learning journey engine exists and the outcomes it targets.`,kind:`goal`,visibility:`public`,route:`/docs/learning-journey/goal`,tags:[`learning`,`goal`],body:`## Why it matters
|
|
74
46
|
- Provides a regenerable onboarding/education engine tied to product signals.
|
|
75
47
|
- Keeps tracks, steps, quizzes, and gamification consistent across surfaces.
|
|
76
48
|
|
|
@@ -80,17 +52,7 @@ const updated = streak.compute({ lastActiveAt: new Date(), today: new Date() });
|
|
|
80
52
|
|
|
81
53
|
## Success criteria
|
|
82
54
|
- Journey changes regenerate UI/API/events without drift.
|
|
83
|
-
- Analytics/audit hooks exist for completions and streaks.`
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: "docs.learning-journey.usage",
|
|
87
|
-
title: "Learning Journey — Usage",
|
|
88
|
-
summary: "How to compose, bind, and regenerate journeys safely.",
|
|
89
|
-
kind: "usage",
|
|
90
|
-
visibility: "public",
|
|
91
|
-
route: "/docs/learning-journey/usage",
|
|
92
|
-
tags: ["learning", "usage"],
|
|
93
|
-
body: `## Setup
|
|
55
|
+
- Analytics/audit hooks exist for completions and streaks.`},{id:`docs.learning-journey.usage`,title:`Learning Journey — Usage`,summary:`How to compose, bind, and regenerate journeys safely.`,kind:`usage`,visibility:`public`,route:`/docs/learning-journey/usage`,tags:[`learning`,`usage`],body:`## Setup
|
|
94
56
|
1) Include \`learningJourneyEntities\` in schema composition.
|
|
95
57
|
2) Register contracts/events from \`@lssm/module.learning-journey\`.
|
|
96
58
|
3) Bind steps to real product events (e.g., deal.created, run.completed).
|
|
@@ -103,21 +65,7 @@ const updated = streak.compute({ lastActiveAt: new Date(), today: new Date() });
|
|
|
103
65
|
## Guardrails
|
|
104
66
|
- Avoid hardcoded progression; keep engines declarative.
|
|
105
67
|
- Emit analytics/audit for completions; respect user locale/accessibility in presentations.
|
|
106
|
-
- Keep content free of PII; scope learners by org/tenant.`
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: "docs.learning-journey.constraints",
|
|
110
|
-
title: "Learning Journey — Constraints & Safety",
|
|
111
|
-
summary: "Internal guardrails for progression, telemetry, and regeneration semantics.",
|
|
112
|
-
kind: "reference",
|
|
113
|
-
visibility: "internal",
|
|
114
|
-
route: "/docs/learning-journey/constraints",
|
|
115
|
-
tags: [
|
|
116
|
-
"learning",
|
|
117
|
-
"constraints",
|
|
118
|
-
"internal"
|
|
119
|
-
],
|
|
120
|
-
body: `## Constraints
|
|
68
|
+
- Keep content free of PII; scope learners by org/tenant.`},{id:`docs.learning-journey.constraints`,title:`Learning Journey — Constraints & Safety`,summary:`Internal guardrails for progression, telemetry, and regeneration semantics.`,kind:`reference`,visibility:`internal`,route:`/docs/learning-journey/constraints`,tags:[`learning`,`constraints`,`internal`],body:`## Constraints
|
|
121
69
|
- Progression (tracks/modules/steps) and engines (SRS, streaks, XP) must stay declarative in spec.
|
|
122
70
|
- Events to emit: learner.enrolled, step.completed, quiz.scored, streak.reset, xp.awarded.
|
|
123
71
|
- Regeneration should not change scoring/streak rules without explicit spec change.
|
|
@@ -129,8 +77,4 @@ const updated = streak.compute({ lastActiveAt: new Date(), today: new Date() });
|
|
|
129
77
|
## Verification
|
|
130
78
|
- Add fixtures for streak/XP rule changes and quiz scoring.
|
|
131
79
|
- Ensure Notifications/Audit wiring persists for completions; analytics emitted for progress.
|
|
132
|
-
- Use Feature Flags to trial new tracks or reward rules; default safe/off.`
|
|
133
|
-
}
|
|
134
|
-
]);
|
|
135
|
-
|
|
136
|
-
//#endregion
|
|
80
|
+
- Use Feature Flags to trial new tracks or reward rules; default safe/off.`}]);
|
package/dist/engines/index.js
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DEFAULT_XP_CONFIG, XPEngine, xpEngine } from "./xp.js";
|
|
3
|
-
import { DEFAULT_STREAK_CONFIG, StreakEngine, streakEngine } from "./streak.js";
|
|
4
|
-
|
|
5
|
-
export { DEFAULT_SRS_CONFIG, DEFAULT_STREAK_CONFIG, DEFAULT_XP_CONFIG, SRSEngine, StreakEngine, XPEngine, srsEngine, streakEngine, xpEngine };
|
|
1
|
+
import{DEFAULT_SRS_CONFIG as e,SRSEngine as t,srsEngine as n}from"./srs.js";import{DEFAULT_XP_CONFIG as r,XPEngine as i,xpEngine as a}from"./xp.js";import{DEFAULT_STREAK_CONFIG as o,StreakEngine as s,streakEngine as c}from"./streak.js";export{e as DEFAULT_SRS_CONFIG,o as DEFAULT_STREAK_CONFIG,r as DEFAULT_XP_CONFIG,t as SRSEngine,s as StreakEngine,i as XPEngine,n as srsEngine,c as streakEngine,a as xpEngine};
|