@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
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { ReleaseIdSchema, Sha256HashSchema } from "#contracts/ids";
|
|
3
|
-
import { SignedTryoutRuntimeBundleSchema } from "#contracts/tryout/runtime/spec";
|
|
4
|
-
const OutcomeCountSchema = Schema.Literals([0, 1]);
|
|
5
|
-
const StageTryoutRuntimeBundleFields = {
|
|
6
|
-
bundle: SignedTryoutRuntimeBundleSchema,
|
|
7
|
-
releaseId: ReleaseIdSchema,
|
|
8
|
-
};
|
|
9
|
-
/** Requires a staged bundle to identify the release that created its source. */
|
|
10
|
-
function hasBoundSourceRelease(input) {
|
|
11
|
-
return input.bundle.payload.sourceReleaseId === input.releaseId;
|
|
12
|
-
}
|
|
13
|
-
/** Canonical input for staging one permanent signed runtime bundle. */
|
|
14
|
-
export const StageTryoutRuntimeBundleInputSchema = Schema.Struct(StageTryoutRuntimeBundleFields).pipe(Schema.check(Schema.makeFilter(hasBoundSourceRelease, {
|
|
15
|
-
message: "Expected the runtime bundle to share its source release.",
|
|
16
|
-
})));
|
|
17
|
-
/** Stages one permanent signed runtime bundle before release verification. */
|
|
18
|
-
export const StageTryoutRuntimeBundleRequestSchema = Schema.Struct({
|
|
19
|
-
...StageTryoutRuntimeBundleFields,
|
|
20
|
-
operation: Schema.Literal("stageTryoutRuntimeBundle"),
|
|
21
|
-
}).pipe(Schema.check(Schema.makeFilter(hasBoundSourceRelease, {
|
|
22
|
-
message: "Expected the runtime bundle to share its source release.",
|
|
23
|
-
})));
|
|
24
|
-
/** Idempotent outcome for one content-addressed runtime bundle. */
|
|
25
|
-
export const StageTryoutRuntimeBundleReceiptSchema = Schema.Struct({
|
|
26
|
-
bundleHash: Sha256HashSchema,
|
|
27
|
-
created: OutcomeCountSchema,
|
|
28
|
-
releaseId: ReleaseIdSchema,
|
|
29
|
-
snapshotId: Sha256HashSchema,
|
|
30
|
-
unchanged: OutcomeCountSchema,
|
|
31
|
-
}).pipe(Schema.check(Schema.makeFilter(({ created, unchanged }) => created + unchanged === 1, {
|
|
32
|
-
message: "Expected exactly one created or unchanged runtime bundle.",
|
|
33
|
-
})));
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Effect, Schema } from "effect";
|
|
2
|
-
declare const TryoutCanonicalHashError_base: Schema.Class<TryoutCanonicalHashError, Schema.TaggedStruct<"TryoutCanonicalHashError", {
|
|
3
|
-
readonly domain: Schema.String;
|
|
4
|
-
}>, import("effect/Cause").YieldableError & {
|
|
5
|
-
readonly brand: unique symbol;
|
|
6
|
-
}>;
|
|
7
|
-
/** Web Crypto could not hash one domain-separated try-out identity. */
|
|
8
|
-
export declare class TryoutCanonicalHashError extends TryoutCanonicalHashError_base {
|
|
9
|
-
}
|
|
10
|
-
/** Computes one domain-separated canonical try-out SHA-256 identity. */
|
|
11
|
-
export declare const hashTryoutCanonical: (domain: string, canonical: string) => Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, TryoutCanonicalHashError, never>;
|
|
12
|
-
export {};
|
package/dist/tryout/canonical.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Effect, Schema } from "effect";
|
|
2
|
-
import { hashText } from "#contracts/hash/text";
|
|
3
|
-
/** Web Crypto could not hash one domain-separated try-out identity. */
|
|
4
|
-
export class TryoutCanonicalHashError extends Schema.TaggedError()("TryoutCanonicalHashError", { domain: Schema.String }) {
|
|
5
|
-
}
|
|
6
|
-
/** Computes one domain-separated canonical try-out SHA-256 identity. */
|
|
7
|
-
export const hashTryoutCanonical = Effect.fn("AksaraContracts.hashTryoutCanonical")((domain, canonical) => hashText(`${domain}\n${canonical}`).pipe(Effect.mapError(() => new TryoutCanonicalHashError({ domain }))));
|
package/dist/tryout/catalog.d.ts
DELETED
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
/** Current semantic catalog key accepted before its signed row is loaded. */
|
|
3
|
-
export declare const TryoutCatalogNodeIdentitySchema: Schema.Union<readonly [Schema.Struct<{
|
|
4
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
5
|
-
readonly countryKey: Schema.String;
|
|
6
|
-
readonly kind: Schema.Literal<"country">;
|
|
7
|
-
}>, Schema.Struct<{
|
|
8
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
9
|
-
readonly countryKey: Schema.String;
|
|
10
|
-
readonly examKey: Schema.String;
|
|
11
|
-
readonly kind: Schema.Literal<"exam">;
|
|
12
|
-
}>, Schema.Struct<{
|
|
13
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
14
|
-
readonly countryKey: Schema.String;
|
|
15
|
-
readonly examKey: Schema.String;
|
|
16
|
-
readonly kind: Schema.Literal<"track">;
|
|
17
|
-
readonly trackKey: Schema.String;
|
|
18
|
-
}>, Schema.Struct<{
|
|
19
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
20
|
-
readonly countryKey: Schema.String;
|
|
21
|
-
readonly examKey: Schema.String;
|
|
22
|
-
readonly kind: Schema.Literal<"set">;
|
|
23
|
-
readonly setKey: Schema.String;
|
|
24
|
-
readonly trackKey: Schema.String;
|
|
25
|
-
}>, Schema.Struct<{
|
|
26
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
27
|
-
readonly countryKey: Schema.String;
|
|
28
|
-
readonly examKey: Schema.String;
|
|
29
|
-
readonly kind: Schema.Literal<"section">;
|
|
30
|
-
readonly sectionKey: Schema.String;
|
|
31
|
-
readonly setKey: Schema.String;
|
|
32
|
-
readonly trackKey: Schema.String;
|
|
33
|
-
}>]>;
|
|
34
|
-
export type TryoutCatalogNodeIdentity = typeof TryoutCatalogNodeIdentitySchema.Type;
|
|
35
|
-
/** One localized country row. */
|
|
36
|
-
export declare const TryoutCountrySchema: Schema.Struct<{
|
|
37
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
38
|
-
readonly description: Schema.optional<Schema.String>;
|
|
39
|
-
readonly graph: Schema.Struct<{
|
|
40
|
-
readonly alignmentId: Schema.String;
|
|
41
|
-
readonly assetId: Schema.String;
|
|
42
|
-
readonly conceptId: Schema.String;
|
|
43
|
-
readonly learningObjectId: Schema.String;
|
|
44
|
-
readonly lensId: Schema.String;
|
|
45
|
-
}>;
|
|
46
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
47
|
-
readonly title: Schema.String;
|
|
48
|
-
readonly countryCode: Schema.String;
|
|
49
|
-
readonly countryKey: Schema.String;
|
|
50
|
-
readonly kind: Schema.Literal<"country">;
|
|
51
|
-
readonly order: Schema.Finite;
|
|
52
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
53
|
-
}>;
|
|
54
|
-
export type TryoutCountry = typeof TryoutCountrySchema.Type;
|
|
55
|
-
/** One localized exam row. */
|
|
56
|
-
export declare const TryoutExamSchema: Schema.Struct<{
|
|
57
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
58
|
-
readonly description: Schema.optional<Schema.String>;
|
|
59
|
-
readonly graph: Schema.Struct<{
|
|
60
|
-
readonly alignmentId: Schema.String;
|
|
61
|
-
readonly assetId: Schema.String;
|
|
62
|
-
readonly conceptId: Schema.String;
|
|
63
|
-
readonly learningObjectId: Schema.String;
|
|
64
|
-
readonly lensId: Schema.String;
|
|
65
|
-
}>;
|
|
66
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
67
|
-
readonly title: Schema.String;
|
|
68
|
-
readonly countryKey: Schema.String;
|
|
69
|
-
readonly examKey: Schema.String;
|
|
70
|
-
readonly kind: Schema.Literal<"exam">;
|
|
71
|
-
readonly order: Schema.Finite;
|
|
72
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
73
|
-
readonly scoringStrategy: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
74
|
-
}>;
|
|
75
|
-
export type TryoutExam = typeof TryoutExamSchema.Type;
|
|
76
|
-
/** One localized track row with exact inventory counts. */
|
|
77
|
-
export declare const TryoutTrackSchema: Schema.Struct<{
|
|
78
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
79
|
-
readonly description: Schema.optional<Schema.String>;
|
|
80
|
-
readonly graph: Schema.Struct<{
|
|
81
|
-
readonly alignmentId: Schema.String;
|
|
82
|
-
readonly assetId: Schema.String;
|
|
83
|
-
readonly conceptId: Schema.String;
|
|
84
|
-
readonly learningObjectId: Schema.String;
|
|
85
|
-
readonly lensId: Schema.String;
|
|
86
|
-
}>;
|
|
87
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
88
|
-
readonly title: Schema.String;
|
|
89
|
-
readonly countryKey: Schema.String;
|
|
90
|
-
readonly examKey: Schema.String;
|
|
91
|
-
readonly kind: Schema.Literal<"track">;
|
|
92
|
-
readonly order: Schema.Finite;
|
|
93
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
94
|
-
readonly questionCount: Schema.Finite;
|
|
95
|
-
readonly sectionCount: Schema.Finite;
|
|
96
|
-
readonly setCount: Schema.Finite;
|
|
97
|
-
readonly trackKey: Schema.String;
|
|
98
|
-
readonly trackKind: Schema.Literals<readonly ["institution", "subject", "year"]>;
|
|
99
|
-
readonly visibleSectionCount: Schema.Finite;
|
|
100
|
-
}>;
|
|
101
|
-
export type TryoutTrack = typeof TryoutTrackSchema.Type;
|
|
102
|
-
/** One localized set row with exact inventory counts. */
|
|
103
|
-
export declare const TryoutSetSchema: Schema.Struct<{
|
|
104
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
105
|
-
readonly description: Schema.optional<Schema.String>;
|
|
106
|
-
readonly graph: Schema.Struct<{
|
|
107
|
-
readonly alignmentId: Schema.String;
|
|
108
|
-
readonly assetId: Schema.String;
|
|
109
|
-
readonly conceptId: Schema.String;
|
|
110
|
-
readonly learningObjectId: Schema.String;
|
|
111
|
-
readonly lensId: Schema.String;
|
|
112
|
-
}>;
|
|
113
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
114
|
-
readonly title: Schema.String;
|
|
115
|
-
readonly countryKey: Schema.String;
|
|
116
|
-
readonly examKey: Schema.String;
|
|
117
|
-
readonly internalEntrySectionKey: Schema.optional<Schema.String>;
|
|
118
|
-
readonly kind: Schema.Literal<"set">;
|
|
119
|
-
readonly order: Schema.Finite;
|
|
120
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
121
|
-
readonly questionCount: Schema.Finite;
|
|
122
|
-
readonly scoringStrategy: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
123
|
-
readonly sectionCount: Schema.Finite;
|
|
124
|
-
readonly setKey: Schema.String;
|
|
125
|
-
readonly trackKey: Schema.String;
|
|
126
|
-
readonly visibleSectionCount: Schema.Finite;
|
|
127
|
-
}>;
|
|
128
|
-
export type TryoutSet = typeof TryoutSetSchema.Type;
|
|
129
|
-
/**
|
|
130
|
-
* One localized section row with source ownership. A section of a penalized
|
|
131
|
-
* set carries the marks that score its questions; no other section has marks.
|
|
132
|
-
*/
|
|
133
|
-
export declare const TryoutSectionSchema: Schema.Struct<{
|
|
134
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
135
|
-
readonly description: Schema.optional<Schema.String>;
|
|
136
|
-
readonly graph: Schema.Struct<{
|
|
137
|
-
readonly alignmentId: Schema.String;
|
|
138
|
-
readonly assetId: Schema.String;
|
|
139
|
-
readonly conceptId: Schema.String;
|
|
140
|
-
readonly learningObjectId: Schema.String;
|
|
141
|
-
readonly lensId: Schema.String;
|
|
142
|
-
}>;
|
|
143
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
144
|
-
readonly title: Schema.String;
|
|
145
|
-
readonly countryKey: Schema.String;
|
|
146
|
-
readonly examKey: Schema.String;
|
|
147
|
-
readonly kind: Schema.Literal<"section">;
|
|
148
|
-
readonly marks: Schema.optionalKey<Schema.Struct<{
|
|
149
|
-
readonly blank: Schema.Int;
|
|
150
|
-
readonly correct: Schema.Int;
|
|
151
|
-
readonly wrong: Schema.Int;
|
|
152
|
-
}>>;
|
|
153
|
-
readonly order: Schema.Finite;
|
|
154
|
-
readonly publicPath: Schema.optional<Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">>;
|
|
155
|
-
readonly questionCount: Schema.Finite;
|
|
156
|
-
readonly questionSourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
157
|
-
readonly sectionKey: Schema.String;
|
|
158
|
-
readonly setKey: Schema.String;
|
|
159
|
-
readonly timeLimitSeconds: Schema.Finite;
|
|
160
|
-
readonly trackKey: Schema.String;
|
|
161
|
-
readonly visibility: Schema.Literals<readonly ["internal-entry", "visible"]>;
|
|
162
|
-
}>;
|
|
163
|
-
export type TryoutSection = typeof TryoutSectionSchema.Type;
|
|
164
|
-
/** Counts every question owned by one ordered list of try-out sections. */
|
|
165
|
-
export declare function countSectionQuestions(sections: readonly Pick<TryoutSection, "questionCount">[]): number;
|
|
166
|
-
/** Complete hierarchy vocabulary for try-out publication. */
|
|
167
|
-
export declare const TryoutCatalogRowSchema: Schema.Union<readonly [Schema.Struct<{
|
|
168
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
169
|
-
readonly description: Schema.optional<Schema.String>;
|
|
170
|
-
readonly graph: Schema.Struct<{
|
|
171
|
-
readonly alignmentId: Schema.String;
|
|
172
|
-
readonly assetId: Schema.String;
|
|
173
|
-
readonly conceptId: Schema.String;
|
|
174
|
-
readonly learningObjectId: Schema.String;
|
|
175
|
-
readonly lensId: Schema.String;
|
|
176
|
-
}>;
|
|
177
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
178
|
-
readonly title: Schema.String;
|
|
179
|
-
readonly countryCode: Schema.String;
|
|
180
|
-
readonly countryKey: Schema.String;
|
|
181
|
-
readonly kind: Schema.Literal<"country">;
|
|
182
|
-
readonly order: Schema.Finite;
|
|
183
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
184
|
-
}>, Schema.Struct<{
|
|
185
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
186
|
-
readonly description: Schema.optional<Schema.String>;
|
|
187
|
-
readonly graph: Schema.Struct<{
|
|
188
|
-
readonly alignmentId: Schema.String;
|
|
189
|
-
readonly assetId: Schema.String;
|
|
190
|
-
readonly conceptId: Schema.String;
|
|
191
|
-
readonly learningObjectId: Schema.String;
|
|
192
|
-
readonly lensId: Schema.String;
|
|
193
|
-
}>;
|
|
194
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
195
|
-
readonly title: Schema.String;
|
|
196
|
-
readonly countryKey: Schema.String;
|
|
197
|
-
readonly examKey: Schema.String;
|
|
198
|
-
readonly kind: Schema.Literal<"exam">;
|
|
199
|
-
readonly order: Schema.Finite;
|
|
200
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
201
|
-
readonly scoringStrategy: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
202
|
-
}>, Schema.Struct<{
|
|
203
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
204
|
-
readonly description: Schema.optional<Schema.String>;
|
|
205
|
-
readonly graph: Schema.Struct<{
|
|
206
|
-
readonly alignmentId: Schema.String;
|
|
207
|
-
readonly assetId: Schema.String;
|
|
208
|
-
readonly conceptId: Schema.String;
|
|
209
|
-
readonly learningObjectId: Schema.String;
|
|
210
|
-
readonly lensId: Schema.String;
|
|
211
|
-
}>;
|
|
212
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
213
|
-
readonly title: Schema.String;
|
|
214
|
-
readonly countryKey: Schema.String;
|
|
215
|
-
readonly examKey: Schema.String;
|
|
216
|
-
readonly kind: Schema.Literal<"track">;
|
|
217
|
-
readonly order: Schema.Finite;
|
|
218
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
219
|
-
readonly questionCount: Schema.Finite;
|
|
220
|
-
readonly sectionCount: Schema.Finite;
|
|
221
|
-
readonly setCount: Schema.Finite;
|
|
222
|
-
readonly trackKey: Schema.String;
|
|
223
|
-
readonly trackKind: Schema.Literals<readonly ["institution", "subject", "year"]>;
|
|
224
|
-
readonly visibleSectionCount: Schema.Finite;
|
|
225
|
-
}>, Schema.Struct<{
|
|
226
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
227
|
-
readonly description: Schema.optional<Schema.String>;
|
|
228
|
-
readonly graph: Schema.Struct<{
|
|
229
|
-
readonly alignmentId: Schema.String;
|
|
230
|
-
readonly assetId: Schema.String;
|
|
231
|
-
readonly conceptId: Schema.String;
|
|
232
|
-
readonly learningObjectId: Schema.String;
|
|
233
|
-
readonly lensId: Schema.String;
|
|
234
|
-
}>;
|
|
235
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
236
|
-
readonly title: Schema.String;
|
|
237
|
-
readonly countryKey: Schema.String;
|
|
238
|
-
readonly examKey: Schema.String;
|
|
239
|
-
readonly internalEntrySectionKey: Schema.optional<Schema.String>;
|
|
240
|
-
readonly kind: Schema.Literal<"set">;
|
|
241
|
-
readonly order: Schema.Finite;
|
|
242
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
243
|
-
readonly questionCount: Schema.Finite;
|
|
244
|
-
readonly scoringStrategy: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
245
|
-
readonly sectionCount: Schema.Finite;
|
|
246
|
-
readonly setKey: Schema.String;
|
|
247
|
-
readonly trackKey: Schema.String;
|
|
248
|
-
readonly visibleSectionCount: Schema.Finite;
|
|
249
|
-
}>, Schema.Struct<{
|
|
250
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
251
|
-
readonly description: Schema.optional<Schema.String>;
|
|
252
|
-
readonly graph: Schema.Struct<{
|
|
253
|
-
readonly alignmentId: Schema.String;
|
|
254
|
-
readonly assetId: Schema.String;
|
|
255
|
-
readonly conceptId: Schema.String;
|
|
256
|
-
readonly learningObjectId: Schema.String;
|
|
257
|
-
readonly lensId: Schema.String;
|
|
258
|
-
}>;
|
|
259
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
260
|
-
readonly title: Schema.String;
|
|
261
|
-
readonly countryKey: Schema.String;
|
|
262
|
-
readonly examKey: Schema.String;
|
|
263
|
-
readonly kind: Schema.Literal<"section">;
|
|
264
|
-
readonly marks: Schema.optionalKey<Schema.Struct<{
|
|
265
|
-
readonly blank: Schema.Int;
|
|
266
|
-
readonly correct: Schema.Int;
|
|
267
|
-
readonly wrong: Schema.Int;
|
|
268
|
-
}>>;
|
|
269
|
-
readonly order: Schema.Finite;
|
|
270
|
-
readonly publicPath: Schema.optional<Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">>;
|
|
271
|
-
readonly questionCount: Schema.Finite;
|
|
272
|
-
readonly questionSourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
273
|
-
readonly sectionKey: Schema.String;
|
|
274
|
-
readonly setKey: Schema.String;
|
|
275
|
-
readonly timeLimitSeconds: Schema.Finite;
|
|
276
|
-
readonly trackKey: Schema.String;
|
|
277
|
-
readonly visibility: Schema.Literals<readonly ["internal-entry", "visible"]>;
|
|
278
|
-
}>]>;
|
|
279
|
-
export type TryoutCatalogRow = typeof TryoutCatalogRowSchema.Type;
|
|
280
|
-
/** One hierarchy row bound to its deterministic hash. */
|
|
281
|
-
export declare const TryoutCatalogRecordSchema: Schema.Struct<{
|
|
282
|
-
readonly row: Schema.Union<readonly [Schema.Struct<{
|
|
283
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
284
|
-
readonly description: Schema.optional<Schema.String>;
|
|
285
|
-
readonly graph: Schema.Struct<{
|
|
286
|
-
readonly alignmentId: Schema.String;
|
|
287
|
-
readonly assetId: Schema.String;
|
|
288
|
-
readonly conceptId: Schema.String;
|
|
289
|
-
readonly learningObjectId: Schema.String;
|
|
290
|
-
readonly lensId: Schema.String;
|
|
291
|
-
}>;
|
|
292
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
293
|
-
readonly title: Schema.String;
|
|
294
|
-
readonly countryCode: Schema.String;
|
|
295
|
-
readonly countryKey: Schema.String;
|
|
296
|
-
readonly kind: Schema.Literal<"country">;
|
|
297
|
-
readonly order: Schema.Finite;
|
|
298
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
299
|
-
}>, Schema.Struct<{
|
|
300
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
301
|
-
readonly description: Schema.optional<Schema.String>;
|
|
302
|
-
readonly graph: Schema.Struct<{
|
|
303
|
-
readonly alignmentId: Schema.String;
|
|
304
|
-
readonly assetId: Schema.String;
|
|
305
|
-
readonly conceptId: Schema.String;
|
|
306
|
-
readonly learningObjectId: Schema.String;
|
|
307
|
-
readonly lensId: Schema.String;
|
|
308
|
-
}>;
|
|
309
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
310
|
-
readonly title: Schema.String;
|
|
311
|
-
readonly countryKey: Schema.String;
|
|
312
|
-
readonly examKey: Schema.String;
|
|
313
|
-
readonly kind: Schema.Literal<"exam">;
|
|
314
|
-
readonly order: Schema.Finite;
|
|
315
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
316
|
-
readonly scoringStrategy: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
317
|
-
}>, Schema.Struct<{
|
|
318
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
319
|
-
readonly description: Schema.optional<Schema.String>;
|
|
320
|
-
readonly graph: Schema.Struct<{
|
|
321
|
-
readonly alignmentId: Schema.String;
|
|
322
|
-
readonly assetId: Schema.String;
|
|
323
|
-
readonly conceptId: Schema.String;
|
|
324
|
-
readonly learningObjectId: Schema.String;
|
|
325
|
-
readonly lensId: Schema.String;
|
|
326
|
-
}>;
|
|
327
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
328
|
-
readonly title: Schema.String;
|
|
329
|
-
readonly countryKey: Schema.String;
|
|
330
|
-
readonly examKey: Schema.String;
|
|
331
|
-
readonly kind: Schema.Literal<"track">;
|
|
332
|
-
readonly order: Schema.Finite;
|
|
333
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
334
|
-
readonly questionCount: Schema.Finite;
|
|
335
|
-
readonly sectionCount: Schema.Finite;
|
|
336
|
-
readonly setCount: Schema.Finite;
|
|
337
|
-
readonly trackKey: Schema.String;
|
|
338
|
-
readonly trackKind: Schema.Literals<readonly ["institution", "subject", "year"]>;
|
|
339
|
-
readonly visibleSectionCount: Schema.Finite;
|
|
340
|
-
}>, Schema.Struct<{
|
|
341
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
342
|
-
readonly description: Schema.optional<Schema.String>;
|
|
343
|
-
readonly graph: Schema.Struct<{
|
|
344
|
-
readonly alignmentId: Schema.String;
|
|
345
|
-
readonly assetId: Schema.String;
|
|
346
|
-
readonly conceptId: Schema.String;
|
|
347
|
-
readonly learningObjectId: Schema.String;
|
|
348
|
-
readonly lensId: Schema.String;
|
|
349
|
-
}>;
|
|
350
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
351
|
-
readonly title: Schema.String;
|
|
352
|
-
readonly countryKey: Schema.String;
|
|
353
|
-
readonly examKey: Schema.String;
|
|
354
|
-
readonly internalEntrySectionKey: Schema.optional<Schema.String>;
|
|
355
|
-
readonly kind: Schema.Literal<"set">;
|
|
356
|
-
readonly order: Schema.Finite;
|
|
357
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
358
|
-
readonly questionCount: Schema.Finite;
|
|
359
|
-
readonly scoringStrategy: Schema.Literals<readonly ["irt", "penalized", "raw"]>;
|
|
360
|
-
readonly sectionCount: Schema.Finite;
|
|
361
|
-
readonly setKey: Schema.String;
|
|
362
|
-
readonly trackKey: Schema.String;
|
|
363
|
-
readonly visibleSectionCount: Schema.Finite;
|
|
364
|
-
}>, Schema.Struct<{
|
|
365
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
366
|
-
readonly description: Schema.optional<Schema.String>;
|
|
367
|
-
readonly graph: Schema.Struct<{
|
|
368
|
-
readonly alignmentId: Schema.String;
|
|
369
|
-
readonly assetId: Schema.String;
|
|
370
|
-
readonly conceptId: Schema.String;
|
|
371
|
-
readonly learningObjectId: Schema.String;
|
|
372
|
-
readonly lensId: Schema.String;
|
|
373
|
-
}>;
|
|
374
|
-
readonly sourceRevision: Schema.Trimmed;
|
|
375
|
-
readonly title: Schema.String;
|
|
376
|
-
readonly countryKey: Schema.String;
|
|
377
|
-
readonly examKey: Schema.String;
|
|
378
|
-
readonly kind: Schema.Literal<"section">;
|
|
379
|
-
readonly marks: Schema.optionalKey<Schema.Struct<{
|
|
380
|
-
readonly blank: Schema.Int;
|
|
381
|
-
readonly correct: Schema.Int;
|
|
382
|
-
readonly wrong: Schema.Int;
|
|
383
|
-
}>>;
|
|
384
|
-
readonly order: Schema.Finite;
|
|
385
|
-
readonly publicPath: Schema.optional<Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">>;
|
|
386
|
-
readonly questionCount: Schema.Finite;
|
|
387
|
-
readonly questionSourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
388
|
-
readonly sectionKey: Schema.String;
|
|
389
|
-
readonly setKey: Schema.String;
|
|
390
|
-
readonly timeLimitSeconds: Schema.Finite;
|
|
391
|
-
readonly trackKey: Schema.String;
|
|
392
|
-
readonly visibility: Schema.Literals<readonly ["internal-entry", "visible"]>;
|
|
393
|
-
}>]>;
|
|
394
|
-
readonly rowHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
395
|
-
}>;
|
|
396
|
-
export type TryoutCatalogRecord = typeof TryoutCatalogRecordSchema.Type;
|
package/dist/tryout/catalog.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { Array as Arr, Schema } from "effect";
|
|
2
|
-
import { CountryCodeSchema } from "#contracts/country";
|
|
3
|
-
import { LearningGraphIdentitySchema } from "#contracts/graph/spec";
|
|
4
|
-
import { CorpusSourcePathSchema, PublicPathSchema, Sha256HashSchema, } from "#contracts/ids";
|
|
5
|
-
import { AppLocaleSchema } from "#contracts/locale";
|
|
6
|
-
import { TryoutKeySchema } from "#contracts/tryout/key";
|
|
7
|
-
import { TryoutMarksSchema, TryoutScoringSchema, TryoutSourceRevisionSchema, TryoutTrackKindSchema, TryoutVisibilitySchema, } from "#contracts/tryout/spec";
|
|
8
|
-
const PositiveCountSchema = Schema.Finite.pipe(Schema.check(Schema.isInt()), Schema.check(Schema.isGreaterThan(0)));
|
|
9
|
-
const NonNegativeCountSchema = Schema.Finite.pipe(Schema.check(Schema.isInt()), Schema.check(Schema.isGreaterThanOrEqualTo(0)));
|
|
10
|
-
const LocalizedFields = {
|
|
11
|
-
appLocale: AppLocaleSchema,
|
|
12
|
-
description: Schema.optional(Schema.String),
|
|
13
|
-
graph: LearningGraphIdentitySchema,
|
|
14
|
-
sourceRevision: TryoutSourceRevisionSchema,
|
|
15
|
-
title: Schema.String,
|
|
16
|
-
};
|
|
17
|
-
const ParentFields = {
|
|
18
|
-
countryKey: TryoutKeySchema,
|
|
19
|
-
examKey: TryoutKeySchema,
|
|
20
|
-
};
|
|
21
|
-
const CatalogNodeFields = {
|
|
22
|
-
appLocale: AppLocaleSchema,
|
|
23
|
-
countryKey: TryoutKeySchema,
|
|
24
|
-
};
|
|
25
|
-
/** Minimal country identity used to retrieve its complete signed row. */
|
|
26
|
-
const TryoutCountryIdentitySchema = Schema.Struct({
|
|
27
|
-
...CatalogNodeFields,
|
|
28
|
-
kind: Schema.Literal("country"),
|
|
29
|
-
});
|
|
30
|
-
/** Minimal exam identity used to retrieve its complete signed row. */
|
|
31
|
-
const TryoutExamIdentitySchema = Schema.Struct({
|
|
32
|
-
...CatalogNodeFields,
|
|
33
|
-
examKey: TryoutKeySchema,
|
|
34
|
-
kind: Schema.Literal("exam"),
|
|
35
|
-
});
|
|
36
|
-
/** Minimal track identity used to retrieve its complete signed row. */
|
|
37
|
-
const TryoutTrackIdentitySchema = Schema.Struct({
|
|
38
|
-
...CatalogNodeFields,
|
|
39
|
-
examKey: TryoutKeySchema,
|
|
40
|
-
kind: Schema.Literal("track"),
|
|
41
|
-
trackKey: TryoutKeySchema,
|
|
42
|
-
});
|
|
43
|
-
/** Minimal set identity used to retrieve its complete signed row. */
|
|
44
|
-
const TryoutSetIdentitySchema = Schema.Struct({
|
|
45
|
-
...CatalogNodeFields,
|
|
46
|
-
examKey: TryoutKeySchema,
|
|
47
|
-
kind: Schema.Literal("set"),
|
|
48
|
-
setKey: TryoutKeySchema,
|
|
49
|
-
trackKey: TryoutKeySchema,
|
|
50
|
-
});
|
|
51
|
-
/** Minimal section identity used to retrieve its complete signed row. */
|
|
52
|
-
const TryoutSectionIdentitySchema = Schema.Struct({
|
|
53
|
-
...CatalogNodeFields,
|
|
54
|
-
examKey: TryoutKeySchema,
|
|
55
|
-
kind: Schema.Literal("section"),
|
|
56
|
-
sectionKey: TryoutKeySchema,
|
|
57
|
-
setKey: TryoutKeySchema,
|
|
58
|
-
trackKey: TryoutKeySchema,
|
|
59
|
-
});
|
|
60
|
-
/** Current semantic catalog key accepted before its signed row is loaded. */
|
|
61
|
-
export const TryoutCatalogNodeIdentitySchema = Schema.Union([
|
|
62
|
-
TryoutCountryIdentitySchema,
|
|
63
|
-
TryoutExamIdentitySchema,
|
|
64
|
-
TryoutTrackIdentitySchema,
|
|
65
|
-
TryoutSetIdentitySchema,
|
|
66
|
-
TryoutSectionIdentitySchema,
|
|
67
|
-
]);
|
|
68
|
-
/** One localized country row. */
|
|
69
|
-
export const TryoutCountrySchema = Schema.Struct({
|
|
70
|
-
...LocalizedFields,
|
|
71
|
-
countryCode: CountryCodeSchema,
|
|
72
|
-
countryKey: TryoutKeySchema,
|
|
73
|
-
kind: Schema.Literal("country"),
|
|
74
|
-
order: PositiveCountSchema,
|
|
75
|
-
publicPath: PublicPathSchema,
|
|
76
|
-
});
|
|
77
|
-
/** One localized exam row. */
|
|
78
|
-
export const TryoutExamSchema = Schema.Struct({
|
|
79
|
-
...LocalizedFields,
|
|
80
|
-
countryKey: TryoutKeySchema,
|
|
81
|
-
examKey: TryoutKeySchema,
|
|
82
|
-
kind: Schema.Literal("exam"),
|
|
83
|
-
order: PositiveCountSchema,
|
|
84
|
-
publicPath: PublicPathSchema,
|
|
85
|
-
scoringStrategy: TryoutScoringSchema,
|
|
86
|
-
});
|
|
87
|
-
/** One localized track row with exact inventory counts. */
|
|
88
|
-
export const TryoutTrackSchema = Schema.Struct({
|
|
89
|
-
...LocalizedFields,
|
|
90
|
-
...ParentFields,
|
|
91
|
-
kind: Schema.Literal("track"),
|
|
92
|
-
order: PositiveCountSchema,
|
|
93
|
-
publicPath: PublicPathSchema,
|
|
94
|
-
questionCount: PositiveCountSchema,
|
|
95
|
-
sectionCount: PositiveCountSchema,
|
|
96
|
-
setCount: PositiveCountSchema,
|
|
97
|
-
trackKey: TryoutKeySchema,
|
|
98
|
-
trackKind: TryoutTrackKindSchema,
|
|
99
|
-
visibleSectionCount: NonNegativeCountSchema,
|
|
100
|
-
}).pipe(Schema.check(Schema.makeFilter(({ sectionCount, visibleSectionCount }) => visibleSectionCount <= sectionCount, { message: "Visible track sections cannot exceed all sections." })));
|
|
101
|
-
/** One localized set row with exact inventory counts. */
|
|
102
|
-
export const TryoutSetSchema = Schema.Struct({
|
|
103
|
-
...LocalizedFields,
|
|
104
|
-
...ParentFields,
|
|
105
|
-
internalEntrySectionKey: Schema.optional(TryoutKeySchema),
|
|
106
|
-
kind: Schema.Literal("set"),
|
|
107
|
-
order: PositiveCountSchema,
|
|
108
|
-
publicPath: PublicPathSchema,
|
|
109
|
-
questionCount: PositiveCountSchema,
|
|
110
|
-
scoringStrategy: TryoutScoringSchema,
|
|
111
|
-
sectionCount: PositiveCountSchema,
|
|
112
|
-
setKey: TryoutKeySchema,
|
|
113
|
-
trackKey: TryoutKeySchema,
|
|
114
|
-
visibleSectionCount: NonNegativeCountSchema,
|
|
115
|
-
}).pipe(Schema.check(Schema.makeFilter(({ internalEntrySectionKey, sectionCount, visibleSectionCount }) => internalEntrySectionKey === undefined
|
|
116
|
-
? visibleSectionCount === sectionCount
|
|
117
|
-
: sectionCount === 1 && visibleSectionCount === 0, { message: "Set section counts do not match their visibility." })));
|
|
118
|
-
/**
|
|
119
|
-
* One localized section row with source ownership. A section of a penalized
|
|
120
|
-
* set carries the marks that score its questions; no other section has marks.
|
|
121
|
-
*/
|
|
122
|
-
export const TryoutSectionSchema = Schema.Struct({
|
|
123
|
-
...LocalizedFields,
|
|
124
|
-
...ParentFields,
|
|
125
|
-
kind: Schema.Literal("section"),
|
|
126
|
-
marks: Schema.optionalKey(TryoutMarksSchema),
|
|
127
|
-
order: PositiveCountSchema,
|
|
128
|
-
publicPath: Schema.optional(PublicPathSchema),
|
|
129
|
-
questionCount: PositiveCountSchema,
|
|
130
|
-
questionSourcePath: CorpusSourcePathSchema,
|
|
131
|
-
sectionKey: TryoutKeySchema,
|
|
132
|
-
setKey: TryoutKeySchema,
|
|
133
|
-
timeLimitSeconds: PositiveCountSchema,
|
|
134
|
-
trackKey: TryoutKeySchema,
|
|
135
|
-
visibility: TryoutVisibilitySchema,
|
|
136
|
-
}).pipe(Schema.check(Schema.makeFilter(({ publicPath, visibility }) => visibility === "visible"
|
|
137
|
-
? publicPath !== undefined
|
|
138
|
-
: publicPath === undefined, { message: "Section visibility does not match its public path." })));
|
|
139
|
-
/** Counts every question owned by one ordered list of try-out sections. */
|
|
140
|
-
export function countSectionQuestions(sections) {
|
|
141
|
-
return Arr.reduce(sections, 0, (total, section) => total + section.questionCount);
|
|
142
|
-
}
|
|
143
|
-
/** Complete hierarchy vocabulary for try-out publication. */
|
|
144
|
-
export const TryoutCatalogRowSchema = Schema.Union([
|
|
145
|
-
TryoutCountrySchema,
|
|
146
|
-
TryoutExamSchema,
|
|
147
|
-
TryoutTrackSchema,
|
|
148
|
-
TryoutSetSchema,
|
|
149
|
-
TryoutSectionSchema,
|
|
150
|
-
]);
|
|
151
|
-
/** One hierarchy row bound to its deterministic hash. */
|
|
152
|
-
export const TryoutCatalogRecordSchema = Schema.Struct({
|
|
153
|
-
row: TryoutCatalogRowSchema,
|
|
154
|
-
rowHash: Sha256HashSchema,
|
|
155
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Effect, MutableHashMap, MutableHashSet, Schema } from "effect";
|
|
2
|
-
import type { ActiveAppLocaleList, AppLocale } from "#contracts/locale";
|
|
3
|
-
/** The app locales seen for each logical row identity. */
|
|
4
|
-
type LocalesByIdentity = MutableHashMap.MutableHashMap<string, MutableHashSet.MutableHashSet<AppLocale>>;
|
|
5
|
-
declare const TryoutClosureError_base: Schema.Class<TryoutClosureError, Schema.TaggedStruct<"TryoutClosureError", {
|
|
6
|
-
readonly actual: Schema.String;
|
|
7
|
-
readonly code: Schema.Literals<readonly ["assessed-language", "duplicate-locale", "fact-mismatch", "inactive-locale", "missing-locale", "missing-section", "question-count"]>;
|
|
8
|
-
readonly expected: Schema.String;
|
|
9
|
-
readonly identity: Schema.String;
|
|
10
|
-
}>, import("effect/Cause").YieldableError & {
|
|
11
|
-
readonly brand: unique symbol;
|
|
12
|
-
}>;
|
|
13
|
-
/** A try-out snapshot is incomplete or inconsistent across app locales. */
|
|
14
|
-
export declare class TryoutClosureError extends TryoutClosureError_base {
|
|
15
|
-
}
|
|
16
|
-
/** Adds one active locale to a logical identity without duplicates. */
|
|
17
|
-
export declare function addLocale(localesByIdentity: LocalesByIdentity, activeAppLocales: ActiveAppLocaleList, identity: string, appLocale: AppLocale): Effect.Effect<void, never, never> | Effect.Effect<never, TryoutClosureError, never>;
|
|
18
|
-
/** Confirms every logical row closes over the exact active locale list. */
|
|
19
|
-
export declare function validateLocales(localesByIdentity: LocalesByIdentity, activeAppLocales: ActiveAppLocaleList): Effect.Effect<void, TryoutClosureError, never>;
|
|
20
|
-
export {};
|