@nakafa/aksara-contracts 1.0.1 → 2.0.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/README.md +8 -25
- package/dist/{question → assessment}/answer.d.ts +14 -58
- package/dist/{question → assessment}/answer.js +13 -60
- package/dist/assessment/catalog.d.ts +235 -0
- package/dist/assessment/catalog.js +115 -0
- package/dist/assessment/chart.d.ts +62 -0
- package/dist/assessment/chart.js +64 -0
- package/dist/assessment/closure.d.ts +28 -0
- package/dist/assessment/closure.js +164 -0
- package/dist/assessment/explanation.d.ts +13 -8
- package/dist/assessment/explanation.js +14 -8
- package/dist/assessment/figure.d.ts +140 -1
- package/dist/assessment/figure.js +9 -2
- package/dist/assessment/hash.d.ts +348 -208
- package/dist/assessment/hash.js +14 -0
- package/dist/assessment/inline.d.ts +3 -1
- package/dist/assessment/inline.js +20 -5
- package/dist/assessment/item.d.ts +8 -4
- package/dist/assessment/item.js +6 -2
- package/dist/assessment/key.js +6 -6
- package/dist/assessment/paper.d.ts +74 -74
- package/dist/assessment/snapshot.d.ts +3778 -0
- package/dist/assessment/snapshot.js +192 -0
- package/dist/cache/content.d.ts +4 -4
- package/dist/canonical.d.ts +6 -0
- package/dist/canonical.js +8 -1
- package/dist/content.d.ts +1 -1
- package/dist/content.js +0 -1
- package/dist/delivery.d.ts +0 -3
- package/dist/delivery.js +0 -5
- package/dist/preview/artifact.d.ts +1 -120
- package/dist/preview/document.d.ts +0 -586
- package/dist/preview/document.js +1 -47
- package/dist/preview/spec.d.ts +6 -1984
- package/dist/preview/spec.js +7 -47
- package/dist/preview/target.d.ts +0 -173
- package/dist/preview/target.js +1 -70
- package/dist/projection/digest.d.ts +0 -127
- package/dist/projection/hash.d.ts +0 -127
- package/dist/projection/spec.d.ts +6 -211
- package/dist/projection/spec.js +4 -18
- package/dist/projection/verify.d.ts +0 -127
- package/dist/projection/verify.js +0 -3
- package/dist/release/canonical.d.ts +2 -2
- package/dist/release/current/evidence.d.ts +24 -24
- package/dist/release/current/state.d.ts +28 -56
- package/dist/release/current/state.js +1 -6
- package/dist/release/digest.d.ts +2 -2
- package/dist/release/hash.d.ts +5 -5
- package/dist/release/head.d.ts +10 -57
- package/dist/release/head.js +3 -14
- package/dist/release/identity.d.ts +3 -3
- package/dist/release/items.d.ts +2 -2
- package/dist/release/lifecycle.d.ts +18 -18
- package/dist/release/policy.d.ts +3 -4
- package/dist/release/policy.js +2 -11
- package/dist/release/result/digest.d.ts +6 -18
- package/dist/release/result/digest.js +1 -2
- package/dist/release/rollback/digest.d.ts +4 -19
- package/dist/release/rollback/spec.d.ts +30 -792
- package/dist/release/rollback/spec.js +1 -4
- package/dist/release/snapshot/data.d.ts +599 -249
- package/dist/release/snapshot/data.js +11 -28
- package/dist/release/snapshot/evidence/assessment.d.ts +26 -0
- package/dist/release/snapshot/evidence/assessment.js +44 -0
- package/dist/release/snapshot/evidence/requirement.d.ts +1 -1
- package/dist/release/snapshot/evidence.d.ts +19 -19
- package/dist/release/snapshot/evidence.js +2 -2
- package/dist/release/snapshot/scope.d.ts +5 -5
- package/dist/release/snapshot/scope.js +1 -1
- package/dist/release/snapshot/spec.d.ts +15 -15
- package/dist/release/snapshot/spec.js +8 -8
- package/dist/release/snapshot/verify.d.ts +1278 -268
- package/dist/release/snapshot/verify.js +8 -5
- package/dist/release/spec.d.ts +33 -33
- package/dist/release/verify.d.ts +5 -5
- package/dist/runtime/spec.d.ts +38 -38
- package/dist/runtime/spec.js +4 -5
- package/dist/runtime/verify.d.ts +40 -40
- package/dist/signature/spec.d.ts +5 -5
- package/dist/signature/spec.js +0 -1
- package/dist/transport/batch.d.ts +6 -244
- package/dist/transport/failure.d.ts +6 -20
- package/dist/transport/failure.js +0 -10
- package/dist/transport/group.d.ts +1969 -1369
- package/dist/transport/group.js +0 -2
- package/dist/transport/request.d.ts +10691 -5086
- package/dist/transport/request.js +0 -3
- package/dist/transport/response.d.ts +219 -1442
- package/dist/transport/response.js +0 -4
- package/dist/transport/snapshot.d.ts +1187 -487
- package/package.json +187 -295
- package/dist/projection/question.d.ts +0 -1067
- package/dist/projection/question.js +0 -121
- package/dist/question/identity.d.ts +0 -175
- package/dist/question/identity.js +0 -207
- package/dist/question/item.d.ts +0 -450
- package/dist/question/item.js +0 -174
- package/dist/question/label.d.ts +0 -3
- package/dist/question/label.js +0 -3
- package/dist/question/points.d.ts +0 -18
- package/dist/question/points.js +0 -22
- package/dist/question/response.d.ts +0 -289
- package/dist/question/response.js +0 -167
- package/dist/question/rubric.d.ts +0 -234
- package/dist/question/rubric.js +0 -186
- package/dist/release/current/runtime.d.ts +0 -4
- package/dist/release/current/runtime.js +0 -15
- package/dist/release/snapshot/evidence/tryout.d.ts +0 -22
- package/dist/release/snapshot/evidence/tryout.js +0 -91
- package/dist/runtime/protected/limits.d.ts +0 -10
- package/dist/runtime/protected/limits.js +0 -16
- package/dist/runtime/protected/spec.d.ts +0 -310
- package/dist/runtime/protected/spec.js +0 -80
- package/dist/runtime/protected/verify.d.ts +0 -83
- package/dist/runtime/protected/verify.js +0 -70
- package/dist/transport/runtime.d.ts +0 -77
- package/dist/transport/runtime.js +0 -33
- package/dist/tryout/canonical.d.ts +0 -12
- package/dist/tryout/canonical.js +0 -7
- package/dist/tryout/catalog.d.ts +0 -396
- package/dist/tryout/catalog.js +0 -155
- package/dist/tryout/closure/accounting.d.ts +0 -20
- package/dist/tryout/closure/accounting.js +0 -70
- package/dist/tryout/closure/locale.d.ts +0 -14
- package/dist/tryout/closure/locale.js +0 -113
- package/dist/tryout/closure/placement.d.ts +0 -5
- package/dist/tryout/closure/placement.js +0 -32
- package/dist/tryout/digest.d.ts +0 -34
- package/dist/tryout/digest.js +0 -57
- package/dist/tryout/hash/catalog.d.ts +0 -364
- package/dist/tryout/hash/catalog.js +0 -209
- package/dist/tryout/hash/content.d.ts +0 -215
- package/dist/tryout/hash/content.js +0 -75
- package/dist/tryout/hash/placement.d.ts +0 -242
- package/dist/tryout/hash/placement.js +0 -56
- package/dist/tryout/identity.d.ts +0 -12
- package/dist/tryout/identity.js +0 -47
- package/dist/tryout/key.d.ts +0 -4
- package/dist/tryout/key.js +0 -8
- package/dist/tryout/language.d.ts +0 -24
- package/dist/tryout/language.js +0 -30
- package/dist/tryout/placement.d.ts +0 -331
- package/dist/tryout/placement.js +0 -96
- package/dist/tryout/runtime/canonical.d.ts +0 -8
- package/dist/tryout/runtime/canonical.js +0 -34
- package/dist/tryout/runtime/hash.d.ts +0 -34
- package/dist/tryout/runtime/hash.js +0 -13
- package/dist/tryout/runtime/source.d.ts +0 -44
- package/dist/tryout/runtime/source.js +0 -47
- package/dist/tryout/runtime/spec.d.ts +0 -58
- package/dist/tryout/runtime/spec.js +0 -21
- package/dist/tryout/runtime/verify.d.ts +0 -69
- package/dist/tryout/runtime/verify.js +0 -67
- package/dist/tryout/scoring.d.ts +0 -148
- package/dist/tryout/scoring.js +0 -98
- package/dist/tryout/snapshot/canonical.d.ts +0 -7
- package/dist/tryout/snapshot/canonical.js +0 -18
- package/dist/tryout/snapshot/hash.d.ts +0 -49
- package/dist/tryout/snapshot/hash.js +0 -22
- package/dist/tryout/snapshot/spec.d.ts +0 -46
- package/dist/tryout/snapshot/spec.js +0 -30
- package/dist/tryout/spec.d.ts +0 -41
- package/dist/tryout/spec.js +0 -46
package/dist/preview/spec.js
CHANGED
|
@@ -10,9 +10,8 @@ export const PreviewRepositorySchema = Schema.Struct({
|
|
|
10
10
|
dirty: Schema.Boolean,
|
|
11
11
|
sha: GitCommitShaSchema,
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})));
|
|
13
|
+
/** The one signed artifact that renders a preview document. */
|
|
14
|
+
const PreviewArtifactListSchema = Schema.Tuple([PreviewArtifactSchema]);
|
|
16
15
|
/** Checks one article projection against its selected registry route. */
|
|
17
16
|
function matchesArticleDocument(document, projection) {
|
|
18
17
|
return (projection.kind === "article" &&
|
|
@@ -45,55 +44,16 @@ function matchesPageDocument(document, projection) {
|
|
|
45
44
|
projection.publicPath === document.route.publicPath &&
|
|
46
45
|
projection.sourcePath === document.sourcePath);
|
|
47
46
|
}
|
|
48
|
-
/** Checks
|
|
49
|
-
function matchesQuestionIdentity(projection, identity) {
|
|
50
|
-
return (projection.kind === "question-body" &&
|
|
51
|
-
projection.bodyKind === identity.bodyKind &&
|
|
52
|
-
projection.contentKey === identity.contentKey &&
|
|
53
|
-
projection.artifactLocale === identity.artifactLocale &&
|
|
54
|
-
projection.peerContentKey === identity.peerContentKey &&
|
|
55
|
-
projection.questionKey === identity.questionKey &&
|
|
56
|
-
projection.questionNumber === identity.questionNumber &&
|
|
57
|
-
projection.setKey === identity.setKey);
|
|
58
|
-
}
|
|
59
|
-
/** Checks the ordered prompt required before one entitled answer artifact. */
|
|
60
|
-
function matchesAnswerPrompt(projection, input) {
|
|
61
|
-
const { identity } = input;
|
|
62
|
-
return (projection.kind === "question-body" &&
|
|
63
|
-
projection.bodyKind === "question" &&
|
|
64
|
-
projection.contentKey === identity.peerContentKey &&
|
|
65
|
-
projection.artifactLocale === input.questionArtifactLocale &&
|
|
66
|
-
projection.peerContentKey === identity.contentKey &&
|
|
67
|
-
projection.questionKey === identity.questionKey &&
|
|
68
|
-
projection.questionNumber === identity.questionNumber &&
|
|
69
|
-
projection.setKey === identity.setKey);
|
|
70
|
-
}
|
|
71
|
-
/** Checks family-specific artifact count, order, identity, and projection kind. */
|
|
47
|
+
/** Checks that the one artifact projects exactly the selected document. */
|
|
72
48
|
function hasCoherentReadyArtifacts(input) {
|
|
73
|
-
const
|
|
49
|
+
const [{ projection }] = input.artifacts;
|
|
74
50
|
if (input.document.family === "article") {
|
|
75
|
-
return (input.
|
|
76
|
-
matchesArticleDocument(input.document, first));
|
|
51
|
+
return matchesArticleDocument(input.document, projection);
|
|
77
52
|
}
|
|
78
53
|
if (input.document.family === "material") {
|
|
79
|
-
return (input.
|
|
80
|
-
matchesMaterialDocument(input.document, first));
|
|
81
|
-
}
|
|
82
|
-
if (input.document.family === "page") {
|
|
83
|
-
return (input.artifacts.length === 1 && matchesPageDocument(input.document, first));
|
|
84
|
-
}
|
|
85
|
-
if (input.document.identity.bodyKind === "question") {
|
|
86
|
-
return (input.artifacts.length === 1 &&
|
|
87
|
-
matchesQuestionIdentity(first, input.document.identity));
|
|
54
|
+
return matchesMaterialDocument(input.document, projection);
|
|
88
55
|
}
|
|
89
|
-
|
|
90
|
-
return (input.artifacts.length === 2 &&
|
|
91
|
-
matchesAnswerPrompt(first, {
|
|
92
|
-
identity: input.document.identity,
|
|
93
|
-
questionArtifactLocale: input.document.target.placement.questionArtifactLocale,
|
|
94
|
-
}) &&
|
|
95
|
-
second !== undefined &&
|
|
96
|
-
matchesQuestionIdentity(second, input.document.identity));
|
|
56
|
+
return matchesPageDocument(input.document, projection);
|
|
97
57
|
}
|
|
98
58
|
const PreviewBaseSchema = Schema.Struct({
|
|
99
59
|
document: PreviewDocumentSchema,
|
package/dist/preview/target.d.ts
CHANGED
|
@@ -9,176 +9,3 @@ export declare const PreviewRouteSchema: Schema.Struct<{
|
|
|
9
9
|
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
10
10
|
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
11
11
|
}>;
|
|
12
|
-
/**
|
|
13
|
-
* Placement identity needed to select one preview body.
|
|
14
|
-
* Responses remain owned by the canonical question registry and projections.
|
|
15
|
-
*/
|
|
16
|
-
export declare const TryoutPreviewPlacementSchema: Schema.Struct<{
|
|
17
|
-
readonly answerArtifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
18
|
-
readonly answerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
19
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
20
|
-
readonly blueprint: Schema.optionalKey<Schema.Struct<{
|
|
21
|
-
readonly cognitiveLevel: Schema.String;
|
|
22
|
-
readonly contentDomain: Schema.String;
|
|
23
|
-
readonly topic: Schema.String;
|
|
24
|
-
}>>;
|
|
25
|
-
readonly countryKey: Schema.String;
|
|
26
|
-
readonly deliveryLanguage: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraDeliveryLanguage">;
|
|
27
|
-
readonly examKey: Schema.String;
|
|
28
|
-
readonly languagePolicy: Schema.Union<readonly [Schema.Struct<{
|
|
29
|
-
readonly kind: Schema.Literal<"app-locale">;
|
|
30
|
-
}>, Schema.Struct<{
|
|
31
|
-
readonly kind: Schema.Literal<"fixed">;
|
|
32
|
-
readonly language: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraDeliveryLanguage">;
|
|
33
|
-
}>]>;
|
|
34
|
-
readonly points: Schema.optionalKey<Schema.Int>;
|
|
35
|
-
readonly questionArtifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
36
|
-
readonly questionContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
37
|
-
readonly questionOrder: Schema.Finite;
|
|
38
|
-
readonly questionSourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
39
|
-
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
40
|
-
readonly scope: Schema.Literal<"server">;
|
|
41
|
-
readonly sectionKey: Schema.String;
|
|
42
|
-
readonly setKey: Schema.String;
|
|
43
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
44
|
-
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
45
|
-
readonly trackKey: Schema.String;
|
|
46
|
-
}>;
|
|
47
|
-
/** Exact current try-out rows needed to preview one authored question body. */
|
|
48
|
-
export declare const TryoutPreviewTargetSchema: Schema.Struct<{
|
|
49
|
-
readonly exam: Schema.Struct<{
|
|
50
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
51
|
-
readonly description: Schema.optional<Schema.String>;
|
|
52
|
-
readonly graph: Schema.Struct<{
|
|
53
|
-
readonly alignmentId: Schema.String;
|
|
54
|
-
readonly assetId: Schema.String;
|
|
55
|
-
readonly conceptId: Schema.String;
|
|
56
|
-
readonly learningObjectId: Schema.String;
|
|
57
|
-
readonly lensId: Schema.String;
|
|
58
|
-
}>;
|
|
59
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
60
|
-
readonly title: Schema.String;
|
|
61
|
-
readonly countryKey: Schema.String;
|
|
62
|
-
readonly examKey: Schema.String;
|
|
63
|
-
readonly kind: Schema.Literal<"exam">;
|
|
64
|
-
readonly order: Schema.Finite;
|
|
65
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
66
|
-
readonly scoringStrategy: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
67
|
-
}>;
|
|
68
|
-
readonly placement: Schema.Struct<{
|
|
69
|
-
readonly answerArtifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
70
|
-
readonly answerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
71
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
72
|
-
readonly blueprint: Schema.optionalKey<Schema.Struct<{
|
|
73
|
-
readonly cognitiveLevel: Schema.String;
|
|
74
|
-
readonly contentDomain: Schema.String;
|
|
75
|
-
readonly topic: Schema.String;
|
|
76
|
-
}>>;
|
|
77
|
-
readonly countryKey: Schema.String;
|
|
78
|
-
readonly deliveryLanguage: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraDeliveryLanguage">;
|
|
79
|
-
readonly examKey: Schema.String;
|
|
80
|
-
readonly languagePolicy: Schema.Union<readonly [Schema.Struct<{
|
|
81
|
-
readonly kind: Schema.Literal<"app-locale">;
|
|
82
|
-
}>, Schema.Struct<{
|
|
83
|
-
readonly kind: Schema.Literal<"fixed">;
|
|
84
|
-
readonly language: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraDeliveryLanguage">;
|
|
85
|
-
}>]>;
|
|
86
|
-
readonly points: Schema.optionalKey<Schema.Int>;
|
|
87
|
-
readonly questionArtifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
88
|
-
readonly questionContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
89
|
-
readonly questionOrder: Schema.Finite;
|
|
90
|
-
readonly questionSourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
91
|
-
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
92
|
-
readonly scope: Schema.Literal<"server">;
|
|
93
|
-
readonly sectionKey: Schema.String;
|
|
94
|
-
readonly setKey: Schema.String;
|
|
95
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
96
|
-
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
97
|
-
readonly trackKey: Schema.String;
|
|
98
|
-
}>;
|
|
99
|
-
readonly section: Schema.Struct<{
|
|
100
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
101
|
-
readonly description: Schema.optional<Schema.String>;
|
|
102
|
-
readonly graph: Schema.Struct<{
|
|
103
|
-
readonly alignmentId: Schema.String;
|
|
104
|
-
readonly assetId: Schema.String;
|
|
105
|
-
readonly conceptId: Schema.String;
|
|
106
|
-
readonly learningObjectId: Schema.String;
|
|
107
|
-
readonly lensId: Schema.String;
|
|
108
|
-
}>;
|
|
109
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
110
|
-
readonly title: Schema.String;
|
|
111
|
-
readonly countryKey: Schema.String;
|
|
112
|
-
readonly examKey: Schema.String;
|
|
113
|
-
readonly kind: Schema.Literal<"section">;
|
|
114
|
-
readonly marks: Schema.optionalKey<Schema.Struct<{
|
|
115
|
-
readonly blank: Schema.Int;
|
|
116
|
-
readonly correct: Schema.Int;
|
|
117
|
-
readonly wrong: Schema.Int;
|
|
118
|
-
}>>;
|
|
119
|
-
readonly order: Schema.Finite;
|
|
120
|
-
readonly publicPath: Schema.optional<Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">>;
|
|
121
|
-
readonly questionCount: Schema.Finite;
|
|
122
|
-
readonly questionSourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
123
|
-
readonly sectionKey: Schema.String;
|
|
124
|
-
readonly setKey: Schema.String;
|
|
125
|
-
readonly timeLimitSeconds: Schema.Finite;
|
|
126
|
-
readonly trackKey: Schema.String;
|
|
127
|
-
readonly visibility: Schema.Literals<readonly ["internal-entry", "visible"]>;
|
|
128
|
-
}>;
|
|
129
|
-
readonly set: Schema.Struct<{
|
|
130
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
131
|
-
readonly description: Schema.optional<Schema.String>;
|
|
132
|
-
readonly graph: Schema.Struct<{
|
|
133
|
-
readonly alignmentId: Schema.String;
|
|
134
|
-
readonly assetId: Schema.String;
|
|
135
|
-
readonly conceptId: Schema.String;
|
|
136
|
-
readonly learningObjectId: Schema.String;
|
|
137
|
-
readonly lensId: Schema.String;
|
|
138
|
-
}>;
|
|
139
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
140
|
-
readonly title: Schema.String;
|
|
141
|
-
readonly countryKey: Schema.String;
|
|
142
|
-
readonly examKey: Schema.String;
|
|
143
|
-
readonly internalEntrySectionKey: Schema.optional<Schema.String>;
|
|
144
|
-
readonly kind: Schema.Literal<"set">;
|
|
145
|
-
readonly order: Schema.Finite;
|
|
146
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
147
|
-
readonly questionCount: Schema.Finite;
|
|
148
|
-
readonly scoringStrategy: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
149
|
-
readonly sectionCount: Schema.Finite;
|
|
150
|
-
readonly setKey: Schema.String;
|
|
151
|
-
readonly trackKey: Schema.String;
|
|
152
|
-
readonly visibleSectionCount: Schema.Finite;
|
|
153
|
-
}>;
|
|
154
|
-
readonly track: Schema.Struct<{
|
|
155
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
156
|
-
readonly description: Schema.optional<Schema.String>;
|
|
157
|
-
readonly graph: Schema.Struct<{
|
|
158
|
-
readonly alignmentId: Schema.String;
|
|
159
|
-
readonly assetId: Schema.String;
|
|
160
|
-
readonly conceptId: Schema.String;
|
|
161
|
-
readonly learningObjectId: Schema.String;
|
|
162
|
-
readonly lensId: Schema.String;
|
|
163
|
-
}>;
|
|
164
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
165
|
-
readonly title: Schema.String;
|
|
166
|
-
readonly countryKey: Schema.String;
|
|
167
|
-
readonly examKey: Schema.String;
|
|
168
|
-
readonly kind: Schema.Literal<"track">;
|
|
169
|
-
readonly order: Schema.Finite;
|
|
170
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
171
|
-
readonly questionCount: Schema.Finite;
|
|
172
|
-
readonly sectionCount: Schema.Finite;
|
|
173
|
-
readonly setCount: Schema.Finite;
|
|
174
|
-
readonly trackKey: Schema.String;
|
|
175
|
-
readonly trackKind: Schema.Literals<readonly ["institution", "subject", "year"]>;
|
|
176
|
-
readonly visibleSectionCount: Schema.Finite;
|
|
177
|
-
}>;
|
|
178
|
-
}>;
|
|
179
|
-
export type TryoutPreviewTarget = typeof TryoutPreviewTargetSchema.Type;
|
|
180
|
-
/** Derives the existing try-out page used by the trusted authoring preview. */
|
|
181
|
-
export declare function previewTryoutRoute(target: TryoutPreviewTarget): {
|
|
182
|
-
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
183
|
-
readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
184
|
-
};
|
package/dist/preview/target.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from "effect";
|
|
2
2
|
import { PublicPathSchema } from "#contracts/ids";
|
|
3
3
|
import { AppLocaleSchema } from "#contracts/locale";
|
|
4
|
-
import { TryoutExamSchema, TryoutSectionSchema, TryoutSetSchema, TryoutTrackSchema, } from "#contracts/tryout/catalog";
|
|
5
|
-
import { TryoutPlacementSourceSchema } from "#contracts/tryout/placement";
|
|
6
4
|
/** Locale and public route that name one page. Route errors and previews share them. */
|
|
7
5
|
export const PublicRouteFields = {
|
|
8
6
|
appLocale: AppLocaleSchema,
|
|
@@ -10,70 +8,3 @@ export const PublicRouteFields = {
|
|
|
10
8
|
};
|
|
11
9
|
/** Locale and existing public route refreshed by one preview update. */
|
|
12
10
|
export const PreviewRouteSchema = Schema.Struct(PublicRouteFields);
|
|
13
|
-
/**
|
|
14
|
-
* Placement identity needed to select one preview body.
|
|
15
|
-
* Responses remain owned by the canonical question registry and projections.
|
|
16
|
-
*/
|
|
17
|
-
export const TryoutPreviewPlacementSchema = TryoutPlacementSourceSchema.pipe((schema) => schema.mapFields(Struct.omit(["response"])));
|
|
18
|
-
const TryoutPreviewTargetInputSchema = Schema.Struct({
|
|
19
|
-
exam: TryoutExamSchema,
|
|
20
|
-
placement: TryoutPreviewPlacementSchema,
|
|
21
|
-
section: TryoutSectionSchema,
|
|
22
|
-
set: TryoutSetSchema,
|
|
23
|
-
track: TryoutTrackSchema,
|
|
24
|
-
});
|
|
25
|
-
/** Checks that every target row belongs to one locale-specific hierarchy. */
|
|
26
|
-
function hasCoherentTryoutHierarchy(input) {
|
|
27
|
-
const rows = [input.track, input.set, input.section, input.placement];
|
|
28
|
-
return (Arr.every(rows, ({ countryKey }) => countryKey === input.exam.countryKey) &&
|
|
29
|
-
Arr.every(rows, ({ examKey }) => examKey === input.exam.examKey) &&
|
|
30
|
-
Arr.every(rows, ({ appLocale }) => appLocale === input.exam.appLocale) &&
|
|
31
|
-
Arr.every(rows, ({ sourceRevision }) => sourceRevision === input.exam.sourceRevision) &&
|
|
32
|
-
input.set.trackKey === input.track.trackKey &&
|
|
33
|
-
input.section.trackKey === input.track.trackKey &&
|
|
34
|
-
input.placement.trackKey === input.track.trackKey &&
|
|
35
|
-
input.section.setKey === input.set.setKey &&
|
|
36
|
-
input.placement.setKey === input.set.setKey &&
|
|
37
|
-
input.placement.sectionKey === input.section.sectionKey);
|
|
38
|
-
}
|
|
39
|
-
/** Checks nested routes and the internal-entry route fallback contract. */
|
|
40
|
-
function hasCoherentTryoutRoutes(input) {
|
|
41
|
-
if (!input.track.publicPath.startsWith(`${input.exam.publicPath}/`)) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
if (!input.set.publicPath.startsWith(`${input.track.publicPath}/`)) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
if (input.section.visibility === "internal-entry") {
|
|
48
|
-
return input.set.internalEntrySectionKey === input.section.sectionKey;
|
|
49
|
-
}
|
|
50
|
-
return (input.set.internalEntrySectionKey === undefined &&
|
|
51
|
-
input.section.publicPath?.startsWith(`${input.set.publicPath}/`) === true);
|
|
52
|
-
}
|
|
53
|
-
/** Checks that the selected placement is owned by the target section source. */
|
|
54
|
-
function hasCoherentTryoutPlacement(input) {
|
|
55
|
-
return (input.placement.questionOrder <= input.section.questionCount &&
|
|
56
|
-
input.placement.questionSourcePath ===
|
|
57
|
-
`${input.section.questionSourcePath}/question-${input.placement.questionOrder}`);
|
|
58
|
-
}
|
|
59
|
-
/** Exact current try-out rows needed to preview one authored question body. */
|
|
60
|
-
export const TryoutPreviewTargetSchema = Schema.Struct({
|
|
61
|
-
exam: TryoutExamSchema,
|
|
62
|
-
placement: TryoutPreviewPlacementSchema,
|
|
63
|
-
section: TryoutSectionSchema,
|
|
64
|
-
set: TryoutSetSchema,
|
|
65
|
-
track: TryoutTrackSchema,
|
|
66
|
-
}).pipe(Schema.check(Schema.makeFilter(hasCoherentTryoutHierarchy, {
|
|
67
|
-
message: "Expected preview target hierarchy keys, locale, and revision to agree.",
|
|
68
|
-
})), Schema.check(Schema.makeFilter(hasCoherentTryoutRoutes, {
|
|
69
|
-
message: "Expected preview target routes to form one reachable hierarchy.",
|
|
70
|
-
})), Schema.check(Schema.makeFilter(hasCoherentTryoutPlacement, {
|
|
71
|
-
message: "Expected preview placement to belong to the selected section source.",
|
|
72
|
-
})));
|
|
73
|
-
/** Derives the existing try-out page used by the trusted authoring preview. */
|
|
74
|
-
export function previewTryoutRoute(target) {
|
|
75
|
-
return PreviewRouteSchema.make({
|
|
76
|
-
appLocale: target.section.appLocale,
|
|
77
|
-
publicPath: target.section.publicPath ?? target.set.publicPath,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
@@ -111,133 +111,6 @@ export declare const digestProjections: <E, R>(releaseId: string & import("effec
|
|
|
111
111
|
};
|
|
112
112
|
readonly sitemap: true;
|
|
113
113
|
readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
|
|
114
|
-
} | {
|
|
115
|
-
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
116
|
-
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
117
|
-
readonly peerContentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
118
|
-
readonly questionKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraQuestionKey">;
|
|
119
|
-
readonly questionNumber: number;
|
|
120
|
-
readonly setKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraQuestionSetKey">;
|
|
121
|
-
readonly bodyKind: "question";
|
|
122
|
-
readonly blueprint?: {
|
|
123
|
-
readonly cognitiveLevel: string;
|
|
124
|
-
readonly contentDomain: string;
|
|
125
|
-
readonly topic: string;
|
|
126
|
-
};
|
|
127
|
-
readonly kind: "question-body";
|
|
128
|
-
readonly metadata: {
|
|
129
|
-
readonly dateModified?: string;
|
|
130
|
-
readonly datePublished: string;
|
|
131
|
-
readonly authors: readonly {
|
|
132
|
-
readonly name: string;
|
|
133
|
-
}[];
|
|
134
|
-
readonly title: string;
|
|
135
|
-
};
|
|
136
|
-
readonly stimulusKey?: string;
|
|
137
|
-
readonly response: {
|
|
138
|
-
readonly kind: "single-choice";
|
|
139
|
-
readonly options: readonly {
|
|
140
|
-
readonly isCorrect: boolean;
|
|
141
|
-
readonly label: string;
|
|
142
|
-
readonly optionKey: string;
|
|
143
|
-
readonly order: number;
|
|
144
|
-
}[];
|
|
145
|
-
} | {
|
|
146
|
-
readonly kind: "multiple-choice";
|
|
147
|
-
readonly options: readonly {
|
|
148
|
-
readonly isCorrect: boolean;
|
|
149
|
-
readonly label: string;
|
|
150
|
-
readonly optionKey: string;
|
|
151
|
-
readonly order: number;
|
|
152
|
-
}[];
|
|
153
|
-
} | {
|
|
154
|
-
readonly categories: readonly {
|
|
155
|
-
readonly categoryKey: string;
|
|
156
|
-
readonly label: string;
|
|
157
|
-
readonly order: number;
|
|
158
|
-
}[];
|
|
159
|
-
readonly kind: "category";
|
|
160
|
-
readonly statements: readonly {
|
|
161
|
-
readonly correctCategoryKey: string;
|
|
162
|
-
readonly label: string;
|
|
163
|
-
readonly order: number;
|
|
164
|
-
readonly statementKey: string;
|
|
165
|
-
}[];
|
|
166
|
-
} | {
|
|
167
|
-
readonly criteria: readonly {
|
|
168
|
-
readonly criterionKey: string;
|
|
169
|
-
readonly finalAnswer?: {
|
|
170
|
-
readonly acceptsFractions: boolean;
|
|
171
|
-
readonly kind: "number";
|
|
172
|
-
readonly tolerance?: {
|
|
173
|
-
readonly kind: "absolute" | "relative";
|
|
174
|
-
readonly value: string;
|
|
175
|
-
};
|
|
176
|
-
readonly value: string;
|
|
177
|
-
} | {
|
|
178
|
-
readonly acceptedAnswers: readonly [string, ...string[]];
|
|
179
|
-
readonly collapseWhitespace: boolean;
|
|
180
|
-
readonly ignoreCase: boolean;
|
|
181
|
-
readonly kind: "text";
|
|
182
|
-
};
|
|
183
|
-
readonly order: number;
|
|
184
|
-
readonly label: {
|
|
185
|
-
readonly de: string;
|
|
186
|
-
readonly en: string;
|
|
187
|
-
readonly id: string;
|
|
188
|
-
};
|
|
189
|
-
readonly levels: readonly {
|
|
190
|
-
readonly levelKey: string;
|
|
191
|
-
readonly order: number;
|
|
192
|
-
readonly points: number;
|
|
193
|
-
readonly label: {
|
|
194
|
-
readonly de: string;
|
|
195
|
-
readonly en: string;
|
|
196
|
-
readonly id: string;
|
|
197
|
-
};
|
|
198
|
-
}[];
|
|
199
|
-
}[];
|
|
200
|
-
readonly kind: "rubric";
|
|
201
|
-
} | {
|
|
202
|
-
readonly key: {
|
|
203
|
-
readonly acceptsFractions: boolean;
|
|
204
|
-
readonly kind: "number";
|
|
205
|
-
readonly tolerance?: {
|
|
206
|
-
readonly kind: "absolute" | "relative";
|
|
207
|
-
readonly value: string;
|
|
208
|
-
};
|
|
209
|
-
readonly value: string;
|
|
210
|
-
} | {
|
|
211
|
-
readonly acceptedAnswers: readonly [string, ...string[]];
|
|
212
|
-
readonly collapseWhitespace: boolean;
|
|
213
|
-
readonly ignoreCase: boolean;
|
|
214
|
-
readonly kind: "text";
|
|
215
|
-
};
|
|
216
|
-
readonly kind: "short-answer";
|
|
217
|
-
};
|
|
218
|
-
} | {
|
|
219
|
-
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
220
|
-
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
221
|
-
readonly peerContentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
222
|
-
readonly questionKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraQuestionKey">;
|
|
223
|
-
readonly questionNumber: number;
|
|
224
|
-
readonly setKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraQuestionSetKey">;
|
|
225
|
-
readonly bodyKind: "answer";
|
|
226
|
-
readonly blueprint?: {
|
|
227
|
-
readonly cognitiveLevel: string;
|
|
228
|
-
readonly contentDomain: string;
|
|
229
|
-
readonly topic: string;
|
|
230
|
-
};
|
|
231
|
-
readonly kind: "question-body";
|
|
232
|
-
readonly metadata: {
|
|
233
|
-
readonly dateModified?: string;
|
|
234
|
-
readonly datePublished: string;
|
|
235
|
-
readonly authors: readonly {
|
|
236
|
-
readonly name: string;
|
|
237
|
-
}[];
|
|
238
|
-
readonly title: string;
|
|
239
|
-
};
|
|
240
|
-
readonly stimulusKey?: string;
|
|
241
114
|
}, E, R>) => Effect.Effect<{
|
|
242
115
|
count: number;
|
|
243
116
|
digest: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
@@ -92,132 +92,5 @@ export declare const hashContentProjection: (projection: {
|
|
|
92
92
|
};
|
|
93
93
|
readonly sitemap: true;
|
|
94
94
|
readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
|
|
95
|
-
} | {
|
|
96
|
-
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
97
|
-
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
98
|
-
readonly peerContentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
99
|
-
readonly questionKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraQuestionKey">;
|
|
100
|
-
readonly questionNumber: number;
|
|
101
|
-
readonly setKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraQuestionSetKey">;
|
|
102
|
-
readonly bodyKind: "question";
|
|
103
|
-
readonly blueprint?: {
|
|
104
|
-
readonly cognitiveLevel: string;
|
|
105
|
-
readonly contentDomain: string;
|
|
106
|
-
readonly topic: string;
|
|
107
|
-
};
|
|
108
|
-
readonly kind: "question-body";
|
|
109
|
-
readonly metadata: {
|
|
110
|
-
readonly dateModified?: string;
|
|
111
|
-
readonly datePublished: string;
|
|
112
|
-
readonly authors: readonly {
|
|
113
|
-
readonly name: string;
|
|
114
|
-
}[];
|
|
115
|
-
readonly title: string;
|
|
116
|
-
};
|
|
117
|
-
readonly stimulusKey?: string;
|
|
118
|
-
readonly response: {
|
|
119
|
-
readonly categories: readonly {
|
|
120
|
-
readonly categoryKey: string;
|
|
121
|
-
readonly label: string;
|
|
122
|
-
readonly order: number;
|
|
123
|
-
}[];
|
|
124
|
-
readonly kind: "category";
|
|
125
|
-
readonly statements: readonly {
|
|
126
|
-
readonly correctCategoryKey: string;
|
|
127
|
-
readonly label: string;
|
|
128
|
-
readonly order: number;
|
|
129
|
-
readonly statementKey: string;
|
|
130
|
-
}[];
|
|
131
|
-
} | {
|
|
132
|
-
readonly kind: "multiple-choice";
|
|
133
|
-
readonly options: readonly {
|
|
134
|
-
readonly isCorrect: boolean;
|
|
135
|
-
readonly label: string;
|
|
136
|
-
readonly optionKey: string;
|
|
137
|
-
readonly order: number;
|
|
138
|
-
}[];
|
|
139
|
-
} | {
|
|
140
|
-
readonly kind: "single-choice";
|
|
141
|
-
readonly options: readonly {
|
|
142
|
-
readonly isCorrect: boolean;
|
|
143
|
-
readonly label: string;
|
|
144
|
-
readonly optionKey: string;
|
|
145
|
-
readonly order: number;
|
|
146
|
-
}[];
|
|
147
|
-
} | {
|
|
148
|
-
readonly criteria: readonly {
|
|
149
|
-
readonly criterionKey: string;
|
|
150
|
-
readonly finalAnswer?: {
|
|
151
|
-
readonly acceptsFractions: boolean;
|
|
152
|
-
readonly kind: "number";
|
|
153
|
-
readonly tolerance?: {
|
|
154
|
-
readonly kind: "absolute" | "relative";
|
|
155
|
-
readonly value: string;
|
|
156
|
-
};
|
|
157
|
-
readonly value: string;
|
|
158
|
-
} | {
|
|
159
|
-
readonly acceptedAnswers: readonly [string, ...string[]];
|
|
160
|
-
readonly collapseWhitespace: boolean;
|
|
161
|
-
readonly ignoreCase: boolean;
|
|
162
|
-
readonly kind: "text";
|
|
163
|
-
};
|
|
164
|
-
readonly order: number;
|
|
165
|
-
readonly label: {
|
|
166
|
-
readonly de: string;
|
|
167
|
-
readonly en: string;
|
|
168
|
-
readonly id: string;
|
|
169
|
-
};
|
|
170
|
-
readonly levels: readonly {
|
|
171
|
-
readonly levelKey: string;
|
|
172
|
-
readonly order: number;
|
|
173
|
-
readonly points: number;
|
|
174
|
-
readonly label: {
|
|
175
|
-
readonly de: string;
|
|
176
|
-
readonly en: string;
|
|
177
|
-
readonly id: string;
|
|
178
|
-
};
|
|
179
|
-
}[];
|
|
180
|
-
}[];
|
|
181
|
-
readonly kind: "rubric";
|
|
182
|
-
} | {
|
|
183
|
-
readonly key: {
|
|
184
|
-
readonly acceptsFractions: boolean;
|
|
185
|
-
readonly kind: "number";
|
|
186
|
-
readonly tolerance?: {
|
|
187
|
-
readonly kind: "absolute" | "relative";
|
|
188
|
-
readonly value: string;
|
|
189
|
-
};
|
|
190
|
-
readonly value: string;
|
|
191
|
-
} | {
|
|
192
|
-
readonly acceptedAnswers: readonly [string, ...string[]];
|
|
193
|
-
readonly collapseWhitespace: boolean;
|
|
194
|
-
readonly ignoreCase: boolean;
|
|
195
|
-
readonly kind: "text";
|
|
196
|
-
};
|
|
197
|
-
readonly kind: "short-answer";
|
|
198
|
-
};
|
|
199
|
-
} | {
|
|
200
|
-
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
201
|
-
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
202
|
-
readonly peerContentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
203
|
-
readonly questionKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraQuestionKey">;
|
|
204
|
-
readonly questionNumber: number;
|
|
205
|
-
readonly setKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraQuestionSetKey">;
|
|
206
|
-
readonly bodyKind: "answer";
|
|
207
|
-
readonly blueprint?: {
|
|
208
|
-
readonly cognitiveLevel: string;
|
|
209
|
-
readonly contentDomain: string;
|
|
210
|
-
readonly topic: string;
|
|
211
|
-
};
|
|
212
|
-
readonly kind: "question-body";
|
|
213
|
-
readonly metadata: {
|
|
214
|
-
readonly dateModified?: string;
|
|
215
|
-
readonly datePublished: string;
|
|
216
|
-
readonly authors: readonly {
|
|
217
|
-
readonly name: string;
|
|
218
|
-
}[];
|
|
219
|
-
readonly title: string;
|
|
220
|
-
};
|
|
221
|
-
readonly stimulusKey?: string;
|
|
222
95
|
}) => Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, ContentProjectionHashError, never>;
|
|
223
96
|
export {};
|