@nakafa/aksara-contracts 0.36.0 → 0.38.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/dist/cache/content.d.ts +14 -36
- package/dist/cache/content.js +22 -64
- package/dist/math/base.d.ts +1 -2
- package/dist/math/base.js +9 -5
- package/dist/math/plane.d.ts +2 -4
- package/dist/math/plane.js +2 -3
- package/dist/math/space.d.ts +2 -4
- package/dist/math/space.js +2 -3
- package/dist/math/visual.d.ts +4 -8
- package/dist/preview/artifact.js +2 -2
- package/dist/projection/digest.d.ts +0 -36
- package/dist/projection/question.d.ts +1 -159
- package/dist/projection/question.js +15 -75
- package/dist/projection/spec.d.ts +1 -199
- package/dist/projection/spec.js +1 -8
- package/dist/projection/verify.d.ts +64 -100
- package/dist/release/current/evidence.d.ts +6 -21
- package/dist/release/current/state.d.ts +10 -35
- package/dist/release/hash.d.ts +0 -5
- package/dist/release/items.js +1 -2
- package/dist/release/lifecycle.d.ts +4 -14
- package/dist/release/rollback/spec.d.ts +12 -228
- package/dist/release/snapshot/scope.d.ts +3 -48
- package/dist/release/snapshot/scope.js +7 -69
- package/dist/release/snapshot/spec.js +2 -3
- package/dist/release/snapshot/verify.d.ts +31 -31
- package/dist/release/spec.d.ts +6 -21
- package/dist/release/verify.d.ts +0 -5
- package/dist/runtime/spec.d.ts +26 -41
- package/dist/runtime/verify.d.ts +44 -54
- package/dist/transport/batch.d.ts +0 -405
- package/dist/transport/batch.js +2 -14
- package/dist/transport/group.d.ts +33 -633
- package/dist/transport/group.js +1 -2
- package/dist/transport/request.d.ts +375 -1435
- package/dist/transport/response.d.ts +145 -503
- package/dist/tryout/catalog-hash.d.ts +18 -18
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Effect, Schema
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
2
|
import { ContentAuthorSchema } from "#contracts/content";
|
|
3
|
-
import {
|
|
3
|
+
import { withPublicationDates } from "#contracts/date";
|
|
4
4
|
import { QuestionAnswerIdentitySchema, QuestionPromptIdentitySchema, } from "#contracts/question/identity";
|
|
5
5
|
import { canonicalQuestionBlueprint, QuestionBlueprintSchema, questionResponseFor, } from "#contracts/question/item";
|
|
6
6
|
import { canonicalQuestionResponse, QuestionResponseSchema, } from "#contracts/question/response";
|
|
@@ -29,48 +29,6 @@ export const QuestionBodyProjectionSchema = Schema.Union([
|
|
|
29
29
|
QuestionPromptProjectionSchema,
|
|
30
30
|
QuestionAnswerProjectionSchema,
|
|
31
31
|
]);
|
|
32
|
-
/** One predecessor choice retained only while authenticated rollback needs it. */
|
|
33
|
-
const HistoricalQuestionChoiceSchema = Schema.Struct({
|
|
34
|
-
label: Schema.String,
|
|
35
|
-
value: Schema.Boolean,
|
|
36
|
-
}).mapFields(Struct.map(Schema.mutableKey));
|
|
37
|
-
/** Checks that one predecessor prompt preserves exactly one correct choice. */
|
|
38
|
-
function hasExactlyOneCorrectChoice(choices) {
|
|
39
|
-
return choices.filter(({ value }) => value).length === 1;
|
|
40
|
-
}
|
|
41
|
-
const HistoricalQuestionChoiceListSchema = Schema.Array(HistoricalQuestionChoiceSchema).pipe(Schema.mutable, Schema.check(Schema.makeFilter(hasExactlyOneCorrectChoice, {
|
|
42
|
-
identifier: "HistoricalQuestionChoiceList",
|
|
43
|
-
message: "Expected exactly one correct historical choice.",
|
|
44
|
-
})));
|
|
45
|
-
const HistoricalQuestionMetadataSchema = Schema.Struct({
|
|
46
|
-
authors: Schema.Array(ContentAuthorSchema),
|
|
47
|
-
date: DateOnlySchema,
|
|
48
|
-
title: Schema.String,
|
|
49
|
-
});
|
|
50
|
-
const HistoricalQuestionProjectionFields = {
|
|
51
|
-
kind: Schema.Literal("question-body"),
|
|
52
|
-
metadata: HistoricalQuestionMetadataSchema,
|
|
53
|
-
};
|
|
54
|
-
const HistoricalQuestionPromptProjectionSchema = QuestionPromptIdentitySchema.mapFields((fields) => ({
|
|
55
|
-
...fields,
|
|
56
|
-
...HistoricalQuestionProjectionFields,
|
|
57
|
-
choices: HistoricalQuestionChoiceListSchema,
|
|
58
|
-
}), { unsafePreserveChecks: true });
|
|
59
|
-
const HistoricalQuestionAnswerProjectionSchema = QuestionAnswerIdentitySchema.mapFields((fields) => ({ ...fields, ...HistoricalQuestionProjectionFields }), { unsafePreserveChecks: true });
|
|
60
|
-
/**
|
|
61
|
-
* Exact predecessor Question bytes retained for authenticated rollback reads.
|
|
62
|
-
* Delete only after two accepted scoped rebuilds and an authoritative
|
|
63
|
-
* current/prior audit reports zero `choices` and `date` projections.
|
|
64
|
-
*/
|
|
65
|
-
export const HistoricalQuestionBodyProjectionSchema = Schema.Union([
|
|
66
|
-
HistoricalQuestionPromptProjectionSchema,
|
|
67
|
-
HistoricalQuestionAnswerProjectionSchema,
|
|
68
|
-
]);
|
|
69
|
-
/** Current Question values plus exact predecessor rollback bytes. */
|
|
70
|
-
export const ReadableQuestionBodyProjectionSchema = Schema.Union([
|
|
71
|
-
QuestionBodyProjectionSchema,
|
|
72
|
-
HistoricalQuestionBodyProjectionSchema,
|
|
73
|
-
]);
|
|
74
32
|
/** Shared identity and metadata carried by both question body projections. */
|
|
75
33
|
function questionProjectionFields(input) {
|
|
76
34
|
return {
|
|
@@ -117,50 +75,32 @@ export const makeQuestionBodyProjection = Effect.fn("AksaraContracts.makeQuestio
|
|
|
117
75
|
}
|
|
118
76
|
return makeQuestionAnswerProjection({ ...input, bodyKind: "answer" });
|
|
119
77
|
});
|
|
120
|
-
/** Preserves the exact response fields owned by each readable prompt format. */
|
|
121
|
-
function canonicalQuestionBody(projection) {
|
|
122
|
-
if (projection.bodyKind === "answer") {
|
|
123
|
-
return {};
|
|
124
|
-
}
|
|
125
|
-
if ("response" in projection) {
|
|
126
|
-
return { response: canonicalQuestionResponse(projection.response) };
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
choices: projection.choices.map(({ label, value }) => ({ label, value })),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
78
|
/** Serializes one question projection with stable signed field order. */
|
|
133
79
|
export function canonicalizeQuestionProjection(projection) {
|
|
134
|
-
const body = canonicalQuestionBody(projection);
|
|
135
|
-
const metadata = "date" in projection.metadata
|
|
136
|
-
? {
|
|
137
|
-
authors: projection.metadata.authors.map(({ name }) => ({ name })),
|
|
138
|
-
date: projection.metadata.date,
|
|
139
|
-
title: projection.metadata.title,
|
|
140
|
-
}
|
|
141
|
-
: {
|
|
142
|
-
authors: projection.metadata.authors.map(({ name }) => ({ name })),
|
|
143
|
-
...(projection.metadata.dateModified === undefined
|
|
144
|
-
? {}
|
|
145
|
-
: { dateModified: projection.metadata.dateModified }),
|
|
146
|
-
datePublished: projection.metadata.datePublished,
|
|
147
|
-
title: projection.metadata.title,
|
|
148
|
-
};
|
|
149
80
|
return JSON.stringify({
|
|
150
81
|
bodyKind: projection.bodyKind,
|
|
151
|
-
...
|
|
82
|
+
...(projection.bodyKind === "question"
|
|
83
|
+
? { response: canonicalQuestionResponse(projection.response) }
|
|
84
|
+
: {}),
|
|
152
85
|
artifactLocale: projection.artifactLocale,
|
|
153
|
-
...(
|
|
86
|
+
...(projection.blueprint === undefined
|
|
154
87
|
? {}
|
|
155
88
|
: { blueprint: canonicalQuestionBlueprint(projection.blueprint) }),
|
|
156
89
|
contentKey: projection.contentKey,
|
|
157
90
|
kind: projection.kind,
|
|
158
|
-
metadata
|
|
91
|
+
metadata: {
|
|
92
|
+
authors: projection.metadata.authors.map(({ name }) => ({ name })),
|
|
93
|
+
...(projection.metadata.dateModified === undefined
|
|
94
|
+
? {}
|
|
95
|
+
: { dateModified: projection.metadata.dateModified }),
|
|
96
|
+
datePublished: projection.metadata.datePublished,
|
|
97
|
+
title: projection.metadata.title,
|
|
98
|
+
},
|
|
159
99
|
peerContentKey: projection.peerContentKey,
|
|
160
100
|
questionKey: projection.questionKey,
|
|
161
101
|
questionNumber: projection.questionNumber,
|
|
162
102
|
setKey: projection.setKey,
|
|
163
|
-
...(
|
|
103
|
+
...(projection.stimulusKey === undefined
|
|
164
104
|
? {}
|
|
165
105
|
: { stimulusKey: projection.stimulusKey }),
|
|
166
106
|
});
|
|
@@ -83,204 +83,6 @@ export declare const ContentProjectionSchema: Schema.Union<readonly [Schema.Stru
|
|
|
83
83
|
}>;
|
|
84
84
|
readonly sitemap: Schema.Literal<true>;
|
|
85
85
|
readonly sourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
86
|
-
}>, Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
87
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
88
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
89
|
-
readonly peerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
90
|
-
readonly questionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionKey">;
|
|
91
|
-
readonly questionNumber: Schema.Finite;
|
|
92
|
-
readonly setKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionSetKey">;
|
|
93
|
-
readonly bodyKind: Schema.Literal<"question">;
|
|
94
|
-
readonly blueprint: Schema.optionalKey<Schema.Struct<{
|
|
95
|
-
readonly cognitiveLevel: Schema.String;
|
|
96
|
-
readonly contentDomain: Schema.String;
|
|
97
|
-
readonly topic: Schema.String;
|
|
98
|
-
}>>;
|
|
99
|
-
readonly kind: Schema.Literal<"question-body">;
|
|
100
|
-
readonly metadata: Schema.Struct<{
|
|
101
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
102
|
-
readonly datePublished: Schema.String;
|
|
103
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
104
|
-
readonly name: Schema.String;
|
|
105
|
-
}>>;
|
|
106
|
-
readonly title: Schema.String;
|
|
107
|
-
}>;
|
|
108
|
-
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
109
|
-
readonly response: Schema.Union<readonly [Schema.Struct<{
|
|
110
|
-
readonly categories: Schema.$Array<Schema.Struct<{
|
|
111
|
-
readonly categoryKey: Schema.String;
|
|
112
|
-
readonly label: Schema.String;
|
|
113
|
-
readonly order: Schema.Int;
|
|
114
|
-
}>>;
|
|
115
|
-
readonly kind: Schema.Literal<"category">;
|
|
116
|
-
readonly statements: Schema.$Array<Schema.Struct<{
|
|
117
|
-
readonly correctCategoryKey: Schema.String;
|
|
118
|
-
readonly label: Schema.String;
|
|
119
|
-
readonly order: Schema.Int;
|
|
120
|
-
readonly statementKey: Schema.String;
|
|
121
|
-
}>>;
|
|
122
|
-
}>, Schema.Struct<{
|
|
123
|
-
readonly kind: Schema.Literal<"multiple-choice">;
|
|
124
|
-
readonly options: Schema.$Array<Schema.Struct<{
|
|
125
|
-
readonly isCorrect: Schema.Boolean;
|
|
126
|
-
readonly label: Schema.String;
|
|
127
|
-
readonly optionKey: Schema.String;
|
|
128
|
-
readonly order: Schema.Int;
|
|
129
|
-
}>>;
|
|
130
|
-
}>, Schema.Struct<{
|
|
131
|
-
readonly kind: Schema.Literal<"single-choice">;
|
|
132
|
-
readonly options: Schema.$Array<Schema.Struct<{
|
|
133
|
-
readonly isCorrect: Schema.Boolean;
|
|
134
|
-
readonly label: Schema.String;
|
|
135
|
-
readonly optionKey: Schema.String;
|
|
136
|
-
readonly order: Schema.Int;
|
|
137
|
-
}>>;
|
|
138
|
-
}>]>;
|
|
139
|
-
}>, Schema.Struct<{
|
|
140
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
141
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
142
|
-
readonly peerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
143
|
-
readonly questionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionKey">;
|
|
144
|
-
readonly questionNumber: Schema.Finite;
|
|
145
|
-
readonly setKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionSetKey">;
|
|
146
|
-
readonly bodyKind: Schema.Literal<"answer">;
|
|
147
|
-
readonly blueprint: Schema.optionalKey<Schema.Struct<{
|
|
148
|
-
readonly cognitiveLevel: Schema.String;
|
|
149
|
-
readonly contentDomain: Schema.String;
|
|
150
|
-
readonly topic: Schema.String;
|
|
151
|
-
}>>;
|
|
152
|
-
readonly kind: Schema.Literal<"question-body">;
|
|
153
|
-
readonly metadata: Schema.Struct<{
|
|
154
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
155
|
-
readonly datePublished: Schema.String;
|
|
156
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
157
|
-
readonly name: Schema.String;
|
|
158
|
-
}>>;
|
|
159
|
-
readonly title: Schema.String;
|
|
160
|
-
}>;
|
|
161
|
-
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
162
|
-
}>]>, Schema.Union<readonly [Schema.Struct<{
|
|
163
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
164
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
165
|
-
readonly peerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
166
|
-
readonly questionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionKey">;
|
|
167
|
-
readonly questionNumber: Schema.Finite;
|
|
168
|
-
readonly setKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionSetKey">;
|
|
169
|
-
readonly bodyKind: Schema.Literal<"question">;
|
|
170
|
-
readonly kind: Schema.Literal<"question-body">;
|
|
171
|
-
readonly metadata: Schema.Struct<{
|
|
172
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
173
|
-
readonly name: Schema.String;
|
|
174
|
-
}>>;
|
|
175
|
-
readonly date: Schema.String;
|
|
176
|
-
readonly title: Schema.String;
|
|
177
|
-
}>;
|
|
178
|
-
readonly choices: Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
179
|
-
readonly label: Schema.mutableKey<Schema.String>;
|
|
180
|
-
readonly value: Schema.mutableKey<Schema.Boolean>;
|
|
181
|
-
}>>>;
|
|
182
|
-
}>, Schema.Struct<{
|
|
183
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
184
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
185
|
-
readonly peerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
186
|
-
readonly questionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionKey">;
|
|
187
|
-
readonly questionNumber: Schema.Finite;
|
|
188
|
-
readonly setKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionSetKey">;
|
|
189
|
-
readonly bodyKind: Schema.Literal<"answer">;
|
|
190
|
-
readonly kind: Schema.Literal<"question-body">;
|
|
191
|
-
readonly metadata: Schema.Struct<{
|
|
192
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
193
|
-
readonly name: Schema.String;
|
|
194
|
-
}>>;
|
|
195
|
-
readonly date: Schema.String;
|
|
196
|
-
readonly title: Schema.String;
|
|
197
|
-
}>;
|
|
198
|
-
}>]>]>]>;
|
|
199
|
-
export type ContentProjection = typeof ContentProjectionSchema.Type;
|
|
200
|
-
/** Current projection vocabulary accepted for newly staged content. */
|
|
201
|
-
export declare const CurrentContentProjectionSchema: Schema.Union<readonly [Schema.Struct<{
|
|
202
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
203
|
-
readonly articleRouteSlug: Schema.brand<Schema.String, "@NakafaAI/AksaraArticleRouteSlug">;
|
|
204
|
-
readonly articleSlug: Schema.brand<Schema.String, "@NakafaAI/AksaraArticleSlug">;
|
|
205
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
206
|
-
readonly category: Schema.brand<Schema.String, "@NakafaAI/AksaraArticleCategory">;
|
|
207
|
-
readonly categoryRouteSlug: Schema.brand<Schema.String, "@NakafaAI/AksaraArticleRouteSlug">;
|
|
208
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
209
|
-
readonly graph: Schema.Struct<{
|
|
210
|
-
readonly alignmentId: Schema.String;
|
|
211
|
-
readonly assetId: Schema.String;
|
|
212
|
-
readonly conceptId: Schema.String;
|
|
213
|
-
readonly learningObjectId: Schema.String;
|
|
214
|
-
readonly lensId: Schema.String;
|
|
215
|
-
}>;
|
|
216
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
217
|
-
readonly categoryTitle: Schema.Trimmed;
|
|
218
|
-
readonly kind: Schema.Literal<"article">;
|
|
219
|
-
readonly metadata: Schema.Struct<{
|
|
220
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
221
|
-
readonly datePublished: Schema.String;
|
|
222
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
223
|
-
readonly name: Schema.String;
|
|
224
|
-
}>>;
|
|
225
|
-
readonly description: Schema.optional<Schema.String>;
|
|
226
|
-
readonly title: Schema.String;
|
|
227
|
-
}>;
|
|
228
|
-
readonly official: Schema.Boolean;
|
|
229
|
-
readonly parentPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
230
|
-
readonly references: Schema.$Array<Schema.Struct<{
|
|
231
|
-
readonly authors: Schema.String;
|
|
232
|
-
readonly citation: Schema.optional<Schema.String>;
|
|
233
|
-
readonly details: Schema.optional<Schema.String>;
|
|
234
|
-
readonly publication: Schema.optional<Schema.String>;
|
|
235
|
-
readonly title: Schema.String;
|
|
236
|
-
readonly url: Schema.optional<Schema.String>;
|
|
237
|
-
readonly year: Schema.Finite;
|
|
238
|
-
}>>;
|
|
239
|
-
readonly sitemap: Schema.Literal<true>;
|
|
240
|
-
}>, Schema.Struct<{
|
|
241
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
242
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
243
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
244
|
-
readonly graph: Schema.Struct<{
|
|
245
|
-
readonly alignmentId: Schema.String;
|
|
246
|
-
readonly assetId: Schema.String;
|
|
247
|
-
readonly conceptId: Schema.String;
|
|
248
|
-
readonly learningObjectId: Schema.String;
|
|
249
|
-
readonly lensId: Schema.String;
|
|
250
|
-
}>;
|
|
251
|
-
readonly materialKey: Schema.brand<Schema.String, "@NakafaAI/AksaraMaterialKey">;
|
|
252
|
-
readonly order: Schema.Finite;
|
|
253
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
254
|
-
readonly sectionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraMaterialSection">;
|
|
255
|
-
readonly kind: Schema.Literal<"subject-lesson">;
|
|
256
|
-
readonly metadata: Schema.Struct<{
|
|
257
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
258
|
-
readonly datePublished: Schema.String;
|
|
259
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
260
|
-
readonly name: Schema.String;
|
|
261
|
-
}>>;
|
|
262
|
-
readonly description: Schema.optional<Schema.String>;
|
|
263
|
-
readonly subject: Schema.optional<Schema.String>;
|
|
264
|
-
readonly title: Schema.String;
|
|
265
|
-
}>;
|
|
266
|
-
readonly parentPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
267
|
-
readonly sitemap: Schema.Literal<true>;
|
|
268
|
-
readonly topicTitle: Schema.String;
|
|
269
|
-
}>, Schema.Struct<{
|
|
270
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
271
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
272
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
273
|
-
readonly pageKey: Schema.brand<Schema.String, "@NakafaAI/AksaraPageKey">;
|
|
274
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
275
|
-
readonly kind: Schema.Literal<"public-page">;
|
|
276
|
-
readonly metadata: Schema.Struct<{
|
|
277
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
278
|
-
readonly datePublished: Schema.String;
|
|
279
|
-
readonly description: Schema.Trimmed;
|
|
280
|
-
readonly title: Schema.Trimmed;
|
|
281
|
-
}>;
|
|
282
|
-
readonly sitemap: Schema.Literal<true>;
|
|
283
|
-
readonly sourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
284
86
|
}>, Schema.Union<readonly [Schema.Struct<{
|
|
285
87
|
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
286
88
|
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
@@ -358,7 +160,7 @@ export declare const CurrentContentProjectionSchema: Schema.Union<readonly [Sche
|
|
|
358
160
|
}>;
|
|
359
161
|
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
360
162
|
}>]>]>;
|
|
361
|
-
export type
|
|
163
|
+
export type ContentProjection = typeof ContentProjectionSchema.Type;
|
|
362
164
|
/** Public-route projections accepted by Nakafa's path-based runtime seam. */
|
|
363
165
|
export declare const RoutedContentProjectionSchema: Schema.Union<readonly [Schema.Struct<{
|
|
364
166
|
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
package/dist/projection/spec.js
CHANGED
|
@@ -2,16 +2,9 @@ import { Match, Schema } from "effect";
|
|
|
2
2
|
import { ArticleProjectionSchema, canonicalizeArticleProjection, } from "#contracts/projection/article";
|
|
3
3
|
import { canonicalizeMaterialProjection, MaterialLessonProjectionSchema, } from "#contracts/projection/material";
|
|
4
4
|
import { canonicalizePublicPageProjection, PublicPageProjectionSchema, } from "#contracts/projection/page";
|
|
5
|
-
import { canonicalizeQuestionProjection, QuestionBodyProjectionSchema,
|
|
5
|
+
import { canonicalizeQuestionProjection, QuestionBodyProjectionSchema, } from "#contracts/projection/question";
|
|
6
6
|
/** Complete projection vocabulary backed by implemented content families. */
|
|
7
7
|
export const ContentProjectionSchema = Schema.Union([
|
|
8
|
-
ArticleProjectionSchema,
|
|
9
|
-
MaterialLessonProjectionSchema,
|
|
10
|
-
PublicPageProjectionSchema,
|
|
11
|
-
ReadableQuestionBodyProjectionSchema,
|
|
12
|
-
]);
|
|
13
|
-
/** Current projection vocabulary accepted for newly staged content. */
|
|
14
|
-
export const CurrentContentProjectionSchema = Schema.Union([
|
|
15
8
|
ArticleProjectionSchema,
|
|
16
9
|
MaterialLessonProjectionSchema,
|
|
17
10
|
PublicPageProjectionSchema,
|
|
@@ -42,89 +42,6 @@ export interface VerifiedContentProjections {
|
|
|
42
42
|
}
|
|
43
43
|
/** Strictly decodes a replayable canonical content projection stream. */
|
|
44
44
|
export declare function decodeContentProjections<E, R>(projections: Stream.Stream<unknown, E, R>): Stream.Stream<{
|
|
45
|
-
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
46
|
-
readonly articleRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
|
|
47
|
-
readonly articleSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleSlug">;
|
|
48
|
-
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
49
|
-
readonly category: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleCategory">;
|
|
50
|
-
readonly categoryRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
|
|
51
|
-
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
52
|
-
readonly graph: {
|
|
53
|
-
readonly alignmentId: string;
|
|
54
|
-
readonly assetId: string;
|
|
55
|
-
readonly conceptId: string;
|
|
56
|
-
readonly learningObjectId: string;
|
|
57
|
-
readonly lensId: string;
|
|
58
|
-
};
|
|
59
|
-
readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
60
|
-
readonly categoryTitle: string;
|
|
61
|
-
readonly kind: "article";
|
|
62
|
-
readonly metadata: {
|
|
63
|
-
readonly dateModified?: string;
|
|
64
|
-
readonly datePublished: string;
|
|
65
|
-
readonly authors: readonly {
|
|
66
|
-
readonly name: string;
|
|
67
|
-
}[];
|
|
68
|
-
readonly description?: string | undefined;
|
|
69
|
-
readonly title: string;
|
|
70
|
-
};
|
|
71
|
-
readonly official: boolean;
|
|
72
|
-
readonly parentPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
73
|
-
readonly references: readonly {
|
|
74
|
-
readonly authors: string;
|
|
75
|
-
readonly citation?: string | undefined;
|
|
76
|
-
readonly details?: string | undefined;
|
|
77
|
-
readonly publication?: string | undefined;
|
|
78
|
-
readonly title: string;
|
|
79
|
-
readonly url?: string | undefined;
|
|
80
|
-
readonly year: number;
|
|
81
|
-
}[];
|
|
82
|
-
readonly sitemap: true;
|
|
83
|
-
} | {
|
|
84
|
-
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
85
|
-
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
86
|
-
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
87
|
-
readonly graph: {
|
|
88
|
-
readonly alignmentId: string;
|
|
89
|
-
readonly assetId: string;
|
|
90
|
-
readonly conceptId: string;
|
|
91
|
-
readonly learningObjectId: string;
|
|
92
|
-
readonly lensId: string;
|
|
93
|
-
};
|
|
94
|
-
readonly materialKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialKey">;
|
|
95
|
-
readonly order: number;
|
|
96
|
-
readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
97
|
-
readonly sectionKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialSection">;
|
|
98
|
-
readonly kind: "subject-lesson";
|
|
99
|
-
readonly metadata: {
|
|
100
|
-
readonly dateModified?: string;
|
|
101
|
-
readonly datePublished: string;
|
|
102
|
-
readonly authors: readonly {
|
|
103
|
-
readonly name: string;
|
|
104
|
-
}[];
|
|
105
|
-
readonly description?: string | undefined;
|
|
106
|
-
readonly subject?: string | undefined;
|
|
107
|
-
readonly title: string;
|
|
108
|
-
};
|
|
109
|
-
readonly parentPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
110
|
-
readonly sitemap: true;
|
|
111
|
-
readonly topicTitle: string;
|
|
112
|
-
} | {
|
|
113
|
-
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
114
|
-
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
115
|
-
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
116
|
-
readonly pageKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPageKey">;
|
|
117
|
-
readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
118
|
-
readonly kind: "public-page";
|
|
119
|
-
readonly metadata: {
|
|
120
|
-
readonly dateModified?: string;
|
|
121
|
-
readonly datePublished: string;
|
|
122
|
-
readonly description: string;
|
|
123
|
-
readonly title: string;
|
|
124
|
-
};
|
|
125
|
-
readonly sitemap: true;
|
|
126
|
-
readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
|
|
127
|
-
} | {
|
|
128
45
|
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
129
46
|
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
130
47
|
readonly peerContentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
@@ -201,41 +118,88 @@ export declare function decodeContentProjections<E, R>(projections: Stream.Strea
|
|
|
201
118
|
};
|
|
202
119
|
readonly stimulusKey?: string;
|
|
203
120
|
} | {
|
|
121
|
+
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
122
|
+
readonly articleRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
|
|
123
|
+
readonly articleSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleSlug">;
|
|
204
124
|
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
125
|
+
readonly category: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleCategory">;
|
|
126
|
+
readonly categoryRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
|
|
205
127
|
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
206
|
-
readonly
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
128
|
+
readonly graph: {
|
|
129
|
+
readonly alignmentId: string;
|
|
130
|
+
readonly assetId: string;
|
|
131
|
+
readonly conceptId: string;
|
|
132
|
+
readonly learningObjectId: string;
|
|
133
|
+
readonly lensId: string;
|
|
134
|
+
};
|
|
135
|
+
readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
136
|
+
readonly categoryTitle: string;
|
|
137
|
+
readonly kind: "article";
|
|
212
138
|
readonly metadata: {
|
|
139
|
+
readonly dateModified?: string;
|
|
140
|
+
readonly datePublished: string;
|
|
213
141
|
readonly authors: readonly {
|
|
214
142
|
readonly name: string;
|
|
215
143
|
}[];
|
|
216
|
-
readonly
|
|
144
|
+
readonly description?: string | undefined;
|
|
217
145
|
readonly title: string;
|
|
218
146
|
};
|
|
219
|
-
readonly
|
|
220
|
-
|
|
221
|
-
|
|
147
|
+
readonly official: boolean;
|
|
148
|
+
readonly parentPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
149
|
+
readonly references: readonly {
|
|
150
|
+
readonly authors: string;
|
|
151
|
+
readonly citation?: string | undefined;
|
|
152
|
+
readonly details?: string | undefined;
|
|
153
|
+
readonly publication?: string | undefined;
|
|
154
|
+
readonly title: string;
|
|
155
|
+
readonly url?: string | undefined;
|
|
156
|
+
readonly year: number;
|
|
222
157
|
}[];
|
|
158
|
+
readonly sitemap: true;
|
|
223
159
|
} | {
|
|
160
|
+
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
224
161
|
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
225
162
|
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
226
|
-
readonly
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
163
|
+
readonly graph: {
|
|
164
|
+
readonly alignmentId: string;
|
|
165
|
+
readonly assetId: string;
|
|
166
|
+
readonly conceptId: string;
|
|
167
|
+
readonly learningObjectId: string;
|
|
168
|
+
readonly lensId: string;
|
|
169
|
+
};
|
|
170
|
+
readonly materialKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialKey">;
|
|
171
|
+
readonly order: number;
|
|
172
|
+
readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
173
|
+
readonly sectionKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialSection">;
|
|
174
|
+
readonly kind: "subject-lesson";
|
|
232
175
|
readonly metadata: {
|
|
176
|
+
readonly dateModified?: string;
|
|
177
|
+
readonly datePublished: string;
|
|
233
178
|
readonly authors: readonly {
|
|
234
179
|
readonly name: string;
|
|
235
180
|
}[];
|
|
236
|
-
readonly
|
|
181
|
+
readonly description?: string | undefined;
|
|
182
|
+
readonly subject?: string | undefined;
|
|
237
183
|
readonly title: string;
|
|
238
184
|
};
|
|
185
|
+
readonly parentPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
186
|
+
readonly sitemap: true;
|
|
187
|
+
readonly topicTitle: string;
|
|
188
|
+
} | {
|
|
189
|
+
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
190
|
+
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
191
|
+
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
192
|
+
readonly pageKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPageKey">;
|
|
193
|
+
readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
194
|
+
readonly kind: "public-page";
|
|
195
|
+
readonly metadata: {
|
|
196
|
+
readonly dateModified?: string;
|
|
197
|
+
readonly datePublished: string;
|
|
198
|
+
readonly description: string;
|
|
199
|
+
readonly title: string;
|
|
200
|
+
};
|
|
201
|
+
readonly sitemap: true;
|
|
202
|
+
readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
|
|
239
203
|
}, E | ProjectionDecodeError | ProjectionOrderError | ProjectionRouteError, R>;
|
|
240
204
|
/** Authenticates a replayable projection stream against its signed manifest. */
|
|
241
205
|
export declare const verifyContentProjections: <E, R>(input: {
|
|
@@ -34,13 +34,8 @@ export declare const ActiveContentReleaseSchema: Schema.Struct<{
|
|
|
34
34
|
readonly routeCount: Schema.Finite;
|
|
35
35
|
readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
36
36
|
readonly scope: Schema.Struct<{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
40
|
-
readonly family: Schema.Literals<readonly ["article", "material", "page", "question"]>;
|
|
41
|
-
}>>>;
|
|
42
|
-
families: Schema.$Array<Schema.Literals<readonly ["article", "material", "page", "question"]>>;
|
|
43
|
-
snapshots: Schema.$Array<Schema.Literals<readonly ["program", "quran", "tryout"]>>;
|
|
37
|
+
readonly families: Schema.$Array<Schema.Literals<readonly ["article", "material", "page", "question"]>>;
|
|
38
|
+
readonly snapshots: Schema.$Array<Schema.Literals<readonly ["program", "quran", "tryout"]>>;
|
|
44
39
|
}>;
|
|
45
40
|
readonly snapshots: Schema.Struct<{
|
|
46
41
|
readonly program: Schema.Struct<{
|
|
@@ -174,13 +169,8 @@ export declare const ActiveRollbackContentReleaseSchema: Schema.refine<ActiveRol
|
|
|
174
169
|
readonly routeCount: Schema.Finite;
|
|
175
170
|
readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
176
171
|
readonly scope: Schema.Struct<{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
180
|
-
readonly family: Schema.Literals<readonly ["article", "material", "page", "question"]>;
|
|
181
|
-
}>>>;
|
|
182
|
-
families: Schema.$Array<Schema.Literals<readonly ["article", "material", "page", "question"]>>;
|
|
183
|
-
snapshots: Schema.$Array<Schema.Literals<readonly ["program", "quran", "tryout"]>>;
|
|
172
|
+
readonly families: Schema.$Array<Schema.Literals<readonly ["article", "material", "page", "question"]>>;
|
|
173
|
+
readonly snapshots: Schema.$Array<Schema.Literals<readonly ["program", "quran", "tryout"]>>;
|
|
184
174
|
}>;
|
|
185
175
|
readonly snapshots: Schema.Struct<{
|
|
186
176
|
readonly program: Schema.Struct<{
|
|
@@ -315,13 +305,8 @@ export declare const RecoveryLookupSchema: Schema.Union<readonly [Schema.Struct<
|
|
|
315
305
|
readonly routeCount: Schema.Finite;
|
|
316
306
|
readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
317
307
|
readonly scope: Schema.Struct<{
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
321
|
-
readonly family: Schema.Literals<readonly ["article", "material", "page", "question"]>;
|
|
322
|
-
}>>>;
|
|
323
|
-
families: Schema.$Array<Schema.Literals<readonly ["article", "material", "page", "question"]>>;
|
|
324
|
-
snapshots: Schema.$Array<Schema.Literals<readonly ["program", "quran", "tryout"]>>;
|
|
308
|
+
readonly families: Schema.$Array<Schema.Literals<readonly ["article", "material", "page", "question"]>>;
|
|
309
|
+
readonly snapshots: Schema.$Array<Schema.Literals<readonly ["program", "quran", "tryout"]>>;
|
|
325
310
|
}>;
|
|
326
311
|
readonly snapshots: Schema.Struct<{
|
|
327
312
|
readonly program: Schema.Struct<{
|