@nakafa/aksara-contracts 1.0.1 → 3.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 +10 -27
- package/dist/artifact/integrity.d.ts +3 -3
- package/dist/artifact/integrity.js +2 -2
- package/dist/artifact/source.d.ts +2 -2
- package/dist/artifact/source.js +2 -8
- package/dist/artifact/spec.d.ts +0 -16
- package/dist/artifact/spec.js +0 -6
- package/dist/artifact/verify.d.ts +1 -1
- 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 +352 -212
- 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/hash/digest.d.ts +7 -7
- package/dist/hash/digest.js +9 -30
- package/dist/hash/stream.d.ts +1 -1
- package/dist/hash/text.d.ts +3 -12
- package/dist/hash/text.js +3 -6
- package/dist/ids.js +8 -8
- package/dist/preview/artifact.d.ts +1 -120
- package/dist/preview/auth.d.ts +1 -1
- package/dist/preview/auth.js +29 -25
- 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/program/snapshot/digest.d.ts +1 -2
- package/dist/program/snapshot/digest.js +2 -4
- package/dist/program/snapshot/hash.d.ts +6 -21
- package/dist/program/snapshot/hash.js +3 -9
- package/dist/projection/digest.d.ts +7 -143
- package/dist/projection/digest.js +7 -13
- package/dist/projection/hash.d.ts +2 -138
- package/dist/projection/hash.js +2 -5
- package/dist/projection/material.js +1 -1
- package/dist/projection/spec.d.ts +6 -211
- package/dist/projection/spec.js +4 -18
- package/dist/projection/verify.d.ts +1 -128
- package/dist/projection/verify.js +1 -4
- package/dist/quran/provenance.d.ts +2 -8
- package/dist/quran/provenance.js +1 -4
- package/dist/quran/snapshot/digest.d.ts +1 -2
- package/dist/quran/snapshot/digest.js +2 -2
- package/dist/quran/snapshot/hash.d.ts +3 -10
- package/dist/quran/snapshot/hash.js +2 -5
- package/dist/quran/snapshot/row/hash.d.ts +3 -12
- package/dist/quran/snapshot/row/hash.js +2 -5
- 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 +9 -18
- package/dist/release/digest.js +7 -13
- package/dist/release/hash.d.ts +7 -16
- package/dist/release/hash.js +2 -6
- 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 +3 -3
- package/dist/release/items.js +1 -1
- 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 +11 -31
- package/dist/release/result/digest.js +5 -11
- package/dist/release/rollback/digest.d.ts +11 -35
- package/dist/release/rollback/digest.js +7 -13
- package/dist/release/rollback/spec.d.ts +30 -792
- package/dist/release/rollback/spec.js +1 -4
- package/dist/release/route/digest.d.ts +7 -16
- package/dist/release/route/digest.js +7 -13
- package/dist/release/route/verify.d.ts +1 -1
- package/dist/release/route/verify.js +1 -1
- 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/program.d.ts +1 -1
- package/dist/release/snapshot/evidence/quran.d.ts +1 -1
- 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 +7 -7
- package/dist/renderer/compatibility.d.ts +1 -1
- package/dist/renderer/component.js +1 -1
- package/dist/renderer/contract.d.ts +0 -8
- package/dist/renderer/contract.js +0 -3
- package/dist/renderer/manifest.d.ts +3 -3
- package/dist/renderer/manifest.js +2 -2
- package/dist/runtime/spec.d.ts +38 -38
- package/dist/runtime/spec.js +4 -5
- package/dist/runtime/verify.d.ts +42 -42
- package/dist/signature/key.d.ts +0 -2
- package/dist/signature/key.js +37 -88
- package/dist/signature/spec.d.ts +5 -5
- package/dist/signature/spec.js +0 -1
- package/dist/signature/verify.js +31 -46
- 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/dist/tree.js +1 -1
- package/package.json +188 -296
- 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
|
-
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
2
|
import type { ActiveAppLocaleList } from "#contracts/locale";
|
|
3
|
-
import { ProgramRowHashError } from "#contracts/program/snapshot/hash";
|
|
4
3
|
import { type ProgramSnapshotRow } from "#contracts/program/snapshot/row";
|
|
5
4
|
import type { ProgramCounts } from "#contracts/program/snapshot/spec";
|
|
6
5
|
declare const ProgramDigestError_base: Schema.Class<ProgramDigestError, Schema.TaggedStruct<"ProgramDigestError", {
|
|
@@ -24,5 +23,5 @@ export declare const digestProgramRows: <E, R>(input: {
|
|
|
24
23
|
sitemapCount: number;
|
|
25
24
|
slugCount: number;
|
|
26
25
|
rowDigest: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
27
|
-
}, E | ProgramDigestError
|
|
26
|
+
}, E | ProgramDigestError, R>;
|
|
28
27
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Array as Arr, Effect, MutableHashMap, MutableHashSet, Option, Schema, Stream, } from "effect";
|
|
2
2
|
import { DigestStream } from "#contracts/hash/stream";
|
|
3
3
|
import { curriculumNamespace, } from "#contracts/program/curriculum";
|
|
4
|
-
import {
|
|
4
|
+
import { verifyProgramSnapshotRowHash } from "#contracts/program/snapshot/hash";
|
|
5
5
|
import { canonicalizeProgramSnapshotRow, } from "#contracts/program/snapshot/row";
|
|
6
6
|
import { encodeJsonText } from "#contracts/text/json";
|
|
7
7
|
import { compareCodeUnits } from "#contracts/text/order";
|
|
@@ -114,9 +114,7 @@ class ProgramDigestState {
|
|
|
114
114
|
}
|
|
115
115
|
/** Digests the complete canonical stream once. */
|
|
116
116
|
digest() {
|
|
117
|
-
return this.#stream
|
|
118
|
-
.digest()
|
|
119
|
-
.pipe(Effect.mapError(() => new ProgramRowHashError({ scope: "digest" })));
|
|
117
|
+
return this.#stream.digest();
|
|
120
118
|
}
|
|
121
119
|
/** Adds one catalog row before any current curriculum records. */
|
|
122
120
|
#addProgram(record) {
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { Effect
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { type ProgramSnapshotRow } from "#contracts/program/snapshot/row";
|
|
3
3
|
import { type ProgramSnapshot, type ProgramSnapshotFacts } from "#contracts/program/snapshot/spec";
|
|
4
|
-
declare const ProgramSnapshotHashError_base: Schema.Class<ProgramSnapshotHashError, Schema.TaggedStruct<"ProgramSnapshotHashError", {}>, import("effect/Cause").YieldableError & {
|
|
5
|
-
readonly brand: unique symbol;
|
|
6
|
-
}>;
|
|
7
|
-
/** Node could not compute a deterministic program snapshot identity. */
|
|
8
|
-
export declare class ProgramSnapshotHashError extends ProgramSnapshotHashError_base {
|
|
9
|
-
}
|
|
10
|
-
declare const ProgramRowHashError_base: Schema.Class<ProgramRowHashError, Schema.TaggedStruct<"ProgramRowHashError", {
|
|
11
|
-
readonly scope: Schema.Literals<readonly ["digest", "row"]>;
|
|
12
|
-
}>, import("effect/Cause").YieldableError & {
|
|
13
|
-
readonly brand: unique symbol;
|
|
14
|
-
}>;
|
|
15
|
-
/** Node could not compute one deterministic program row identity. */
|
|
16
|
-
export declare class ProgramRowHashError extends ProgramRowHashError_base {
|
|
17
|
-
}
|
|
18
4
|
/** Serializes current program facts in stable signed field order. */
|
|
19
5
|
export declare function canonicalizeProgramSnapshot(input: ProgramSnapshotFacts): string;
|
|
20
6
|
/** Creates the content-addressed identity of one complete program snapshot. */
|
|
@@ -36,9 +22,9 @@ export declare const makeProgramSnapshot: (input: {
|
|
|
36
22
|
readonly rowDigest: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
37
23
|
readonly format: "localized-program-snapshot";
|
|
38
24
|
readonly snapshotId: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
39
|
-
},
|
|
25
|
+
}, never, never>;
|
|
40
26
|
/** Recomputes the content identity of one stored current snapshot. */
|
|
41
|
-
export declare function verifyProgramSnapshotHash(snapshot: ProgramSnapshot): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">,
|
|
27
|
+
export declare function verifyProgramSnapshotHash(snapshot: ProgramSnapshot): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, never, never>;
|
|
42
28
|
/** Creates one authenticated current program record. */
|
|
43
29
|
export declare const makeProgramSnapshotRow: (row: {
|
|
44
30
|
readonly defaultCoverageStatus: "archived" | "available" | "hidden" | "partial" | "planned";
|
|
@@ -130,7 +116,7 @@ export declare const makeProgramSnapshotRow: (row: {
|
|
|
130
116
|
};
|
|
131
117
|
};
|
|
132
118
|
readonly rowHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
133
|
-
},
|
|
119
|
+
}, never, never>;
|
|
134
120
|
/** Creates one authenticated current curriculum record. */
|
|
135
121
|
export declare const makeCurriculumSnapshotRow: (row: {
|
|
136
122
|
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
@@ -182,7 +168,6 @@ export declare const makeCurriculumSnapshotRow: (row: {
|
|
|
182
168
|
readonly title: string;
|
|
183
169
|
};
|
|
184
170
|
readonly rowHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
185
|
-
},
|
|
171
|
+
}, never, never>;
|
|
186
172
|
/** Recomputes one current row identity for streamed integrity checks. */
|
|
187
|
-
export declare function verifyProgramSnapshotRowHash(record: ProgramSnapshotRow): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">,
|
|
188
|
-
export {};
|
|
173
|
+
export declare function verifyProgramSnapshotRowHash(record: ProgramSnapshotRow): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, never, never>;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { Effect
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { hashText } from "#contracts/hash/text";
|
|
3
3
|
import { CurriculumRouteRecordSchema, canonicalizeProgramSnapshotRow, LearningProgramRecordSchema, } from "#contracts/program/snapshot/row";
|
|
4
4
|
import { PROGRAM_SNAPSHOT_FORMAT, ProgramSnapshotSchema, } from "#contracts/program/snapshot/spec";
|
|
5
5
|
import { encodeJsonText } from "#contracts/text/json";
|
|
6
6
|
const SNAPSHOT_DOMAIN = "nakafa.aksara.localized-program-snapshot";
|
|
7
7
|
const ROW_DOMAIN = "nakafa.aksara.program-row";
|
|
8
|
-
/** Node could not compute a deterministic program snapshot identity. */
|
|
9
|
-
export class ProgramSnapshotHashError extends Schema.TaggedError()("ProgramSnapshotHashError", {}) {
|
|
10
|
-
}
|
|
11
|
-
/** Node could not compute one deterministic program row identity. */
|
|
12
|
-
export class ProgramRowHashError extends Schema.TaggedError()("ProgramRowHashError", { scope: Schema.Literals(["digest", "row"]) }) {
|
|
13
|
-
}
|
|
14
8
|
/** Serializes current program facts in stable signed field order. */
|
|
15
9
|
export function canonicalizeProgramSnapshot(input) {
|
|
16
10
|
return encodeJsonText({
|
|
@@ -26,7 +20,7 @@ export function canonicalizeProgramSnapshot(input) {
|
|
|
26
20
|
}
|
|
27
21
|
/** Creates the content-addressed identity of one complete program snapshot. */
|
|
28
22
|
export const makeProgramSnapshot = Effect.fn("AksaraContracts.makeProgramSnapshot")(function* (input) {
|
|
29
|
-
const snapshotId = yield* hashText(`${SNAPSHOT_DOMAIN}\n${canonicalizeProgramSnapshot(input)}`)
|
|
23
|
+
const snapshotId = yield* hashText(`${SNAPSHOT_DOMAIN}\n${canonicalizeProgramSnapshot(input)}`);
|
|
30
24
|
return ProgramSnapshotSchema.make({
|
|
31
25
|
...input,
|
|
32
26
|
format: PROGRAM_SNAPSHOT_FORMAT,
|
|
@@ -40,7 +34,7 @@ export function verifyProgramSnapshotHash(snapshot) {
|
|
|
40
34
|
}
|
|
41
35
|
/** Hashes one current program or curriculum row. */
|
|
42
36
|
function hashProgramRow(record) {
|
|
43
|
-
return hashText(`${ROW_DOMAIN}\n${canonicalizeProgramSnapshotRow(record)}`)
|
|
37
|
+
return hashText(`${ROW_DOMAIN}\n${canonicalizeProgramSnapshotRow(record)}`);
|
|
44
38
|
}
|
|
45
39
|
/** Creates one authenticated current program record. */
|
|
46
40
|
export const makeProgramSnapshotRow = Effect.fn("AksaraContracts.makeProgramSnapshotRow")(function* (row) {
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import { Effect,
|
|
2
|
-
import { ReleaseIdSchema } from "#contracts/ids";
|
|
1
|
+
import { Effect, Stream } from "effect";
|
|
3
2
|
import { type ContentProjection } from "#contracts/projection/spec";
|
|
4
|
-
declare const ProjectionHashError_base: Schema.Class<ProjectionHashError, Schema.TaggedStruct<"ProjectionHashError", {
|
|
5
|
-
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
6
|
-
}>, import("effect/Cause").YieldableError & {
|
|
7
|
-
readonly brand: unique symbol;
|
|
8
|
-
}>;
|
|
9
|
-
/** SHA-256 computation failed before projection integrity was established. */
|
|
10
|
-
export declare class ProjectionHashError extends ProjectionHashError_base {
|
|
11
|
-
}
|
|
12
3
|
/** Keeps the digest stream private while exposing only canonical counters. */
|
|
13
4
|
declare class ProjectionDigestState {
|
|
14
5
|
#private;
|
|
@@ -18,16 +9,16 @@ declare class ProjectionDigestState {
|
|
|
18
9
|
/** Adds one canonical projection to this invocation-owned digest. */
|
|
19
10
|
update(projection: ContentProjection): void;
|
|
20
11
|
/** Digests the complete stream once and returns its branded immutable identity. */
|
|
21
|
-
digest(): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">,
|
|
12
|
+
digest(): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, never, never>;
|
|
22
13
|
}
|
|
23
14
|
/** Creates a fresh domain-separated projection digest state. */
|
|
24
15
|
export declare const createProjectionDigest: Effect.Effect<ProjectionDigestState, never, never>;
|
|
25
16
|
/** Adds one canonical content projection to an incremental digest. */
|
|
26
17
|
export declare function updateProjectionDigest(state: ProjectionDigestState, projection: ContentProjection): Effect.Effect<ProjectionDigestState, never, never>;
|
|
27
|
-
/** Finalizes one projection digest
|
|
28
|
-
export declare function finalizeProjectionDigest(
|
|
29
|
-
/** Digests a projection stream. Its canonical bytes are held until one
|
|
30
|
-
export declare const digestProjections: <E, R>(
|
|
18
|
+
/** Finalizes one projection digest. */
|
|
19
|
+
export declare function finalizeProjectionDigest(state: ProjectionDigestState): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, never, never>;
|
|
20
|
+
/** Digests a projection stream. Its canonical bytes are held until one digest runs. */
|
|
21
|
+
export declare const digestProjections: <E, R>(projections: Stream.Stream<{
|
|
31
22
|
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
32
23
|
readonly articleRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
|
|
33
24
|
readonly articleSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleSlug">;
|
|
@@ -111,135 +102,8 @@ export declare const digestProjections: <E, R>(releaseId: string & import("effec
|
|
|
111
102
|
};
|
|
112
103
|
readonly sitemap: true;
|
|
113
104
|
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
105
|
}, E, R>) => Effect.Effect<{
|
|
242
106
|
count: number;
|
|
243
107
|
digest: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
244
|
-
}, E
|
|
108
|
+
}, E, R>;
|
|
245
109
|
export {};
|