@happyvertical/smrt-education 0.57.43 → 0.57.44
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/AGENTS.md +12 -0
- package/README.md +5 -0
- package/agents/course-authoring-service.md +179 -0
- package/agents/course-generation-review.md +79 -0
- package/agents/learner-service.md +33 -0
- package/agents/question-records.md +100 -0
- package/dist/chunks/{workbook-photo-service-C6mbUUp6.js → workbook-photo-service-BxvZDqjM.js} +1440 -309
- package/dist/chunks/workbook-photo-service-BxvZDqjM.js.map +1 -0
- package/dist/course-append-only.d.ts +15 -0
- package/dist/course-append-only.d.ts.map +1 -0
- package/dist/course-authoring-contracts.d.ts +464 -0
- package/dist/course-authoring-contracts.d.ts.map +1 -0
- package/dist/course-authoring-licence.d.ts +15 -0
- package/dist/course-authoring-licence.d.ts.map +1 -0
- package/dist/course-authoring-models.d.ts +291 -0
- package/dist/course-authoring-models.d.ts.map +1 -0
- package/dist/course-authoring-service.d.ts +244 -0
- package/dist/course-authoring-service.d.ts.map +1 -0
- package/dist/course-delegation.d.ts +26 -0
- package/dist/course-delegation.d.ts.map +1 -0
- package/dist/course-generation-contracts.d.ts +150 -0
- package/dist/course-generation-contracts.d.ts.map +1 -0
- package/dist/course-generation-models.d.ts +94 -0
- package/dist/course-generation-models.d.ts.map +1 -0
- package/dist/course-generation-output.d.ts +31 -0
- package/dist/course-generation-output.d.ts.map +1 -0
- package/dist/course-generation-proposal-generator.d.ts +94 -0
- package/dist/course-generation-proposal-generator.d.ts.map +1 -0
- package/dist/course-generation-review-service.d.ts +149 -0
- package/dist/course-generation-review-service.d.ts.map +1 -0
- package/dist/course-release-scope.d.ts +37 -0
- package/dist/course-release-scope.d.ts.map +1 -0
- package/dist/course-review-contracts.d.ts +127 -0
- package/dist/course-review-contracts.d.ts.map +1 -0
- package/dist/course-review-digest.d.ts +4 -0
- package/dist/course-review-digest.d.ts.map +1 -0
- package/dist/course-review-evaluation.d.ts +63 -0
- package/dist/course-review-evaluation.d.ts.map +1 -0
- package/dist/course-review-gate.d.ts +15 -0
- package/dist/course-review-gate.d.ts.map +1 -0
- package/dist/course-review-models.d.ts +96 -0
- package/dist/course-review-models.d.ts.map +1 -0
- package/dist/group-sharing-contracts.d.ts +5 -0
- package/dist/group-sharing-contracts.d.ts.map +1 -1
- package/dist/group-sharing-policy.d.ts.map +1 -1
- package/dist/group-sharing-reader.d.ts.map +1 -1
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5658 -116
- package/dist/index.js.map +1 -1
- package/dist/ingestion.js +1 -1
- package/dist/learner-plan-service.d.ts.map +1 -1
- package/dist/learner-service.d.ts +81 -7
- package/dist/learner-service.d.ts.map +1 -1
- package/dist/learners.d.ts +6 -0
- package/dist/learners.d.ts.map +1 -1
- package/dist/manifest.json +14304 -2177
- package/dist/question-authoring-service.d.ts +125 -0
- package/dist/question-authoring-service.d.ts.map +1 -0
- package/dist/question-content.d.ts +25 -0
- package/dist/question-content.d.ts.map +1 -0
- package/dist/question-contracts.d.ts +240 -0
- package/dist/question-contracts.d.ts.map +1 -0
- package/dist/question-models.d.ts +124 -0
- package/dist/question-models.d.ts.map +1 -0
- package/dist/question-render.d.ts +20 -0
- package/dist/question-render.d.ts.map +1 -0
- package/dist/question-response-contracts.d.ts +54 -0
- package/dist/question-response-contracts.d.ts.map +1 -0
- package/dist/question-response-service.d.ts +63 -0
- package/dist/question-response-service.d.ts.map +1 -0
- package/dist/question-rubric.d.ts +23 -0
- package/dist/question-rubric.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +5410 -910
- package/dist/submission-service.d.ts.map +1 -1
- package/dist/submissions.d.ts +5 -0
- package/dist/submissions.d.ts.map +1 -1
- package/dist/workbook-contracts.d.ts +6 -0
- package/dist/workbook-contracts.d.ts.map +1 -1
- package/dist/workbook-models.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/chunks/workbook-photo-service-C6mbUUp6.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
+
/** Shared guards for the append-only generation and review models. */
|
|
3
|
+
export declare function adopt(target: object, options: Record<string, unknown>): void;
|
|
4
|
+
export declare function requireText(value: unknown, message: string, max?: number): void;
|
|
5
|
+
export declare function requireJson(value: string, shape: 'array' | 'object', what: string): void;
|
|
6
|
+
/** Append-only rows reject any rewrite of an existing id; replays are service-level. */
|
|
7
|
+
export declare function requireInsert(row: SmrtObject & {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
export declare function requireOwned(row: SmrtObject & {
|
|
11
|
+
tenantId: string;
|
|
12
|
+
}, table: string, id: string, extra?: Record<string, unknown>): Promise<void>;
|
|
13
|
+
export declare function noDelete(): never;
|
|
14
|
+
export declare function validDate(value: Date): void;
|
|
15
|
+
//# sourceMappingURL=course-append-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course-append-only.d.ts","sourceRoot":"","sources":["../src/course-append-only.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,sEAAsE;AACtE,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAIrE;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAM,QAGrE;AACD,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,GAAG,QAAQ,EACzB,IAAI,EAAE,MAAM,QAcb;AACD,wFAAwF;AACxF,wBAAsB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,iBAKzE;AACD,wBAAsB,YAAY,CAChC,GAAG,EAAE,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EACtC,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,iBAIpC;AACD,wBAAgB,QAAQ,IAAI,KAAK,CAIhC;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,QAGpC"}
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import type { DatabaseInterface } from '@happyvertical/sql';
|
|
2
|
+
import type { CourseLicenseKind, CourseModality } from './catalog.js';
|
|
3
|
+
import type { LessonAssetRelationship } from './lesson-assets.js';
|
|
4
|
+
import type { LessonLayoutParams, LessonQuestionRefInput } from './question-contracts.js';
|
|
5
|
+
/** Authorizer actions. The host maps roles; the service never infers a role. */
|
|
6
|
+
export type CourseAuthoringAction = 'education.course.read-draft' | 'education.course.author' | 'education.course.generate' | 'education.course.review' | 'education.course.release' | 'education.course.assign' | 'education.course.archive';
|
|
7
|
+
export declare const COURSE_AUTHORING_ACTIONS: readonly CourseAuthoringAction[];
|
|
8
|
+
/** Which service operation asked, so a host can deny agents specific operations. */
|
|
9
|
+
export type CourseAuthoringOperation = 'create' | 'save-draft' | 'read-draft' | 'release' | 'archive' | 'unarchive' | 'discard' | 'pin-enrollment' | 'upgrade-enrollment' | 'set-auto-upgrade' | 'auto-upgrade' | 'read-enrollment' | 'create-question' | 'save-question' | 'read-question' | 'resolve-question-revisions' | 'create-objective' | 'save-objective' | 'link-objectives' | 'read-worksheet' | 'request-generation' | 'run-generation' | 'cancel-generation' | 'accept-proposal' | 'read-generation' | 'record-review' | 'read-review' | 'resolve-finding' | 'note-context-change' | 'list-courses' | 'list-upgrade-choices' | 'list-auto-upgrade-skips' | 'read-released-lesson';
|
|
10
|
+
/** Trusted identity supplied by the host session, never by a browser form. */
|
|
11
|
+
export interface CourseAuthoringActor {
|
|
12
|
+
tenantId: string;
|
|
13
|
+
actorUserId: string;
|
|
14
|
+
/** Agent calls: the guardian whose delegation the host re-validates per check. */
|
|
15
|
+
delegatingGuardianUserId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Host-supplied opaque delegation id (1-200 printable characters), required
|
|
18
|
+
* with, and only with, `delegatingGuardianUserId`. Recorded on every decision
|
|
19
|
+
* and passed to every authorizer call; it grants nothing by itself.
|
|
20
|
+
*/
|
|
21
|
+
delegationId?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A richer authorizer answer. `reason` (at most 200 characters) and `code` (a
|
|
25
|
+
* short token, at most 64 characters of `[a-z0-9._-]`) are recorded on an
|
|
26
|
+
* auto-upgrade skip when `allowed` is false; invalid values are dropped, never
|
|
27
|
+
* thrown. A plain `boolean` stays valid everywhere.
|
|
28
|
+
*/
|
|
29
|
+
export interface CourseAuthorizationDecision {
|
|
30
|
+
allowed: boolean;
|
|
31
|
+
reason?: string;
|
|
32
|
+
code?: string;
|
|
33
|
+
/**
|
|
34
|
+
* `education.course.assign` only: the assignment-setting value the host relied
|
|
35
|
+
* on (1-200 printable characters). It becomes the recorded policy basis for pin,
|
|
36
|
+
* upgrade and opt-in rows, replacing the caller-supplied one; if the caller also
|
|
37
|
+
* sent one it must be equal (`CoursePolicyBasisMismatchError`). Ignored for other
|
|
38
|
+
* actions. An invalid value is a validation error and nothing is written.
|
|
39
|
+
*/
|
|
40
|
+
policyBasis?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Result of a host delegation check; a bare boolean is accepted as well. */
|
|
43
|
+
export type CourseDelegationDecision = boolean | {
|
|
44
|
+
allowed: boolean;
|
|
45
|
+
reason?: string;
|
|
46
|
+
code?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Host port that verifies a delegation (the agent may act for the guardian under
|
|
50
|
+
* this id) on the supplied transaction executor. Without it every delegated
|
|
51
|
+
* request is refused; it runs before the host authorizer and never grants by
|
|
52
|
+
* itself.
|
|
53
|
+
*/
|
|
54
|
+
export type CourseDelegationVerifier = (executor: DatabaseInterface, request: {
|
|
55
|
+
tenantId: string;
|
|
56
|
+
actorUserId: string;
|
|
57
|
+
delegatingGuardianUserId: string;
|
|
58
|
+
delegationId: string;
|
|
59
|
+
action: CourseAuthoringAction;
|
|
60
|
+
operation: CourseAuthoringOperation;
|
|
61
|
+
courseId?: string;
|
|
62
|
+
enrollmentId?: string;
|
|
63
|
+
learnerId?: string;
|
|
64
|
+
/** Pin and upgrade only: the target release and its materialized course. */
|
|
65
|
+
releaseId?: string;
|
|
66
|
+
releaseCourseId?: string;
|
|
67
|
+
}) => CourseDelegationDecision | Promise<CourseDelegationDecision>;
|
|
68
|
+
export type CourseAuthoringAuthorizer = (request: CourseAuthoringActor & {
|
|
69
|
+
action: CourseAuthoringAction;
|
|
70
|
+
operation: CourseAuthoringOperation;
|
|
71
|
+
/** The active service executor; host policy reads must share its transaction. */
|
|
72
|
+
executor: DatabaseInterface;
|
|
73
|
+
courseId?: string;
|
|
74
|
+
enrollmentId?: string;
|
|
75
|
+
learnerId?: string;
|
|
76
|
+
/** Pin and upgrade only: the target release and its materialized course. */
|
|
77
|
+
releaseId?: string;
|
|
78
|
+
releaseCourseId?: string;
|
|
79
|
+
}) => boolean | CourseAuthorizationDecision | Promise<boolean | CourseAuthorizationDecision>;
|
|
80
|
+
export type CourseProvenance = 'supplied' | 'generated' | 'edited' | 'extracted';
|
|
81
|
+
export declare const COURSE_PROVENANCES: readonly CourseProvenance[];
|
|
82
|
+
export type CourseLessonType = 'reading' | 'video' | 'worksheet' | 'exercise';
|
|
83
|
+
export type CourseLessonCompletion = 'attest' | 'submit' | 'score' | 'external';
|
|
84
|
+
/** Hook supplied by #4516; the service never treats an absent gate as a pass. */
|
|
85
|
+
export type ReleaseReviewGate = (executor: DatabaseInterface, request: {
|
|
86
|
+
tenantId: string;
|
|
87
|
+
courseId: string;
|
|
88
|
+
revisionId: string;
|
|
89
|
+
}) => {
|
|
90
|
+
current: boolean;
|
|
91
|
+
reviewId?: string;
|
|
92
|
+
reason?: string;
|
|
93
|
+
} | Promise<{
|
|
94
|
+
current: boolean;
|
|
95
|
+
reviewId?: string;
|
|
96
|
+
reason?: string;
|
|
97
|
+
}>;
|
|
98
|
+
/** Hook supplied by #4516/variants: report review/variant rows that reference a draft. */
|
|
99
|
+
export type CourseReferenceGuard = (executor: DatabaseInterface, request: {
|
|
100
|
+
tenantId: string;
|
|
101
|
+
courseId: string;
|
|
102
|
+
}) => {
|
|
103
|
+
referenced: boolean;
|
|
104
|
+
kinds?: readonly string[];
|
|
105
|
+
} | Promise<{
|
|
106
|
+
referenced: boolean;
|
|
107
|
+
kinds?: readonly string[];
|
|
108
|
+
}>;
|
|
109
|
+
/** Copies an upload (for example an ingestion item) to an education-owned asset. */
|
|
110
|
+
export interface CourseMaterialSource {
|
|
111
|
+
kind: string;
|
|
112
|
+
ref: string;
|
|
113
|
+
}
|
|
114
|
+
export interface CourseMaterialCopyRequest {
|
|
115
|
+
tenantId: string;
|
|
116
|
+
actorUserId: string;
|
|
117
|
+
courseId: string;
|
|
118
|
+
source: CourseMaterialSource;
|
|
119
|
+
relationship: LessonAssetRelationship;
|
|
120
|
+
}
|
|
121
|
+
export interface CourseMaterialCopyPort {
|
|
122
|
+
/** Must return an asset owned by the same tenant, independent of the source's expiry. */
|
|
123
|
+
copy(executor: DatabaseInterface, request: CourseMaterialCopyRequest): Promise<{
|
|
124
|
+
assetId: string;
|
|
125
|
+
}>;
|
|
126
|
+
}
|
|
127
|
+
export interface CourseMaterialInput {
|
|
128
|
+
/** Uploaded material to copy; mutually exclusive with `assetId`. */
|
|
129
|
+
source?: CourseMaterialSource;
|
|
130
|
+
/** Reuse an asset already copied into this course by an earlier revision. */
|
|
131
|
+
assetId?: string;
|
|
132
|
+
relationship: LessonAssetRelationship;
|
|
133
|
+
licenseKind?: CourseLicenseKind;
|
|
134
|
+
}
|
|
135
|
+
export interface CourseMaterialView {
|
|
136
|
+
assetId: string;
|
|
137
|
+
relationship: LessonAssetRelationship;
|
|
138
|
+
licenseKind: CourseLicenseKind;
|
|
139
|
+
provenance: {
|
|
140
|
+
source: CourseMaterialSource | null;
|
|
141
|
+
copiedAt: string;
|
|
142
|
+
copiedByUserId: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export interface CourseLessonInput {
|
|
146
|
+
/** Stable cross-version identity; omit for a new lesson. */
|
|
147
|
+
lessonKey?: string;
|
|
148
|
+
title: string;
|
|
149
|
+
body?: string;
|
|
150
|
+
lessonType?: CourseLessonType;
|
|
151
|
+
completionRule?: CourseLessonCompletion;
|
|
152
|
+
estimatedMinutes?: number;
|
|
153
|
+
difficulty?: number;
|
|
154
|
+
modality?: CourseModality;
|
|
155
|
+
externalRef?: string;
|
|
156
|
+
externalUrl?: string;
|
|
157
|
+
licenseKind?: CourseLicenseKind;
|
|
158
|
+
provenance?: CourseProvenance;
|
|
159
|
+
fieldProvenance?: Record<string, CourseProvenance>;
|
|
160
|
+
materials?: CourseMaterialInput[];
|
|
161
|
+
/** Ordered immutable question revisions; each must exist in this tenant. */
|
|
162
|
+
questions?: LessonQuestionRefInput[];
|
|
163
|
+
/** Flat render parameters folded into the worksheet version id. */
|
|
164
|
+
layoutParams?: LessonLayoutParams;
|
|
165
|
+
}
|
|
166
|
+
export interface CourseSectionInput {
|
|
167
|
+
sectionKey: string;
|
|
168
|
+
title: string;
|
|
169
|
+
lessons: CourseLessonInput[];
|
|
170
|
+
}
|
|
171
|
+
export interface CourseDraftInput {
|
|
172
|
+
title: string;
|
|
173
|
+
summary?: string;
|
|
174
|
+
subject?: string;
|
|
175
|
+
theme?: string;
|
|
176
|
+
levelMin?: number;
|
|
177
|
+
levelMax?: number;
|
|
178
|
+
objectives?: string[];
|
|
179
|
+
sections: CourseSectionInput[];
|
|
180
|
+
provenance: CourseProvenance;
|
|
181
|
+
fieldProvenance?: Record<string, CourseProvenance>;
|
|
182
|
+
}
|
|
183
|
+
export interface CourseLessonRevisionView {
|
|
184
|
+
id: string;
|
|
185
|
+
lessonKey: string;
|
|
186
|
+
parentRevisionId: string | null;
|
|
187
|
+
title: string;
|
|
188
|
+
body: string;
|
|
189
|
+
lessonType: CourseLessonType;
|
|
190
|
+
completionRule: CourseLessonCompletion;
|
|
191
|
+
estimatedMinutes: number;
|
|
192
|
+
difficulty: number;
|
|
193
|
+
modality: CourseModality;
|
|
194
|
+
externalRef: string;
|
|
195
|
+
externalUrl: string;
|
|
196
|
+
licenseKind: CourseLicenseKind;
|
|
197
|
+
provenance: CourseProvenance;
|
|
198
|
+
fieldProvenance: Record<string, CourseProvenance>;
|
|
199
|
+
materials: CourseMaterialView[];
|
|
200
|
+
questions: LessonQuestionRefInput[];
|
|
201
|
+
layoutParams: LessonLayoutParams;
|
|
202
|
+
}
|
|
203
|
+
/** Alias for hosts: a lesson revision as read by the authoring views. */
|
|
204
|
+
export type LessonRevisionView = CourseLessonRevisionView;
|
|
205
|
+
export interface CourseRevisionView {
|
|
206
|
+
id: string;
|
|
207
|
+
courseId: string;
|
|
208
|
+
parentRevisionId: string | null;
|
|
209
|
+
sequence: number;
|
|
210
|
+
title: string;
|
|
211
|
+
summary: string;
|
|
212
|
+
subject: string;
|
|
213
|
+
theme: string;
|
|
214
|
+
levelMin: number;
|
|
215
|
+
levelMax: number;
|
|
216
|
+
objectives: string[];
|
|
217
|
+
licenseKind: CourseLicenseKind;
|
|
218
|
+
provenance: CourseProvenance;
|
|
219
|
+
fieldProvenance: Record<string, CourseProvenance>;
|
|
220
|
+
authorUserId: string;
|
|
221
|
+
delegatingGuardianUserId: string | null;
|
|
222
|
+
delegationId: string | null;
|
|
223
|
+
recordedAt: string;
|
|
224
|
+
sections: Array<{
|
|
225
|
+
sectionKey: string;
|
|
226
|
+
title: string;
|
|
227
|
+
lessons: CourseLessonRevisionView[];
|
|
228
|
+
}>;
|
|
229
|
+
}
|
|
230
|
+
export interface CourseHeadView {
|
|
231
|
+
courseId: string;
|
|
232
|
+
/** The expected-head token for the next save. */
|
|
233
|
+
headRevisionId: string;
|
|
234
|
+
version: number;
|
|
235
|
+
}
|
|
236
|
+
export type CourseReleaseView = Readonly<{
|
|
237
|
+
id: string;
|
|
238
|
+
courseId: string;
|
|
239
|
+
revisionId: string;
|
|
240
|
+
releaseNumber: number;
|
|
241
|
+
releaseCourseId: string;
|
|
242
|
+
reviewId: string | null;
|
|
243
|
+
actorUserId: string;
|
|
244
|
+
delegatingGuardianUserId: string | null;
|
|
245
|
+
delegationId: string | null;
|
|
246
|
+
recordedAt: string;
|
|
247
|
+
lessons: ReadonlyArray<{
|
|
248
|
+
lessonKey: string;
|
|
249
|
+
lessonRevisionId: string;
|
|
250
|
+
lessonId: string;
|
|
251
|
+
sectionId: string;
|
|
252
|
+
}>;
|
|
253
|
+
}>;
|
|
254
|
+
export type CourseLifecycleState = 'draft' | 'released' | 'archived' | 'discarded';
|
|
255
|
+
export type CourseStateView = Readonly<{
|
|
256
|
+
courseId: string;
|
|
257
|
+
title: string;
|
|
258
|
+
state: CourseLifecycleState;
|
|
259
|
+
licenseKind: CourseLicenseKind;
|
|
260
|
+
/** Personal-use material makes the course tenant-private and never group-shareable. */
|
|
261
|
+
groupShareable: boolean;
|
|
262
|
+
headRevisionId: string | null;
|
|
263
|
+
releases: ReadonlyArray<{
|
|
264
|
+
id: string;
|
|
265
|
+
releaseNumber: number;
|
|
266
|
+
revisionId: string;
|
|
267
|
+
releaseCourseId: string;
|
|
268
|
+
}>;
|
|
269
|
+
}>;
|
|
270
|
+
/** Largest page a list read returns; the default is `DEFAULT_PAGE_SIZE`. */
|
|
271
|
+
export declare const MAX_PAGE_SIZE = 100;
|
|
272
|
+
export declare const DEFAULT_PAGE_SIZE = 50;
|
|
273
|
+
/** Opaque, deterministic pagination: pass back `nextCursor` unchanged. */
|
|
274
|
+
export interface CoursePageRequest {
|
|
275
|
+
limit?: number;
|
|
276
|
+
cursor?: string;
|
|
277
|
+
}
|
|
278
|
+
export type CoursePage<T> = Readonly<{
|
|
279
|
+
items: ReadonlyArray<T>;
|
|
280
|
+
/** Null on the last page. */
|
|
281
|
+
nextCursor: string | null;
|
|
282
|
+
}>;
|
|
283
|
+
export type CourseArchiveDecisionView = Readonly<{
|
|
284
|
+
action: 'archive' | 'unarchive';
|
|
285
|
+
sequence: number;
|
|
286
|
+
actorUserId: string;
|
|
287
|
+
delegatingGuardianUserId: string | null;
|
|
288
|
+
delegationId: string | null;
|
|
289
|
+
recordedAt: string;
|
|
290
|
+
}>;
|
|
291
|
+
/** One authored course in `listCourses`. */
|
|
292
|
+
export type CourseSummaryView = Readonly<{
|
|
293
|
+
courseId: string;
|
|
294
|
+
title: string;
|
|
295
|
+
state: CourseLifecycleState;
|
|
296
|
+
createdAt: string;
|
|
297
|
+
/**
|
|
298
|
+
* Effective licence: the most restrictive of the head revision and every release's
|
|
299
|
+
* materialized course, so a restriction recorded by any release never loosens.
|
|
300
|
+
* `CourseStateView.licenseKind` reads the head alone and may be looser.
|
|
301
|
+
*/
|
|
302
|
+
licenseKind: CourseLicenseKind;
|
|
303
|
+
/**
|
|
304
|
+
* The group-sharing rule applied to this course: false for personal-use and
|
|
305
|
+
* false until the course has a release (nothing to share).
|
|
306
|
+
*/
|
|
307
|
+
groupShareable: boolean;
|
|
308
|
+
/** Number of releases (0 for a draft-only course). */
|
|
309
|
+
releaseCount: number;
|
|
310
|
+
/** The draft head; `revisionId` is the expected-head token for the next save. */
|
|
311
|
+
head: Readonly<{
|
|
312
|
+
revisionId: string;
|
|
313
|
+
sequence: number;
|
|
314
|
+
version: number;
|
|
315
|
+
}> | null;
|
|
316
|
+
latestRelease: Readonly<{
|
|
317
|
+
id: string;
|
|
318
|
+
revisionId: string;
|
|
319
|
+
releaseNumber: number;
|
|
320
|
+
releaseCourseId: string;
|
|
321
|
+
recordedAt: string;
|
|
322
|
+
}> | null;
|
|
323
|
+
archive: Readonly<{
|
|
324
|
+
archived: boolean;
|
|
325
|
+
latestDecision: CourseArchiveDecisionView | null;
|
|
326
|
+
}>;
|
|
327
|
+
}>;
|
|
328
|
+
export type CourseUpgradeChoiceView = Readonly<{
|
|
329
|
+
id: string;
|
|
330
|
+
courseId: string;
|
|
331
|
+
scope: 'course' | 'enrollment';
|
|
332
|
+
/** Null for a course-level choice. */
|
|
333
|
+
enrollmentId: string | null;
|
|
334
|
+
enabled: boolean;
|
|
335
|
+
kind: 'opt-in' | 'opt-out';
|
|
336
|
+
sequence: number;
|
|
337
|
+
actorUserId: string;
|
|
338
|
+
delegatingGuardianUserId: string | null;
|
|
339
|
+
delegationId: string | null;
|
|
340
|
+
policyBasis: string;
|
|
341
|
+
recordedAt: string;
|
|
342
|
+
}>;
|
|
343
|
+
export type AutoUpgradeSkipView = Readonly<{
|
|
344
|
+
id: string;
|
|
345
|
+
enrollmentId: string;
|
|
346
|
+
learnerId: string;
|
|
347
|
+
courseId: string;
|
|
348
|
+
releaseId: string;
|
|
349
|
+
optInScope: 'course' | 'enrollment';
|
|
350
|
+
optInActorUserId: string;
|
|
351
|
+
optInDelegatingGuardianUserId: string | null;
|
|
352
|
+
optInDelegationId: string | null;
|
|
353
|
+
policyBasis: string;
|
|
354
|
+
/** The authorizer's reason when it gave one, else `not-authorized`. */
|
|
355
|
+
reason: string;
|
|
356
|
+
/** The authorizer's short code, or an empty string. */
|
|
357
|
+
code: string;
|
|
358
|
+
recordedAt: string;
|
|
359
|
+
}>;
|
|
360
|
+
export type EnrollmentPinKind = 'initial' | 'explicit' | 'auto';
|
|
361
|
+
export type EnrollmentPinView = Readonly<{
|
|
362
|
+
enrollmentId: string;
|
|
363
|
+
/** The enrollment's learner, from the enrollment row; hosts never read `enrollments`. */
|
|
364
|
+
learnerId: string;
|
|
365
|
+
/** The authored course identity (`AuthoredCourse` id) the pin follows. */
|
|
366
|
+
courseId: string;
|
|
367
|
+
releaseId: string;
|
|
368
|
+
/** The materialized release `Course` id the enrollment is created on. */
|
|
369
|
+
releaseCourseId: string;
|
|
370
|
+
releaseNumber: number;
|
|
371
|
+
kind: EnrollmentPinKind;
|
|
372
|
+
autoUpgrade: boolean;
|
|
373
|
+
/** Assignment-setting value the host relied on for the current pin. */
|
|
374
|
+
policyBasis: string;
|
|
375
|
+
history: ReadonlyArray<{
|
|
376
|
+
releaseId: string;
|
|
377
|
+
releaseCourseId: string;
|
|
378
|
+
previousReleaseId: string | null;
|
|
379
|
+
kind: EnrollmentPinKind;
|
|
380
|
+
sequence: number;
|
|
381
|
+
actorUserId: string | null;
|
|
382
|
+
delegatingGuardianUserId: string | null;
|
|
383
|
+
delegationId: string | null;
|
|
384
|
+
policyBasis: string;
|
|
385
|
+
/** For automatic moves: the scope of the opt-in followed. */
|
|
386
|
+
optInScope: 'course' | 'enrollment' | null;
|
|
387
|
+
recordedAt: string;
|
|
388
|
+
}>;
|
|
389
|
+
}>;
|
|
390
|
+
/** Result of `getEnrollmentRelease`; identity fields repeat the pin's for convenience. */
|
|
391
|
+
export type EnrollmentReleaseView = Readonly<{
|
|
392
|
+
learnerId: string;
|
|
393
|
+
courseId: string;
|
|
394
|
+
releaseCourseId: string;
|
|
395
|
+
pin: EnrollmentPinView;
|
|
396
|
+
lessons: EffectiveLessonView[];
|
|
397
|
+
}>;
|
|
398
|
+
/** Result of `setAutoUpgrade`; `learnerId` is null for a course-level choice. */
|
|
399
|
+
export type SetAutoUpgradeResult = Readonly<{
|
|
400
|
+
courseId: string;
|
|
401
|
+
enrollmentId: string | null;
|
|
402
|
+
learnerId: string | null;
|
|
403
|
+
enabled: boolean;
|
|
404
|
+
policyBasis: string;
|
|
405
|
+
}>;
|
|
406
|
+
export type EffectiveLessonView = Readonly<{
|
|
407
|
+
lessonKey: string;
|
|
408
|
+
lessonId: string;
|
|
409
|
+
releaseId: string;
|
|
410
|
+
/** True when a started lesson stays on an older release than the current pin. */
|
|
411
|
+
pinnedToOlderRelease: boolean;
|
|
412
|
+
}>;
|
|
413
|
+
export declare class CourseAuthoringError extends Error {
|
|
414
|
+
readonly code: string;
|
|
415
|
+
constructor(code: string, message: string);
|
|
416
|
+
}
|
|
417
|
+
export declare class CourseAuthoringAuthorizationError extends CourseAuthoringError {
|
|
418
|
+
constructor();
|
|
419
|
+
}
|
|
420
|
+
export declare class CourseAuthoringValidationError extends CourseAuthoringError {
|
|
421
|
+
constructor(message: string);
|
|
422
|
+
}
|
|
423
|
+
export declare class CourseNotFoundError extends CourseAuthoringError {
|
|
424
|
+
constructor();
|
|
425
|
+
}
|
|
426
|
+
export declare class CourseDiscardedError extends CourseAuthoringError {
|
|
427
|
+
constructor();
|
|
428
|
+
}
|
|
429
|
+
export declare class CourseArchivedError extends CourseAuthoringError {
|
|
430
|
+
constructor();
|
|
431
|
+
}
|
|
432
|
+
export declare class CourseStaleHeadError extends CourseAuthoringError {
|
|
433
|
+
readonly currentHeadRevisionId: string;
|
|
434
|
+
constructor(currentHeadRevisionId: string);
|
|
435
|
+
}
|
|
436
|
+
/** The caller and the assign authorizer named different policy bases. */
|
|
437
|
+
export declare class CoursePolicyBasisMismatchError extends CourseAuthoringError {
|
|
438
|
+
constructor();
|
|
439
|
+
}
|
|
440
|
+
export declare class CourseRequestKeyConflictError extends CourseAuthoringError {
|
|
441
|
+
constructor();
|
|
442
|
+
}
|
|
443
|
+
export declare class ReviewGateRequiredError extends CourseAuthoringError {
|
|
444
|
+
constructor();
|
|
445
|
+
}
|
|
446
|
+
export declare class ReviewNotCurrentError extends CourseAuthoringError {
|
|
447
|
+
readonly reason?: string | undefined;
|
|
448
|
+
constructor(reason?: string | undefined);
|
|
449
|
+
}
|
|
450
|
+
export declare class CourseRevisionAlreadyReleasedError extends CourseAuthoringError {
|
|
451
|
+
readonly releaseId: string;
|
|
452
|
+
constructor(releaseId: string);
|
|
453
|
+
}
|
|
454
|
+
export declare class CourseDiscardRefusedError extends CourseAuthoringError {
|
|
455
|
+
readonly references: readonly string[];
|
|
456
|
+
constructor(references: readonly string[]);
|
|
457
|
+
}
|
|
458
|
+
export declare class EnrollmentPinConflictError extends CourseAuthoringError {
|
|
459
|
+
constructor(message?: string);
|
|
460
|
+
}
|
|
461
|
+
export declare class CourseMaterialCopyError extends CourseAuthoringError {
|
|
462
|
+
constructor(message?: string);
|
|
463
|
+
}
|
|
464
|
+
//# sourceMappingURL=course-authoring-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course-authoring-contracts.d.ts","sourceRoot":"","sources":["../src/course-authoring-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAEjC,gFAAgF;AAChF,MAAM,MAAM,qBAAqB,GAC7B,6BAA6B,GAC7B,yBAAyB,GACzB,2BAA2B,GAC3B,yBAAyB,GACzB,0BAA0B,GAC1B,yBAAyB,GACzB,0BAA0B,CAAC;AAE/B,eAAO,MAAM,wBAAwB,EAAE,SAAS,qBAAqB,EAQpE,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,wBAAwB,GAChC,QAAQ,GACR,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,gBAAgB,GAChB,oBAAoB,GACpB,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,eAAe,GACf,4BAA4B,GAC5B,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,aAAa,GACb,iBAAiB,GACjB,qBAAqB,GACrB,cAAc,GACd,sBAAsB,GACtB,yBAAyB,GACzB,sBAAsB,CAAC;AAE3B,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,M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EAAyE;AACzE,qBAAa,8BAA+B,SAAQ,oBAAoB;;CAOvE;AACD,qBAAa,6BAA8B,SAAQ,oBAAoB;;CAOtE;AACD,qBAAa,uBAAwB,SAAQ,oBAAoB;;CAOhE;AACD,qBAAa,qBAAsB,SAAQ,oBAAoB;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM;gBAAf,MAAM,CAAC,EAAE,MAAM,YAAA;CAMrC;AACD,qBAAa,kCAAmC,SAAQ,oBAAoB;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM;gBAAjB,SAAS,EAAE,MAAM;CAGvC;AACD,qBAAa,yBAA0B,SAAQ,oBAAoB;IACrD,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE;gBAA7B,UAAU,EAAE,SAAS,MAAM,EAAE;CAMnD;AACD,qBAAa,0BAA2B,SAAQ,oBAAoB;gBAEhE,OAAO,SAAyD;CAInE;AACD,qBAAa,uBAAwB,SAAQ,oBAAoB;gBAE7D,OAAO,SAA2D;CAIrE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CourseLicenseKind } from './catalog.js';
|
|
2
|
+
/** Source key of the immutable Course row a release materializes. */
|
|
3
|
+
export declare const AUTHORED_RELEASE_SOURCE_KEY = "authored-release";
|
|
4
|
+
/** Source key of the stable authored-course identity row. */
|
|
5
|
+
export declare const AUTHORED_IDENTITY_SOURCE_KEY = "authored";
|
|
6
|
+
/** The most restrictive licence among a course's parts governs the whole course. */
|
|
7
|
+
export declare function mostRestrictiveLicense(kinds: Iterable<CourseLicenseKind>): CourseLicenseKind;
|
|
8
|
+
/** Any personal-use material makes a course tenant-private, never group-shareable. */
|
|
9
|
+
export declare function isGroupShareableLicense(kind: CourseLicenseKind): boolean;
|
|
10
|
+
/** Group-sharing eligibility for a materialized authored-release Course row. */
|
|
11
|
+
export declare function isAuthoredReleaseGroupShareable(course: {
|
|
12
|
+
sourceKey?: string;
|
|
13
|
+
licenseKind?: CourseLicenseKind | null;
|
|
14
|
+
}): boolean;
|
|
15
|
+
//# sourceMappingURL=course-authoring-licence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course-authoring-licence.d.ts","sourceRoot":"","sources":["../src/course-authoring-licence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,qEAAqE;AACrE,eAAO,MAAM,2BAA2B,qBAAqB,CAAC;AAC9D,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,aAAa,CAAC;AASvD,oFAAoF;AACpF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GACjC,iBAAiB,CAQnB;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAExE;AAED,gFAAgF;AAChF,wBAAgB,+BAA+B,CAAC,MAAM,EAAE;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACxC,GAAG,OAAO,CAKV"}
|