@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
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
/** Semantic wire identity of the current localized try-out snapshot. */
|
|
3
|
-
export declare const TRYOUT_SNAPSHOT_FORMAT = "localized-tryout-snapshot";
|
|
4
|
-
/** Signed per-kind hierarchy counts for one immutable try-out snapshot. */
|
|
5
|
-
export declare const TryoutCatalogCountsSchema: Schema.Struct<{
|
|
6
|
-
readonly country: Schema.Int;
|
|
7
|
-
readonly exam: Schema.Int;
|
|
8
|
-
readonly section: Schema.Int;
|
|
9
|
-
readonly set: Schema.Int;
|
|
10
|
-
readonly track: Schema.Int;
|
|
11
|
-
}>;
|
|
12
|
-
export type TryoutCatalogCounts = typeof TryoutCatalogCountsSchema.Type;
|
|
13
|
-
/** Canonical snapshot facts authenticated by the global content release. */
|
|
14
|
-
export declare const TryoutSnapshotFactsSchema: Schema.Struct<{
|
|
15
|
-
activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
|
|
16
|
-
catalogDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
17
|
-
counts: Schema.Struct<{
|
|
18
|
-
readonly country: Schema.Int;
|
|
19
|
-
readonly exam: Schema.Int;
|
|
20
|
-
readonly section: Schema.Int;
|
|
21
|
-
readonly set: Schema.Int;
|
|
22
|
-
readonly track: Schema.Int;
|
|
23
|
-
}>;
|
|
24
|
-
placementCount: Schema.Int;
|
|
25
|
-
placementDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
26
|
-
routeCount: Schema.Int;
|
|
27
|
-
}>;
|
|
28
|
-
export type TryoutSnapshotFacts = typeof TryoutSnapshotFactsSchema.Type;
|
|
29
|
-
/** Content-addressed try-out snapshot selected by one global release. */
|
|
30
|
-
export declare const TryoutSnapshotSchema: Schema.Struct<{
|
|
31
|
-
readonly activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
|
|
32
|
-
readonly catalogDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
33
|
-
readonly counts: Schema.Struct<{
|
|
34
|
-
readonly country: Schema.Int;
|
|
35
|
-
readonly exam: Schema.Int;
|
|
36
|
-
readonly section: Schema.Int;
|
|
37
|
-
readonly set: Schema.Int;
|
|
38
|
-
readonly track: Schema.Int;
|
|
39
|
-
}>;
|
|
40
|
-
readonly placementCount: Schema.Int;
|
|
41
|
-
readonly placementDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
42
|
-
readonly routeCount: Schema.Int;
|
|
43
|
-
readonly format: Schema.Literal<"localized-tryout-snapshot">;
|
|
44
|
-
readonly snapshotId: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
45
|
-
}>;
|
|
46
|
-
export type TryoutSnapshot = typeof TryoutSnapshotSchema.Type;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { Sha256HashSchema } from "#contracts/ids";
|
|
3
|
-
import { ActiveAppLocaleListSchema } from "#contracts/locale";
|
|
4
|
-
/** Semantic wire identity of the current localized try-out snapshot. */
|
|
5
|
-
export const TRYOUT_SNAPSHOT_FORMAT = "localized-tryout-snapshot";
|
|
6
|
-
const NonNegativeCountSchema = Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0)));
|
|
7
|
-
/** Signed per-kind hierarchy counts for one immutable try-out snapshot. */
|
|
8
|
-
export const TryoutCatalogCountsSchema = Schema.Struct({
|
|
9
|
-
country: NonNegativeCountSchema,
|
|
10
|
-
exam: NonNegativeCountSchema,
|
|
11
|
-
section: NonNegativeCountSchema,
|
|
12
|
-
set: NonNegativeCountSchema,
|
|
13
|
-
track: NonNegativeCountSchema,
|
|
14
|
-
});
|
|
15
|
-
const TryoutSnapshotFactFields = {
|
|
16
|
-
activeAppLocales: ActiveAppLocaleListSchema,
|
|
17
|
-
catalogDigest: Sha256HashSchema,
|
|
18
|
-
counts: TryoutCatalogCountsSchema,
|
|
19
|
-
placementCount: NonNegativeCountSchema,
|
|
20
|
-
placementDigest: Sha256HashSchema,
|
|
21
|
-
routeCount: NonNegativeCountSchema,
|
|
22
|
-
};
|
|
23
|
-
/** Canonical snapshot facts authenticated by the global content release. */
|
|
24
|
-
export const TryoutSnapshotFactsSchema = Schema.Struct(TryoutSnapshotFactFields);
|
|
25
|
-
/** Content-addressed try-out snapshot selected by one global release. */
|
|
26
|
-
export const TryoutSnapshotSchema = Schema.Struct({
|
|
27
|
-
...TryoutSnapshotFactFields,
|
|
28
|
-
format: Schema.Literal(TRYOUT_SNAPSHOT_FORMAT),
|
|
29
|
-
snapshotId: Sha256HashSchema,
|
|
30
|
-
});
|
package/dist/tryout/spec.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
/**
|
|
3
|
-
* Scoring strategy declared by one authored exam and repeated on its sets.
|
|
4
|
-
* Every strategy reads a question's worth through `questionPoints`. `raw` sums
|
|
5
|
-
* the worth of correct answers and the points of reached rubric levels.
|
|
6
|
-
* `penalized` adds, for each question, its section's marks for a correct,
|
|
7
|
-
* wrong, or blank answer times the question's worth. `irt` estimates ability
|
|
8
|
-
* from correct and wrong outcomes. Rubric questions belong only to raw exams.
|
|
9
|
-
*/
|
|
10
|
-
export declare const TryoutScoringSchema: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
11
|
-
export type TryoutScoring = typeof TryoutScoringSchema.Type;
|
|
12
|
-
/**
|
|
13
|
-
* Whole marks one section of a penalized exam awards per point of a question
|
|
14
|
-
* for a correct, wrong, or blank answer, such as `+4`, `-1`, and `0`. A wrong
|
|
15
|
-
* answer costs marks, a blank never scores below a wrong answer, and a correct
|
|
16
|
-
* answer always scores above a blank.
|
|
17
|
-
*/
|
|
18
|
-
export declare const TryoutMarksSchema: Schema.Struct<{
|
|
19
|
-
readonly blank: Schema.Int;
|
|
20
|
-
readonly correct: Schema.Int;
|
|
21
|
-
readonly wrong: Schema.Int;
|
|
22
|
-
}>;
|
|
23
|
-
export type TryoutMarks = typeof TryoutMarksSchema.Type;
|
|
24
|
-
/** Returns section marks in stable field order for signed canonicalizers. */
|
|
25
|
-
export declare function canonicalTryoutMarks(marks: TryoutMarks): {
|
|
26
|
-
blank: number;
|
|
27
|
-
correct: number;
|
|
28
|
-
wrong: number;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Navigation role of one authored track: one exam `year`, one `subject`, or
|
|
32
|
-
* the sets of one `institution`, such as a Studienkolleg.
|
|
33
|
-
*/
|
|
34
|
-
export declare const TryoutTrackKindSchema: Schema.Literals<readonly ["institution", "subject", "year"]>;
|
|
35
|
-
/** Public route behavior of one authored section. */
|
|
36
|
-
export declare const TryoutVisibilitySchema: Schema.Literals<readonly ["internal-entry", "visible"]>;
|
|
37
|
-
/** Bounded authored revision shared by one try-out source hierarchy. */
|
|
38
|
-
export declare const TryoutSourceRevisionSchema: Schema.Trimmed;
|
|
39
|
-
/** Durable complete-question identity retained by every frozen placement. */
|
|
40
|
-
export declare const TryoutContentHashSchema: Schema.brand<Schema.String, "@NakafaAI/AksaraTryoutContentHash">;
|
|
41
|
-
export type TryoutContentHash = typeof TryoutContentHashSchema.Type;
|
package/dist/tryout/spec.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
const TRYOUT_CONTENT_HASH_PATTERN = /^[a-f\d]{64}$/u;
|
|
3
|
-
/**
|
|
4
|
-
* Scoring strategy declared by one authored exam and repeated on its sets.
|
|
5
|
-
* Every strategy reads a question's worth through `questionPoints`. `raw` sums
|
|
6
|
-
* the worth of correct answers and the points of reached rubric levels.
|
|
7
|
-
* `penalized` adds, for each question, its section's marks for a correct,
|
|
8
|
-
* wrong, or blank answer times the question's worth. `irt` estimates ability
|
|
9
|
-
* from correct and wrong outcomes. Rubric questions belong only to raw exams.
|
|
10
|
-
*/
|
|
11
|
-
export const TryoutScoringSchema = Schema.Literals(["irt", "penalized", "raw"]);
|
|
12
|
-
/**
|
|
13
|
-
* Whole marks one section of a penalized exam awards per point of a question
|
|
14
|
-
* for a correct, wrong, or blank answer, such as `+4`, `-1`, and `0`. A wrong
|
|
15
|
-
* answer costs marks, a blank never scores below a wrong answer, and a correct
|
|
16
|
-
* answer always scores above a blank.
|
|
17
|
-
*/
|
|
18
|
-
export const TryoutMarksSchema = Schema.Struct({
|
|
19
|
-
blank: Schema.Int,
|
|
20
|
-
correct: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
21
|
-
wrong: Schema.Int.check(Schema.isLessThan(0)),
|
|
22
|
-
}).check(Schema.makeFilter(({ blank, correct, wrong }) => wrong <= blank && blank < correct, {
|
|
23
|
-
message: "Expected wrong marks at or below blank marks, and blank marks below correct marks.",
|
|
24
|
-
}));
|
|
25
|
-
/** Returns section marks in stable field order for signed canonicalizers. */
|
|
26
|
-
export function canonicalTryoutMarks(marks) {
|
|
27
|
-
return { blank: marks.blank, correct: marks.correct, wrong: marks.wrong };
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Navigation role of one authored track: one exam `year`, one `subject`, or
|
|
31
|
-
* the sets of one `institution`, such as a Studienkolleg.
|
|
32
|
-
*/
|
|
33
|
-
export const TryoutTrackKindSchema = Schema.Literals([
|
|
34
|
-
"institution",
|
|
35
|
-
"subject",
|
|
36
|
-
"year",
|
|
37
|
-
]);
|
|
38
|
-
/** Public route behavior of one authored section. */
|
|
39
|
-
export const TryoutVisibilitySchema = Schema.Literals([
|
|
40
|
-
"internal-entry",
|
|
41
|
-
"visible",
|
|
42
|
-
]);
|
|
43
|
-
/** Bounded authored revision shared by one try-out source hierarchy. */
|
|
44
|
-
export const TryoutSourceRevisionSchema = Schema.Trimmed.check(Schema.isNonEmpty()).pipe(Schema.check(Schema.isMaxLength(128)));
|
|
45
|
-
/** Durable complete-question identity retained by every frozen placement. */
|
|
46
|
-
export const TryoutContentHashSchema = Schema.String.pipe(Schema.check(Schema.isPattern(TRYOUT_CONTENT_HASH_PATTERN)), Schema.brand("@NakafaAI/AksaraTryoutContentHash"));
|