@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.
Files changed (164) hide show
  1. package/README.md +8 -25
  2. package/dist/{question → assessment}/answer.d.ts +14 -58
  3. package/dist/{question → assessment}/answer.js +13 -60
  4. package/dist/assessment/catalog.d.ts +235 -0
  5. package/dist/assessment/catalog.js +115 -0
  6. package/dist/assessment/chart.d.ts +62 -0
  7. package/dist/assessment/chart.js +64 -0
  8. package/dist/assessment/closure.d.ts +28 -0
  9. package/dist/assessment/closure.js +164 -0
  10. package/dist/assessment/explanation.d.ts +13 -8
  11. package/dist/assessment/explanation.js +14 -8
  12. package/dist/assessment/figure.d.ts +140 -1
  13. package/dist/assessment/figure.js +9 -2
  14. package/dist/assessment/hash.d.ts +348 -208
  15. package/dist/assessment/hash.js +14 -0
  16. package/dist/assessment/inline.d.ts +3 -1
  17. package/dist/assessment/inline.js +20 -5
  18. package/dist/assessment/item.d.ts +8 -4
  19. package/dist/assessment/item.js +6 -2
  20. package/dist/assessment/key.js +6 -6
  21. package/dist/assessment/paper.d.ts +74 -74
  22. package/dist/assessment/snapshot.d.ts +3778 -0
  23. package/dist/assessment/snapshot.js +192 -0
  24. package/dist/cache/content.d.ts +4 -4
  25. package/dist/canonical.d.ts +6 -0
  26. package/dist/canonical.js +8 -1
  27. package/dist/content.d.ts +1 -1
  28. package/dist/content.js +0 -1
  29. package/dist/delivery.d.ts +0 -3
  30. package/dist/delivery.js +0 -5
  31. package/dist/preview/artifact.d.ts +1 -120
  32. package/dist/preview/document.d.ts +0 -586
  33. package/dist/preview/document.js +1 -47
  34. package/dist/preview/spec.d.ts +6 -1984
  35. package/dist/preview/spec.js +7 -47
  36. package/dist/preview/target.d.ts +0 -173
  37. package/dist/preview/target.js +1 -70
  38. package/dist/projection/digest.d.ts +0 -127
  39. package/dist/projection/hash.d.ts +0 -127
  40. package/dist/projection/spec.d.ts +6 -211
  41. package/dist/projection/spec.js +4 -18
  42. package/dist/projection/verify.d.ts +0 -127
  43. package/dist/projection/verify.js +0 -3
  44. package/dist/release/canonical.d.ts +2 -2
  45. package/dist/release/current/evidence.d.ts +24 -24
  46. package/dist/release/current/state.d.ts +28 -56
  47. package/dist/release/current/state.js +1 -6
  48. package/dist/release/digest.d.ts +2 -2
  49. package/dist/release/hash.d.ts +5 -5
  50. package/dist/release/head.d.ts +10 -57
  51. package/dist/release/head.js +3 -14
  52. package/dist/release/identity.d.ts +3 -3
  53. package/dist/release/items.d.ts +2 -2
  54. package/dist/release/lifecycle.d.ts +18 -18
  55. package/dist/release/policy.d.ts +3 -4
  56. package/dist/release/policy.js +2 -11
  57. package/dist/release/result/digest.d.ts +6 -18
  58. package/dist/release/result/digest.js +1 -2
  59. package/dist/release/rollback/digest.d.ts +4 -19
  60. package/dist/release/rollback/spec.d.ts +30 -792
  61. package/dist/release/rollback/spec.js +1 -4
  62. package/dist/release/snapshot/data.d.ts +599 -249
  63. package/dist/release/snapshot/data.js +11 -28
  64. package/dist/release/snapshot/evidence/assessment.d.ts +26 -0
  65. package/dist/release/snapshot/evidence/assessment.js +44 -0
  66. package/dist/release/snapshot/evidence/requirement.d.ts +1 -1
  67. package/dist/release/snapshot/evidence.d.ts +19 -19
  68. package/dist/release/snapshot/evidence.js +2 -2
  69. package/dist/release/snapshot/scope.d.ts +5 -5
  70. package/dist/release/snapshot/scope.js +1 -1
  71. package/dist/release/snapshot/spec.d.ts +15 -15
  72. package/dist/release/snapshot/spec.js +8 -8
  73. package/dist/release/snapshot/verify.d.ts +1278 -268
  74. package/dist/release/snapshot/verify.js +8 -5
  75. package/dist/release/spec.d.ts +33 -33
  76. package/dist/release/verify.d.ts +5 -5
  77. package/dist/runtime/spec.d.ts +38 -38
  78. package/dist/runtime/spec.js +4 -5
  79. package/dist/runtime/verify.d.ts +40 -40
  80. package/dist/signature/spec.d.ts +5 -5
  81. package/dist/signature/spec.js +0 -1
  82. package/dist/transport/batch.d.ts +6 -244
  83. package/dist/transport/failure.d.ts +6 -20
  84. package/dist/transport/failure.js +0 -10
  85. package/dist/transport/group.d.ts +1969 -1369
  86. package/dist/transport/group.js +0 -2
  87. package/dist/transport/request.d.ts +10691 -5086
  88. package/dist/transport/request.js +0 -3
  89. package/dist/transport/response.d.ts +219 -1442
  90. package/dist/transport/response.js +0 -4
  91. package/dist/transport/snapshot.d.ts +1187 -487
  92. package/package.json +187 -295
  93. package/dist/projection/question.d.ts +0 -1067
  94. package/dist/projection/question.js +0 -121
  95. package/dist/question/identity.d.ts +0 -175
  96. package/dist/question/identity.js +0 -207
  97. package/dist/question/item.d.ts +0 -450
  98. package/dist/question/item.js +0 -174
  99. package/dist/question/label.d.ts +0 -3
  100. package/dist/question/label.js +0 -3
  101. package/dist/question/points.d.ts +0 -18
  102. package/dist/question/points.js +0 -22
  103. package/dist/question/response.d.ts +0 -289
  104. package/dist/question/response.js +0 -167
  105. package/dist/question/rubric.d.ts +0 -234
  106. package/dist/question/rubric.js +0 -186
  107. package/dist/release/current/runtime.d.ts +0 -4
  108. package/dist/release/current/runtime.js +0 -15
  109. package/dist/release/snapshot/evidence/tryout.d.ts +0 -22
  110. package/dist/release/snapshot/evidence/tryout.js +0 -91
  111. package/dist/runtime/protected/limits.d.ts +0 -10
  112. package/dist/runtime/protected/limits.js +0 -16
  113. package/dist/runtime/protected/spec.d.ts +0 -310
  114. package/dist/runtime/protected/spec.js +0 -80
  115. package/dist/runtime/protected/verify.d.ts +0 -83
  116. package/dist/runtime/protected/verify.js +0 -70
  117. package/dist/transport/runtime.d.ts +0 -77
  118. package/dist/transport/runtime.js +0 -33
  119. package/dist/tryout/canonical.d.ts +0 -12
  120. package/dist/tryout/canonical.js +0 -7
  121. package/dist/tryout/catalog.d.ts +0 -396
  122. package/dist/tryout/catalog.js +0 -155
  123. package/dist/tryout/closure/accounting.d.ts +0 -20
  124. package/dist/tryout/closure/accounting.js +0 -70
  125. package/dist/tryout/closure/locale.d.ts +0 -14
  126. package/dist/tryout/closure/locale.js +0 -113
  127. package/dist/tryout/closure/placement.d.ts +0 -5
  128. package/dist/tryout/closure/placement.js +0 -32
  129. package/dist/tryout/digest.d.ts +0 -34
  130. package/dist/tryout/digest.js +0 -57
  131. package/dist/tryout/hash/catalog.d.ts +0 -364
  132. package/dist/tryout/hash/catalog.js +0 -209
  133. package/dist/tryout/hash/content.d.ts +0 -215
  134. package/dist/tryout/hash/content.js +0 -75
  135. package/dist/tryout/hash/placement.d.ts +0 -242
  136. package/dist/tryout/hash/placement.js +0 -56
  137. package/dist/tryout/identity.d.ts +0 -12
  138. package/dist/tryout/identity.js +0 -47
  139. package/dist/tryout/key.d.ts +0 -4
  140. package/dist/tryout/key.js +0 -8
  141. package/dist/tryout/language.d.ts +0 -24
  142. package/dist/tryout/language.js +0 -30
  143. package/dist/tryout/placement.d.ts +0 -331
  144. package/dist/tryout/placement.js +0 -96
  145. package/dist/tryout/runtime/canonical.d.ts +0 -8
  146. package/dist/tryout/runtime/canonical.js +0 -34
  147. package/dist/tryout/runtime/hash.d.ts +0 -34
  148. package/dist/tryout/runtime/hash.js +0 -13
  149. package/dist/tryout/runtime/source.d.ts +0 -44
  150. package/dist/tryout/runtime/source.js +0 -47
  151. package/dist/tryout/runtime/spec.d.ts +0 -58
  152. package/dist/tryout/runtime/spec.js +0 -21
  153. package/dist/tryout/runtime/verify.d.ts +0 -69
  154. package/dist/tryout/runtime/verify.js +0 -67
  155. package/dist/tryout/scoring.d.ts +0 -148
  156. package/dist/tryout/scoring.js +0 -98
  157. package/dist/tryout/snapshot/canonical.d.ts +0 -7
  158. package/dist/tryout/snapshot/canonical.js +0 -18
  159. package/dist/tryout/snapshot/hash.d.ts +0 -49
  160. package/dist/tryout/snapshot/hash.js +0 -22
  161. package/dist/tryout/snapshot/spec.d.ts +0 -46
  162. package/dist/tryout/snapshot/spec.js +0 -30
  163. package/dist/tryout/spec.d.ts +0 -41
  164. package/dist/tryout/spec.js +0 -46
@@ -0,0 +1,192 @@
1
+ import { Array as Arr, Effect, Option, Order, Schema, Stream } from "effect";
2
+ import { CatalogRowSchema, catalogRowIdentity, } from "#contracts/assessment/catalog";
3
+ import { ItemExplanationSchema } from "#contracts/assessment/explanation";
4
+ import { canonicalJson } from "#contracts/assessment/hash";
5
+ import { ItemFamilySchema, ItemVersionSchema, } from "#contracts/assessment/item";
6
+ import { ItemKeySchema } from "#contracts/assessment/key";
7
+ import { PaperSchema } from "#contracts/assessment/paper";
8
+ import { ExamProfileSchema } from "#contracts/assessment/profile";
9
+ import { StimulusVersionSchema } from "#contracts/assessment/stimulus";
10
+ import { canonicalOrder } from "#contracts/canonical";
11
+ import { DigestStream } from "#contracts/hash/stream";
12
+ import { hashText } from "#contracts/hash/text";
13
+ import { Sha256HashSchema } from "#contracts/ids";
14
+ import { ActiveAppLocaleListSchema } from "#contracts/locale";
15
+ import { compareCodeUnits } from "#contracts/text/order";
16
+ /** Semantic wire identity of the assessment snapshot. */
17
+ export const ASSESSMENT_SNAPSHOT_FORMAT = "assessment-snapshot";
18
+ /** Separates the hash of one snapshot row from the hash of any other record. */
19
+ const ROW_DOMAIN = "nakafa.aksara.assessment-row";
20
+ /** Separates the digest of the rows of a snapshot from any other digest. */
21
+ const ROWS_DOMAIN = "nakafa.aksara.assessment-rows";
22
+ /** Separates the identity of a snapshot from the hash of any other record. */
23
+ const SNAPSHOT_DOMAIN = "nakafa.aksara.assessment-snapshot";
24
+ /**
25
+ * Every row of an assessment snapshot, by kind, in the order a snapshot
26
+ * streams them: the catalog first, then the profiles and papers it names,
27
+ * then the items, their readings, keys, and explanations.
28
+ */
29
+ export const AssessmentRowSchema = Schema.Union([
30
+ Schema.Struct({ kind: Schema.Literal("catalog"), row: CatalogRowSchema }),
31
+ Schema.Struct({
32
+ hash: Sha256HashSchema,
33
+ kind: Schema.Literal("profile"),
34
+ profile: ExamProfileSchema,
35
+ }),
36
+ Schema.Struct({
37
+ hash: Sha256HashSchema,
38
+ kind: Schema.Literal("paper"),
39
+ paper: PaperSchema,
40
+ }),
41
+ Schema.Struct({ family: ItemFamilySchema, kind: Schema.Literal("family") }),
42
+ Schema.Struct({ kind: Schema.Literal("item"), version: ItemVersionSchema }),
43
+ Schema.Struct({
44
+ kind: Schema.Literal("stimulus"),
45
+ version: StimulusVersionSchema,
46
+ }),
47
+ Schema.Struct({ key: ItemKeySchema, kind: Schema.Literal("key") }),
48
+ Schema.Struct({
49
+ explanation: ItemExplanationSchema,
50
+ kind: Schema.Literal("explanation"),
51
+ }),
52
+ ]);
53
+ /** The kinds of row in the order a snapshot streams them. */
54
+ export const ASSESSMENT_ROW_KINDS = Arr.map(AssessmentRowSchema.members, ({ fields }) => fields.kind.literal);
55
+ /** One row bound to the hash of its canonical encoding. */
56
+ export const AssessmentRecordSchema = Schema.Struct({
57
+ row: AssessmentRowSchema,
58
+ rowHash: Sha256HashSchema,
59
+ });
60
+ const NonNegativeCountSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
61
+ /** How many rows of each kind one snapshot holds. */
62
+ export const AssessmentCountsSchema = Schema.Struct({
63
+ catalog: NonNegativeCountSchema,
64
+ explanation: NonNegativeCountSchema,
65
+ family: NonNegativeCountSchema,
66
+ item: NonNegativeCountSchema,
67
+ key: NonNegativeCountSchema,
68
+ paper: NonNegativeCountSchema,
69
+ profile: NonNegativeCountSchema,
70
+ stimulus: NonNegativeCountSchema,
71
+ });
72
+ const SnapshotFactFields = {
73
+ activeAppLocales: ActiveAppLocaleListSchema,
74
+ counts: AssessmentCountsSchema,
75
+ rowDigest: Sha256HashSchema,
76
+ };
77
+ /** The facts of a snapshot that its identity covers. */
78
+ export const AssessmentSnapshotFactsSchema = Schema.Struct(SnapshotFactFields);
79
+ /** One content-addressed assessment snapshot, selected by a release. */
80
+ export const AssessmentSnapshotSchema = Schema.Struct({
81
+ ...SnapshotFactFields,
82
+ format: Schema.Literal(ASSESSMENT_SNAPSHOT_FORMAT),
83
+ snapshotId: Sha256HashSchema,
84
+ });
85
+ /**
86
+ * The identity of one row, unique within its kind, which orders the rows of a
87
+ * kind in a snapshot: a catalog node, a profile or a paper by identifier, a
88
+ * family by identifier, a version by its family or reading and its language, a
89
+ * key by the version it answers, and an explanation by its version and
90
+ * language.
91
+ */
92
+ export function assessmentRowIdentity(row) {
93
+ if (row.kind === "catalog") {
94
+ return catalogRowIdentity(row.row);
95
+ }
96
+ if (row.kind === "profile") {
97
+ return row.profile.id;
98
+ }
99
+ if (row.kind === "paper") {
100
+ return row.paper.id;
101
+ }
102
+ if (row.kind === "family") {
103
+ return row.family.id;
104
+ }
105
+ if (row.kind === "item") {
106
+ return `${row.version.family}\0${row.version.deliveryLanguage}`;
107
+ }
108
+ if (row.kind === "stimulus") {
109
+ return `${row.version.id}\0${row.version.deliveryLanguage}`;
110
+ }
111
+ if (row.kind === "key") {
112
+ return row.key.version;
113
+ }
114
+ return `${row.explanation.version}\0${row.explanation.language}`;
115
+ }
116
+ /** Orders rows as a snapshot streams them: by kind, then by identity. */
117
+ export const AssessmentRowOrder = Order.combine(Order.mapInput(canonicalOrder(ASSESSMENT_ROW_KINDS), (row) => row.kind), Order.mapInput(Order.make(compareCodeUnits), assessmentRowIdentity));
118
+ /** Computes the hash of one row from its canonical encoding. */
119
+ export const hashAssessmentRow = Effect.fn("AksaraContracts.hashAssessmentRow")(function* (row) {
120
+ return yield* hashText(`${ROW_DOMAIN}\n${yield* canonicalJson(row)}`);
121
+ });
122
+ /** A row stream is out of canonical order, holds a row twice, or carries a wrong hash. */
123
+ export class AssessmentRowsError extends Schema.TaggedError()("AssessmentRowsError", {
124
+ identity: Schema.String,
125
+ kind: Schema.Literals(ASSESSMENT_ROW_KINDS),
126
+ reason: Schema.Literals(["hash", "order"]),
127
+ }) {
128
+ }
129
+ /**
130
+ * Digests one row stream in canonical order. Each row must carry the hash of
131
+ * its own canonical encoding and follow the row before it, so a stream that
132
+ * is tampered, duplicated, or unsorted fails. Returns the count of each kind
133
+ * and the digest over every row.
134
+ */
135
+ export const digestAssessmentRows = Effect.fn("AksaraContracts.digestAssessmentRows")(function* (records) {
136
+ const stream = new DigestStream();
137
+ stream.add(`${ROWS_DOMAIN}\n`);
138
+ const initial = {
139
+ counts: AssessmentCountsSchema.make({
140
+ catalog: 0,
141
+ explanation: 0,
142
+ family: 0,
143
+ item: 0,
144
+ key: 0,
145
+ paper: 0,
146
+ profile: 0,
147
+ stimulus: 0,
148
+ }),
149
+ previous: Option.none(),
150
+ };
151
+ const state = yield* records.pipe(Stream.runFoldEffect(() => initial, (current, record) => Effect.gen(function* () {
152
+ const identity = assessmentRowIdentity(record.row);
153
+ if (Option.isSome(current.previous) &&
154
+ AssessmentRowOrder(current.previous.value, record.row) >= 0) {
155
+ return yield* new AssessmentRowsError({
156
+ identity,
157
+ kind: record.row.kind,
158
+ reason: "order",
159
+ });
160
+ }
161
+ const canonical = yield* canonicalJson(record.row);
162
+ if ((yield* hashText(`${ROW_DOMAIN}\n${canonical}`)) !== record.rowHash) {
163
+ return yield* new AssessmentRowsError({
164
+ identity,
165
+ kind: record.row.kind,
166
+ reason: "hash",
167
+ });
168
+ }
169
+ stream.add(`${canonical}\0${record.rowHash}\n`);
170
+ return {
171
+ counts: {
172
+ ...current.counts,
173
+ [record.row.kind]: current.counts[record.row.kind] + 1,
174
+ },
175
+ previous: Option.some(record.row),
176
+ };
177
+ })));
178
+ return { counts: state.counts, rowDigest: yield* stream.digest() };
179
+ });
180
+ /** Creates one complete content-addressed snapshot from its facts. */
181
+ export const makeAssessmentSnapshot = Effect.fn("AksaraContracts.makeAssessmentSnapshot")(function* (facts) {
182
+ const snapshotId = yield* hashText(`${SNAPSHOT_DOMAIN}\n${yield* canonicalJson(facts)}`);
183
+ return AssessmentSnapshotSchema.make({
184
+ ...facts,
185
+ format: ASSESSMENT_SNAPSHOT_FORMAT,
186
+ snapshotId,
187
+ });
188
+ });
189
+ /** Counts every row of a snapshot. */
190
+ export function assessmentRowCount(counts) {
191
+ return Arr.reduce(ASSESSMENT_ROW_KINDS, 0, (total, kind) => total + counts[kind]);
192
+ }
@@ -1,26 +1,26 @@
1
1
  import { Schema } from "effect";
2
2
  import { type Sha256Hash } from "#contracts/ids";
3
3
  /** Mutable publication dependencies owned by the signed source contracts. */
4
- export declare const ContentCacheScopeSchema: Schema.Literals<readonly ["article", "material", "page", "question", "program", "quran", "tryout"]>;
4
+ export declare const ContentCacheScopeSchema: Schema.Literals<readonly ["article", "material", "page", "assessment", "program", "quran"]>;
5
5
  export type ContentCacheScope = typeof ContentCacheScopeSchema.Type;
6
6
  /** One immutable published-artifact cache tag derived only from its hash. */
7
7
  export declare const ArtifactCacheTagSchema: Schema.brand<Schema.String, "@NakafaAI/AksaraArtifactCacheTag">;
8
8
  export type ArtifactCacheTag = typeof ArtifactCacheTagSchema.Type;
9
9
  /** A changed item or snapshot invalidates its mutable selection dependency. */
10
10
  export declare const ContentCacheChangeSchema: Schema.Struct<{
11
- readonly scope: Schema.Literals<readonly ["article", "material", "page", "question", "program", "quran", "tryout"]>;
11
+ readonly scope: Schema.Literals<readonly ["article", "material", "page", "assessment", "program", "quran"]>;
12
12
  }>;
13
13
  export type ContentCacheChange = typeof ContentCacheChangeSchema.Type;
14
14
  /** One release-bound invalidation cannot name global or immutable cache tags. */
15
15
  export declare const ContentCacheRequestSchema: Schema.Struct<{
16
16
  readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
17
- readonly scope: Schema.Literals<readonly ["article", "material", "page", "question", "program", "quran", "tryout"]>;
17
+ readonly scope: Schema.Literals<readonly ["article", "material", "page", "assessment", "program", "quran"]>;
18
18
  }>;
19
19
  export type ContentCacheRequest = typeof ContentCacheRequestSchema.Type;
20
20
  /** Nakafa proof that one exact release-bound dependency was invalidated. */
21
21
  export declare const ContentCacheReceiptSchema: Schema.Struct<{
22
22
  readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
23
- readonly scope: Schema.Literals<readonly ["article", "material", "page", "question", "program", "quran", "tryout"]>;
23
+ readonly scope: Schema.Literals<readonly ["article", "material", "page", "assessment", "program", "quran"]>;
24
24
  readonly revalidated: Schema.Literal<true>;
25
25
  }>;
26
26
  export type ContentCacheReceipt = typeof ContentCacheReceiptSchema.Type;
@@ -1,3 +1,9 @@
1
+ import { Order } from "effect";
2
+ /**
3
+ * Orders values by their place in one canonical list. A value outside the list
4
+ * sorts after every member.
5
+ */
6
+ export declare function canonicalOrder<A extends string>(canonical: readonly A[]): Order.Order<A>;
1
7
  /**
2
8
  * Checks that a list names members of one canonical list, each at most once,
3
9
  * in the canonical order. A value outside the canonical list fails the check.
package/dist/canonical.js CHANGED
@@ -1,4 +1,11 @@
1
- import { Array as Arr } from "effect";
1
+ import { Array as Arr, Option, Order } from "effect";
2
+ /**
3
+ * Orders values by their place in one canonical list. A value outside the list
4
+ * sorts after every member.
5
+ */
6
+ export function canonicalOrder(canonical) {
7
+ return Order.mapInput(Order.Number, (value) => Option.getOrElse(Arr.findFirstIndex(canonical, (member) => member === value), () => canonical.length));
8
+ }
2
9
  /**
3
10
  * Checks that a list names members of one canonical list, each at most once,
4
11
  * in the canonical order. A value outside the canonical list fails the check.
package/dist/content.d.ts CHANGED
@@ -2,7 +2,7 @@ import { Effect, Schema } from "effect";
2
2
  import { type PublicPath, Sha256HashSchema } from "#contracts/ids";
3
3
  import { type AppLocale } from "#contracts/locale";
4
4
  /** Published content families backed by real Aksara source registries. */
5
- export declare const ContentFamilySchema: Schema.Literals<readonly ["article", "material", "page", "question"]>;
5
+ export declare const ContentFamilySchema: Schema.Literals<readonly ["article", "material", "page"]>;
6
6
  export type ContentFamily = typeof ContentFamilySchema.Type;
7
7
  /** Exact authored person identity exposed by Nakafa content metadata. */
8
8
  export declare const ContentAuthorSchema: Schema.Struct<{
package/dist/content.js CHANGED
@@ -13,7 +13,6 @@ export const ContentFamilySchema = Schema.Literals([
13
13
  "article",
14
14
  "material",
15
15
  "page",
16
- "question",
17
16
  ]);
18
17
  /** Exact authored person identity exposed by Nakafa content metadata. */
19
18
  export const ContentAuthorSchema = Schema.Struct({ name: Schema.String });
@@ -2,6 +2,3 @@ import { Schema } from "effect";
2
2
  /** Access boundary enforced before any published artifact body is returned. */
3
3
  export declare const ContentDeliveryClassSchema: Schema.Literals<readonly ["public", "authenticated", "entitled"]>;
4
4
  export type ContentDeliveryClass = typeof ContentDeliveryClassSchema.Type;
5
- /** Delivery classes whose artifact bodies need a product-authorized runtime read. */
6
- export declare const ProtectedContentDeliverySchema: Schema.Literals<readonly ["authenticated", "entitled"]>;
7
- export type ProtectedContentDelivery = typeof ProtectedContentDeliverySchema.Type;
package/dist/delivery.js CHANGED
@@ -5,8 +5,3 @@ export const ContentDeliveryClassSchema = Schema.Literals([
5
5
  "authenticated",
6
6
  "entitled",
7
7
  ]);
8
- /** Delivery classes whose artifact bodies need a product-authorized runtime read. */
9
- export const ProtectedContentDeliverySchema = ContentDeliveryClassSchema.pick([
10
- "authenticated",
11
- "entitled",
12
- ]);
@@ -90,125 +90,6 @@ export declare const PreviewArtifactSchema: Schema.Struct<{
90
90
  }>;
91
91
  readonly sitemap: Schema.Literal<true>;
92
92
  readonly sourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
93
- }>, Schema.Union<readonly [Schema.Struct<{
94
- readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
95
- readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
96
- readonly peerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
97
- readonly questionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionKey">;
98
- readonly questionNumber: Schema.Finite;
99
- readonly setKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionSetKey">;
100
- readonly bodyKind: Schema.Literal<"question">;
101
- readonly blueprint: Schema.optionalKey<Schema.Struct<{
102
- readonly cognitiveLevel: Schema.String;
103
- readonly contentDomain: Schema.String;
104
- readonly topic: Schema.String;
105
- }>>;
106
- readonly kind: Schema.Literal<"question-body">;
107
- readonly metadata: Schema.Struct<{
108
- readonly dateModified: Schema.optionalKey<Schema.String>;
109
- readonly datePublished: Schema.String;
110
- readonly authors: Schema.$Array<Schema.Struct<{
111
- readonly name: Schema.String;
112
- }>>;
113
- readonly title: Schema.String;
114
- }>;
115
- readonly stimulusKey: Schema.optionalKey<Schema.String>;
116
- readonly response: Schema.Union<readonly [Schema.Struct<{
117
- readonly categories: Schema.$Array<Schema.Struct<{
118
- readonly categoryKey: Schema.String;
119
- readonly label: Schema.String;
120
- readonly order: Schema.Int;
121
- }>>;
122
- readonly kind: Schema.Literal<"category">;
123
- readonly statements: Schema.$Array<Schema.Struct<{
124
- readonly correctCategoryKey: Schema.String;
125
- readonly label: Schema.String;
126
- readonly order: Schema.Int;
127
- readonly statementKey: Schema.String;
128
- }>>;
129
- }>, Schema.Struct<{
130
- readonly kind: Schema.Literal<"multiple-choice">;
131
- readonly options: Schema.$Array<Schema.Struct<{
132
- readonly isCorrect: Schema.Boolean;
133
- readonly label: Schema.String;
134
- readonly optionKey: Schema.String;
135
- readonly order: Schema.Int;
136
- }>>;
137
- }>, Schema.Struct<{
138
- readonly criteria: Schema.$Array<Schema.Struct<{
139
- readonly criterionKey: Schema.String;
140
- readonly finalAnswer: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
141
- readonly acceptsFractions: Schema.Boolean;
142
- readonly kind: Schema.Literal<"number">;
143
- readonly tolerance: Schema.optionalKey<Schema.Struct<{
144
- readonly kind: Schema.Literals<readonly ["absolute", "relative"]>;
145
- readonly value: Schema.String;
146
- }>>;
147
- readonly value: Schema.String;
148
- }>, Schema.Struct<{
149
- readonly acceptedAnswers: Schema.NonEmptyArray<Schema.Trimmed>;
150
- readonly collapseWhitespace: Schema.Boolean;
151
- readonly ignoreCase: Schema.Boolean;
152
- readonly kind: Schema.Literal<"text">;
153
- }>]>>;
154
- readonly order: Schema.Int;
155
- readonly label: Schema.$Record<Schema.Literals<readonly ["en", "id", "de"]>, Schema.String>;
156
- readonly levels: Schema.$Array<Schema.Struct<{
157
- readonly levelKey: Schema.String;
158
- readonly order: Schema.Int;
159
- readonly points: Schema.Int;
160
- readonly label: Schema.$Record<Schema.Literals<readonly ["en", "id", "de"]>, Schema.String>;
161
- }>>;
162
- }>>;
163
- readonly kind: Schema.Literal<"rubric">;
164
- }>, Schema.Struct<{
165
- readonly key: Schema.Union<readonly [Schema.Struct<{
166
- readonly acceptsFractions: Schema.Boolean;
167
- readonly kind: Schema.Literal<"number">;
168
- readonly tolerance: Schema.optionalKey<Schema.Struct<{
169
- readonly kind: Schema.Literals<readonly ["absolute", "relative"]>;
170
- readonly value: Schema.String;
171
- }>>;
172
- readonly value: Schema.String;
173
- }>, Schema.Struct<{
174
- readonly acceptedAnswers: Schema.NonEmptyArray<Schema.Trimmed>;
175
- readonly collapseWhitespace: Schema.Boolean;
176
- readonly ignoreCase: Schema.Boolean;
177
- readonly kind: Schema.Literal<"text">;
178
- }>]>;
179
- readonly kind: Schema.Literal<"short-answer">;
180
- }>, Schema.Struct<{
181
- readonly kind: Schema.Literal<"single-choice">;
182
- readonly options: Schema.$Array<Schema.Struct<{
183
- readonly isCorrect: Schema.Boolean;
184
- readonly label: Schema.String;
185
- readonly optionKey: Schema.String;
186
- readonly order: Schema.Int;
187
- }>>;
188
- }>]>;
189
- }>, Schema.Struct<{
190
- readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
191
- readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
192
- readonly peerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
193
- readonly questionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionKey">;
194
- readonly questionNumber: Schema.Finite;
195
- readonly setKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionSetKey">;
196
- readonly bodyKind: Schema.Literal<"answer">;
197
- readonly blueprint: Schema.optionalKey<Schema.Struct<{
198
- readonly cognitiveLevel: Schema.String;
199
- readonly contentDomain: Schema.String;
200
- readonly topic: Schema.String;
201
- }>>;
202
- readonly kind: Schema.Literal<"question-body">;
203
- readonly metadata: Schema.Struct<{
204
- readonly dateModified: Schema.optionalKey<Schema.String>;
205
- readonly datePublished: Schema.String;
206
- readonly authors: Schema.$Array<Schema.Struct<{
207
- readonly name: Schema.String;
208
- }>>;
209
- readonly title: Schema.String;
210
- }>;
211
- readonly stimulusKey: Schema.optionalKey<Schema.String>;
212
- }>]>]>;
93
+ }>]>;
213
94
  }>;
214
95
  export type PreviewArtifact = typeof PreviewArtifactSchema.Type;