@nakafa/aksara-contracts 0.27.0 → 0.30.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 +13 -9
- package/dist/preview/artifact.d.ts +4 -32
- package/dist/preview/artifact.js +2 -2
- package/dist/preview/spec.d.ts +8 -64
- package/dist/projection/digest.d.ts +4 -74
- package/dist/projection/page.d.ts +1 -50
- package/dist/projection/page.js +9 -38
- package/dist/projection/question.d.ts +16 -184
- package/dist/projection/spec.d.ts +7 -253
- package/dist/projection/spec.js +2 -9
- package/dist/projection/verify.d.ts +4 -74
- package/dist/question/item.d.ts +24 -304
- package/dist/question/item.js +4 -4
- package/dist/question/response.d.ts +9 -97
- package/dist/question/response.js +8 -31
- package/dist/release/policy.d.ts +3 -0
- package/dist/release/policy.js +2 -0
- package/dist/release/rollback/spec.d.ts +36 -288
- package/dist/release/snapshot/data.d.ts +4 -32
- package/dist/release/snapshot/verify.d.ts +4 -60
- package/dist/renderer/compatibility.d.ts +49 -2
- package/dist/renderer/compatibility.js +49 -1
- package/dist/runtime/spec.d.ts +4 -46
- package/dist/runtime/verify.d.ts +0 -28
- package/dist/transport/batch.d.ts +8 -481
- package/dist/transport/batch.js +2 -14
- package/dist/transport/group.d.ts +50 -836
- package/dist/transport/group.js +1 -2
- package/dist/transport/request.d.ts +440 -2356
- package/dist/transport/response.d.ts +44 -436
- package/dist/transport/snapshot.d.ts +8 -64
- package/dist/tryout/content-hash.d.ts +4 -32
- package/dist/tryout/placement.d.ts +12 -96
- package/package.json +5 -1
|
@@ -40,27 +40,13 @@ export declare const QuestionPromptProjectionSchema: Schema.Struct<{
|
|
|
40
40
|
readonly response: Schema.Union<readonly [Schema.Struct<{
|
|
41
41
|
readonly categories: Schema.$Array<Schema.Struct<{
|
|
42
42
|
readonly categoryKey: Schema.String;
|
|
43
|
-
readonly label: Schema.
|
|
44
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
45
|
-
readonly kind: Schema.Literal<"math">;
|
|
46
|
-
readonly math: Schema.String;
|
|
47
|
-
}>, Schema.Struct<{
|
|
48
|
-
readonly kind: Schema.Literal<"text">;
|
|
49
|
-
readonly text: Schema.String;
|
|
50
|
-
}>]>>;
|
|
43
|
+
readonly label: Schema.String;
|
|
51
44
|
readonly order: Schema.Int;
|
|
52
45
|
}>>;
|
|
53
46
|
readonly kind: Schema.Literal<"category">;
|
|
54
47
|
readonly statements: Schema.$Array<Schema.Struct<{
|
|
55
48
|
readonly correctCategoryKey: Schema.String;
|
|
56
|
-
readonly label: Schema.
|
|
57
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
58
|
-
readonly kind: Schema.Literal<"math">;
|
|
59
|
-
readonly math: Schema.String;
|
|
60
|
-
}>, Schema.Struct<{
|
|
61
|
-
readonly kind: Schema.Literal<"text">;
|
|
62
|
-
readonly text: Schema.String;
|
|
63
|
-
}>]>>;
|
|
49
|
+
readonly label: Schema.String;
|
|
64
50
|
readonly order: Schema.Int;
|
|
65
51
|
readonly statementKey: Schema.String;
|
|
66
52
|
}>>;
|
|
@@ -68,14 +54,7 @@ export declare const QuestionPromptProjectionSchema: Schema.Struct<{
|
|
|
68
54
|
readonly kind: Schema.Literal<"multiple-choice">;
|
|
69
55
|
readonly options: Schema.$Array<Schema.Struct<{
|
|
70
56
|
readonly isCorrect: Schema.Boolean;
|
|
71
|
-
readonly label: Schema.
|
|
72
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
73
|
-
readonly kind: Schema.Literal<"math">;
|
|
74
|
-
readonly math: Schema.String;
|
|
75
|
-
}>, Schema.Struct<{
|
|
76
|
-
readonly kind: Schema.Literal<"text">;
|
|
77
|
-
readonly text: Schema.String;
|
|
78
|
-
}>]>>;
|
|
57
|
+
readonly label: Schema.String;
|
|
79
58
|
readonly optionKey: Schema.String;
|
|
80
59
|
readonly order: Schema.Int;
|
|
81
60
|
}>>;
|
|
@@ -83,14 +62,7 @@ export declare const QuestionPromptProjectionSchema: Schema.Struct<{
|
|
|
83
62
|
readonly kind: Schema.Literal<"single-choice">;
|
|
84
63
|
readonly options: Schema.$Array<Schema.Struct<{
|
|
85
64
|
readonly isCorrect: Schema.Boolean;
|
|
86
|
-
readonly label: Schema.
|
|
87
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
88
|
-
readonly kind: Schema.Literal<"math">;
|
|
89
|
-
readonly math: Schema.String;
|
|
90
|
-
}>, Schema.Struct<{
|
|
91
|
-
readonly kind: Schema.Literal<"text">;
|
|
92
|
-
readonly text: Schema.String;
|
|
93
|
-
}>]>>;
|
|
65
|
+
readonly label: Schema.String;
|
|
94
66
|
readonly optionKey: Schema.String;
|
|
95
67
|
readonly order: Schema.Int;
|
|
96
68
|
}>>;
|
|
@@ -150,27 +122,13 @@ export declare const QuestionBodyProjectionSchema: Schema.Union<readonly [Schema
|
|
|
150
122
|
readonly response: Schema.Union<readonly [Schema.Struct<{
|
|
151
123
|
readonly categories: Schema.$Array<Schema.Struct<{
|
|
152
124
|
readonly categoryKey: Schema.String;
|
|
153
|
-
readonly label: Schema.
|
|
154
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
155
|
-
readonly kind: Schema.Literal<"math">;
|
|
156
|
-
readonly math: Schema.String;
|
|
157
|
-
}>, Schema.Struct<{
|
|
158
|
-
readonly kind: Schema.Literal<"text">;
|
|
159
|
-
readonly text: Schema.String;
|
|
160
|
-
}>]>>;
|
|
125
|
+
readonly label: Schema.String;
|
|
161
126
|
readonly order: Schema.Int;
|
|
162
127
|
}>>;
|
|
163
128
|
readonly kind: Schema.Literal<"category">;
|
|
164
129
|
readonly statements: Schema.$Array<Schema.Struct<{
|
|
165
130
|
readonly correctCategoryKey: Schema.String;
|
|
166
|
-
readonly label: Schema.
|
|
167
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
168
|
-
readonly kind: Schema.Literal<"math">;
|
|
169
|
-
readonly math: Schema.String;
|
|
170
|
-
}>, Schema.Struct<{
|
|
171
|
-
readonly kind: Schema.Literal<"text">;
|
|
172
|
-
readonly text: Schema.String;
|
|
173
|
-
}>]>>;
|
|
131
|
+
readonly label: Schema.String;
|
|
174
132
|
readonly order: Schema.Int;
|
|
175
133
|
readonly statementKey: Schema.String;
|
|
176
134
|
}>>;
|
|
@@ -178,14 +136,7 @@ export declare const QuestionBodyProjectionSchema: Schema.Union<readonly [Schema
|
|
|
178
136
|
readonly kind: Schema.Literal<"multiple-choice">;
|
|
179
137
|
readonly options: Schema.$Array<Schema.Struct<{
|
|
180
138
|
readonly isCorrect: Schema.Boolean;
|
|
181
|
-
readonly label: Schema.
|
|
182
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
183
|
-
readonly kind: Schema.Literal<"math">;
|
|
184
|
-
readonly math: Schema.String;
|
|
185
|
-
}>, Schema.Struct<{
|
|
186
|
-
readonly kind: Schema.Literal<"text">;
|
|
187
|
-
readonly text: Schema.String;
|
|
188
|
-
}>]>>;
|
|
139
|
+
readonly label: Schema.String;
|
|
189
140
|
readonly optionKey: Schema.String;
|
|
190
141
|
readonly order: Schema.Int;
|
|
191
142
|
}>>;
|
|
@@ -193,14 +144,7 @@ export declare const QuestionBodyProjectionSchema: Schema.Union<readonly [Schema
|
|
|
193
144
|
readonly kind: Schema.Literal<"single-choice">;
|
|
194
145
|
readonly options: Schema.$Array<Schema.Struct<{
|
|
195
146
|
readonly isCorrect: Schema.Boolean;
|
|
196
|
-
readonly label: Schema.
|
|
197
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
198
|
-
readonly kind: Schema.Literal<"math">;
|
|
199
|
-
readonly math: Schema.String;
|
|
200
|
-
}>, Schema.Struct<{
|
|
201
|
-
readonly kind: Schema.Literal<"text">;
|
|
202
|
-
readonly text: Schema.String;
|
|
203
|
-
}>]>>;
|
|
147
|
+
readonly label: Schema.String;
|
|
204
148
|
readonly optionKey: Schema.String;
|
|
205
149
|
readonly order: Schema.Int;
|
|
206
150
|
}>>;
|
|
@@ -270,41 +214,13 @@ export declare const makeQuestionPromptProjection: (input: QuestionProjectionInp
|
|
|
270
214
|
response: {
|
|
271
215
|
readonly categories: readonly {
|
|
272
216
|
readonly categoryKey: string;
|
|
273
|
-
readonly label:
|
|
274
|
-
readonly display: "block" | "inline";
|
|
275
|
-
readonly kind: "math";
|
|
276
|
-
readonly math: string;
|
|
277
|
-
} | {
|
|
278
|
-
readonly kind: "text";
|
|
279
|
-
readonly text: string;
|
|
280
|
-
}, ...({
|
|
281
|
-
readonly display: "block" | "inline";
|
|
282
|
-
readonly kind: "math";
|
|
283
|
-
readonly math: string;
|
|
284
|
-
} | {
|
|
285
|
-
readonly kind: "text";
|
|
286
|
-
readonly text: string;
|
|
287
|
-
})[]];
|
|
217
|
+
readonly label: string;
|
|
288
218
|
readonly order: number;
|
|
289
219
|
}[];
|
|
290
220
|
readonly kind: "category";
|
|
291
221
|
readonly statements: readonly {
|
|
292
222
|
readonly correctCategoryKey: string;
|
|
293
|
-
readonly label:
|
|
294
|
-
readonly display: "block" | "inline";
|
|
295
|
-
readonly kind: "math";
|
|
296
|
-
readonly math: string;
|
|
297
|
-
} | {
|
|
298
|
-
readonly kind: "text";
|
|
299
|
-
readonly text: string;
|
|
300
|
-
}, ...({
|
|
301
|
-
readonly display: "block" | "inline";
|
|
302
|
-
readonly kind: "math";
|
|
303
|
-
readonly math: string;
|
|
304
|
-
} | {
|
|
305
|
-
readonly kind: "text";
|
|
306
|
-
readonly text: string;
|
|
307
|
-
})[]];
|
|
223
|
+
readonly label: string;
|
|
308
224
|
readonly order: number;
|
|
309
225
|
readonly statementKey: string;
|
|
310
226
|
}[];
|
|
@@ -312,21 +228,7 @@ export declare const makeQuestionPromptProjection: (input: QuestionProjectionInp
|
|
|
312
228
|
readonly kind: "multiple-choice";
|
|
313
229
|
readonly options: readonly {
|
|
314
230
|
readonly isCorrect: boolean;
|
|
315
|
-
readonly label:
|
|
316
|
-
readonly display: "block" | "inline";
|
|
317
|
-
readonly kind: "math";
|
|
318
|
-
readonly math: string;
|
|
319
|
-
} | {
|
|
320
|
-
readonly kind: "text";
|
|
321
|
-
readonly text: string;
|
|
322
|
-
}, ...({
|
|
323
|
-
readonly display: "block" | "inline";
|
|
324
|
-
readonly kind: "math";
|
|
325
|
-
readonly math: string;
|
|
326
|
-
} | {
|
|
327
|
-
readonly kind: "text";
|
|
328
|
-
readonly text: string;
|
|
329
|
-
})[]];
|
|
231
|
+
readonly label: string;
|
|
330
232
|
readonly optionKey: string;
|
|
331
233
|
readonly order: number;
|
|
332
234
|
}[];
|
|
@@ -334,21 +236,7 @@ export declare const makeQuestionPromptProjection: (input: QuestionProjectionInp
|
|
|
334
236
|
readonly kind: "single-choice";
|
|
335
237
|
readonly options: readonly {
|
|
336
238
|
readonly isCorrect: boolean;
|
|
337
|
-
readonly label:
|
|
338
|
-
readonly display: "block" | "inline";
|
|
339
|
-
readonly kind: "math";
|
|
340
|
-
readonly math: string;
|
|
341
|
-
} | {
|
|
342
|
-
readonly kind: "text";
|
|
343
|
-
readonly text: string;
|
|
344
|
-
}, ...({
|
|
345
|
-
readonly display: "block" | "inline";
|
|
346
|
-
readonly kind: "math";
|
|
347
|
-
readonly math: string;
|
|
348
|
-
} | {
|
|
349
|
-
readonly kind: "text";
|
|
350
|
-
readonly text: string;
|
|
351
|
-
})[]];
|
|
239
|
+
readonly label: string;
|
|
352
240
|
readonly optionKey: string;
|
|
353
241
|
readonly order: number;
|
|
354
242
|
}[];
|
|
@@ -408,41 +296,13 @@ export declare const makeQuestionBodyProjection: (input: QuestionProjectionInput
|
|
|
408
296
|
response: {
|
|
409
297
|
readonly categories: readonly {
|
|
410
298
|
readonly categoryKey: string;
|
|
411
|
-
readonly label:
|
|
412
|
-
readonly display: "block" | "inline";
|
|
413
|
-
readonly kind: "math";
|
|
414
|
-
readonly math: string;
|
|
415
|
-
} | {
|
|
416
|
-
readonly kind: "text";
|
|
417
|
-
readonly text: string;
|
|
418
|
-
}, ...({
|
|
419
|
-
readonly display: "block" | "inline";
|
|
420
|
-
readonly kind: "math";
|
|
421
|
-
readonly math: string;
|
|
422
|
-
} | {
|
|
423
|
-
readonly kind: "text";
|
|
424
|
-
readonly text: string;
|
|
425
|
-
})[]];
|
|
299
|
+
readonly label: string;
|
|
426
300
|
readonly order: number;
|
|
427
301
|
}[];
|
|
428
302
|
readonly kind: "category";
|
|
429
303
|
readonly statements: readonly {
|
|
430
304
|
readonly correctCategoryKey: string;
|
|
431
|
-
readonly label:
|
|
432
|
-
readonly display: "block" | "inline";
|
|
433
|
-
readonly kind: "math";
|
|
434
|
-
readonly math: string;
|
|
435
|
-
} | {
|
|
436
|
-
readonly kind: "text";
|
|
437
|
-
readonly text: string;
|
|
438
|
-
}, ...({
|
|
439
|
-
readonly display: "block" | "inline";
|
|
440
|
-
readonly kind: "math";
|
|
441
|
-
readonly math: string;
|
|
442
|
-
} | {
|
|
443
|
-
readonly kind: "text";
|
|
444
|
-
readonly text: string;
|
|
445
|
-
})[]];
|
|
305
|
+
readonly label: string;
|
|
446
306
|
readonly order: number;
|
|
447
307
|
readonly statementKey: string;
|
|
448
308
|
}[];
|
|
@@ -450,21 +310,7 @@ export declare const makeQuestionBodyProjection: (input: QuestionProjectionInput
|
|
|
450
310
|
readonly kind: "multiple-choice";
|
|
451
311
|
readonly options: readonly {
|
|
452
312
|
readonly isCorrect: boolean;
|
|
453
|
-
readonly label:
|
|
454
|
-
readonly display: "block" | "inline";
|
|
455
|
-
readonly kind: "math";
|
|
456
|
-
readonly math: string;
|
|
457
|
-
} | {
|
|
458
|
-
readonly kind: "text";
|
|
459
|
-
readonly text: string;
|
|
460
|
-
}, ...({
|
|
461
|
-
readonly display: "block" | "inline";
|
|
462
|
-
readonly kind: "math";
|
|
463
|
-
readonly math: string;
|
|
464
|
-
} | {
|
|
465
|
-
readonly kind: "text";
|
|
466
|
-
readonly text: string;
|
|
467
|
-
})[]];
|
|
313
|
+
readonly label: string;
|
|
468
314
|
readonly optionKey: string;
|
|
469
315
|
readonly order: number;
|
|
470
316
|
}[];
|
|
@@ -472,21 +318,7 @@ export declare const makeQuestionBodyProjection: (input: QuestionProjectionInput
|
|
|
472
318
|
readonly kind: "single-choice";
|
|
473
319
|
readonly options: readonly {
|
|
474
320
|
readonly isCorrect: boolean;
|
|
475
|
-
readonly label:
|
|
476
|
-
readonly display: "block" | "inline";
|
|
477
|
-
readonly kind: "math";
|
|
478
|
-
readonly math: string;
|
|
479
|
-
} | {
|
|
480
|
-
readonly kind: "text";
|
|
481
|
-
readonly text: string;
|
|
482
|
-
}, ...({
|
|
483
|
-
readonly display: "block" | "inline";
|
|
484
|
-
readonly kind: "math";
|
|
485
|
-
readonly math: string;
|
|
486
|
-
} | {
|
|
487
|
-
readonly kind: "text";
|
|
488
|
-
readonly text: string;
|
|
489
|
-
})[]];
|
|
321
|
+
readonly label: string;
|
|
490
322
|
readonly optionKey: string;
|
|
491
323
|
readonly order: number;
|
|
492
324
|
}[];
|
|
@@ -68,210 +68,6 @@ export declare const ContentProjectionSchema: Schema.Union<readonly [Schema.Stru
|
|
|
68
68
|
readonly parentPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
69
69
|
readonly sitemap: Schema.Literal<true>;
|
|
70
70
|
readonly topicTitle: Schema.String;
|
|
71
|
-
}>, Schema.Union<readonly [Schema.Struct<{
|
|
72
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
73
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
74
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
75
|
-
readonly pageKey: Schema.brand<Schema.String, "@NakafaAI/AksaraPageKey">;
|
|
76
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
77
|
-
readonly kind: Schema.Literal<"public-page">;
|
|
78
|
-
readonly metadata: Schema.Struct<{
|
|
79
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
80
|
-
readonly datePublished: Schema.String;
|
|
81
|
-
readonly description: Schema.Trimmed;
|
|
82
|
-
readonly title: Schema.Trimmed;
|
|
83
|
-
}>;
|
|
84
|
-
readonly sitemap: Schema.Literal<true>;
|
|
85
|
-
readonly sourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
86
|
-
}>, Schema.Struct<{
|
|
87
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
88
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
89
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
90
|
-
readonly pageKey: Schema.brand<Schema.String, "@NakafaAI/AksaraPageKey">;
|
|
91
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
92
|
-
readonly kind: Schema.Literal<"public-page">;
|
|
93
|
-
readonly metadata: Schema.Struct<{
|
|
94
|
-
readonly description: Schema.Trimmed;
|
|
95
|
-
readonly lastModified: Schema.String;
|
|
96
|
-
readonly title: Schema.Trimmed;
|
|
97
|
-
}>;
|
|
98
|
-
readonly sitemap: Schema.Literal<true>;
|
|
99
|
-
readonly sourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
100
|
-
}>]>, Schema.Union<readonly [Schema.Struct<{
|
|
101
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
102
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
103
|
-
readonly peerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
104
|
-
readonly questionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionKey">;
|
|
105
|
-
readonly questionNumber: Schema.Finite;
|
|
106
|
-
readonly setKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionSetKey">;
|
|
107
|
-
readonly bodyKind: Schema.Literal<"question">;
|
|
108
|
-
readonly blueprint: Schema.optionalKey<Schema.Struct<{
|
|
109
|
-
readonly cognitiveLevel: Schema.String;
|
|
110
|
-
readonly contentDomain: Schema.String;
|
|
111
|
-
readonly topic: Schema.String;
|
|
112
|
-
}>>;
|
|
113
|
-
readonly kind: Schema.Literal<"question-body">;
|
|
114
|
-
readonly metadata: Schema.Struct<{
|
|
115
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
116
|
-
readonly datePublished: Schema.String;
|
|
117
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
118
|
-
readonly name: Schema.String;
|
|
119
|
-
}>>;
|
|
120
|
-
readonly title: Schema.String;
|
|
121
|
-
}>;
|
|
122
|
-
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
123
|
-
readonly response: Schema.Union<readonly [Schema.Struct<{
|
|
124
|
-
readonly categories: Schema.$Array<Schema.Struct<{
|
|
125
|
-
readonly categoryKey: Schema.String;
|
|
126
|
-
readonly label: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
127
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
128
|
-
readonly kind: Schema.Literal<"math">;
|
|
129
|
-
readonly math: Schema.String;
|
|
130
|
-
}>, Schema.Struct<{
|
|
131
|
-
readonly kind: Schema.Literal<"text">;
|
|
132
|
-
readonly text: Schema.String;
|
|
133
|
-
}>]>>;
|
|
134
|
-
readonly order: Schema.Int;
|
|
135
|
-
}>>;
|
|
136
|
-
readonly kind: Schema.Literal<"category">;
|
|
137
|
-
readonly statements: Schema.$Array<Schema.Struct<{
|
|
138
|
-
readonly correctCategoryKey: Schema.String;
|
|
139
|
-
readonly label: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
140
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
141
|
-
readonly kind: Schema.Literal<"math">;
|
|
142
|
-
readonly math: Schema.String;
|
|
143
|
-
}>, Schema.Struct<{
|
|
144
|
-
readonly kind: Schema.Literal<"text">;
|
|
145
|
-
readonly text: Schema.String;
|
|
146
|
-
}>]>>;
|
|
147
|
-
readonly order: Schema.Int;
|
|
148
|
-
readonly statementKey: Schema.String;
|
|
149
|
-
}>>;
|
|
150
|
-
}>, Schema.Struct<{
|
|
151
|
-
readonly kind: Schema.Literal<"multiple-choice">;
|
|
152
|
-
readonly options: Schema.$Array<Schema.Struct<{
|
|
153
|
-
readonly isCorrect: Schema.Boolean;
|
|
154
|
-
readonly label: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
155
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
156
|
-
readonly kind: Schema.Literal<"math">;
|
|
157
|
-
readonly math: Schema.String;
|
|
158
|
-
}>, Schema.Struct<{
|
|
159
|
-
readonly kind: Schema.Literal<"text">;
|
|
160
|
-
readonly text: Schema.String;
|
|
161
|
-
}>]>>;
|
|
162
|
-
readonly optionKey: Schema.String;
|
|
163
|
-
readonly order: Schema.Int;
|
|
164
|
-
}>>;
|
|
165
|
-
}>, Schema.Struct<{
|
|
166
|
-
readonly kind: Schema.Literal<"single-choice">;
|
|
167
|
-
readonly options: Schema.$Array<Schema.Struct<{
|
|
168
|
-
readonly isCorrect: Schema.Boolean;
|
|
169
|
-
readonly label: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
170
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
171
|
-
readonly kind: Schema.Literal<"math">;
|
|
172
|
-
readonly math: Schema.String;
|
|
173
|
-
}>, Schema.Struct<{
|
|
174
|
-
readonly kind: Schema.Literal<"text">;
|
|
175
|
-
readonly text: Schema.String;
|
|
176
|
-
}>]>>;
|
|
177
|
-
readonly optionKey: Schema.String;
|
|
178
|
-
readonly order: Schema.Int;
|
|
179
|
-
}>>;
|
|
180
|
-
}>]>;
|
|
181
|
-
}>, Schema.Struct<{
|
|
182
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
183
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
184
|
-
readonly peerContentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
185
|
-
readonly questionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionKey">;
|
|
186
|
-
readonly questionNumber: Schema.Finite;
|
|
187
|
-
readonly setKey: Schema.brand<Schema.String, "@NakafaAI/AksaraQuestionSetKey">;
|
|
188
|
-
readonly bodyKind: Schema.Literal<"answer">;
|
|
189
|
-
readonly blueprint: Schema.optionalKey<Schema.Struct<{
|
|
190
|
-
readonly cognitiveLevel: Schema.String;
|
|
191
|
-
readonly contentDomain: Schema.String;
|
|
192
|
-
readonly topic: Schema.String;
|
|
193
|
-
}>>;
|
|
194
|
-
readonly kind: Schema.Literal<"question-body">;
|
|
195
|
-
readonly metadata: Schema.Struct<{
|
|
196
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
197
|
-
readonly datePublished: Schema.String;
|
|
198
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
199
|
-
readonly name: Schema.String;
|
|
200
|
-
}>>;
|
|
201
|
-
readonly title: Schema.String;
|
|
202
|
-
}>;
|
|
203
|
-
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
204
|
-
}>]>]>;
|
|
205
|
-
export type ContentProjection = typeof ContentProjectionSchema.Type;
|
|
206
|
-
/** Current projection vocabulary accepted for newly staged content. */
|
|
207
|
-
export declare const CurrentContentProjectionSchema: Schema.Union<readonly [Schema.Struct<{
|
|
208
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
209
|
-
readonly articleRouteSlug: Schema.brand<Schema.String, "@NakafaAI/AksaraArticleRouteSlug">;
|
|
210
|
-
readonly articleSlug: Schema.brand<Schema.String, "@NakafaAI/AksaraArticleSlug">;
|
|
211
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
212
|
-
readonly category: Schema.brand<Schema.String, "@NakafaAI/AksaraArticleCategory">;
|
|
213
|
-
readonly categoryRouteSlug: Schema.brand<Schema.String, "@NakafaAI/AksaraArticleRouteSlug">;
|
|
214
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
215
|
-
readonly graph: Schema.Struct<{
|
|
216
|
-
readonly alignmentId: Schema.String;
|
|
217
|
-
readonly assetId: Schema.String;
|
|
218
|
-
readonly conceptId: Schema.String;
|
|
219
|
-
readonly learningObjectId: Schema.String;
|
|
220
|
-
readonly lensId: Schema.String;
|
|
221
|
-
}>;
|
|
222
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
223
|
-
readonly categoryTitle: Schema.Trimmed;
|
|
224
|
-
readonly kind: Schema.Literal<"article">;
|
|
225
|
-
readonly metadata: Schema.Struct<{
|
|
226
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
227
|
-
readonly datePublished: Schema.String;
|
|
228
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
229
|
-
readonly name: Schema.String;
|
|
230
|
-
}>>;
|
|
231
|
-
readonly description: Schema.optional<Schema.String>;
|
|
232
|
-
readonly title: Schema.String;
|
|
233
|
-
}>;
|
|
234
|
-
readonly official: Schema.Boolean;
|
|
235
|
-
readonly parentPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
236
|
-
readonly references: Schema.$Array<Schema.Struct<{
|
|
237
|
-
readonly authors: Schema.String;
|
|
238
|
-
readonly citation: Schema.optional<Schema.String>;
|
|
239
|
-
readonly details: Schema.optional<Schema.String>;
|
|
240
|
-
readonly publication: Schema.optional<Schema.String>;
|
|
241
|
-
readonly title: Schema.String;
|
|
242
|
-
readonly url: Schema.optional<Schema.String>;
|
|
243
|
-
readonly year: Schema.Finite;
|
|
244
|
-
}>>;
|
|
245
|
-
readonly sitemap: Schema.Literal<true>;
|
|
246
|
-
}>, Schema.Struct<{
|
|
247
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
248
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
249
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
250
|
-
readonly graph: Schema.Struct<{
|
|
251
|
-
readonly alignmentId: Schema.String;
|
|
252
|
-
readonly assetId: Schema.String;
|
|
253
|
-
readonly conceptId: Schema.String;
|
|
254
|
-
readonly learningObjectId: Schema.String;
|
|
255
|
-
readonly lensId: Schema.String;
|
|
256
|
-
}>;
|
|
257
|
-
readonly materialKey: Schema.brand<Schema.String, "@NakafaAI/AksaraMaterialKey">;
|
|
258
|
-
readonly order: Schema.Finite;
|
|
259
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
260
|
-
readonly sectionKey: Schema.brand<Schema.String, "@NakafaAI/AksaraMaterialSection">;
|
|
261
|
-
readonly kind: Schema.Literal<"subject-lesson">;
|
|
262
|
-
readonly metadata: Schema.Struct<{
|
|
263
|
-
readonly dateModified: Schema.optionalKey<Schema.String>;
|
|
264
|
-
readonly datePublished: Schema.String;
|
|
265
|
-
readonly authors: Schema.$Array<Schema.Struct<{
|
|
266
|
-
readonly name: Schema.String;
|
|
267
|
-
}>>;
|
|
268
|
-
readonly description: Schema.optional<Schema.String>;
|
|
269
|
-
readonly subject: Schema.optional<Schema.String>;
|
|
270
|
-
readonly title: Schema.String;
|
|
271
|
-
}>;
|
|
272
|
-
readonly parentPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
273
|
-
readonly sitemap: Schema.Literal<true>;
|
|
274
|
-
readonly topicTitle: Schema.String;
|
|
275
71
|
}>, Schema.Struct<{
|
|
276
72
|
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
277
73
|
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
@@ -313,27 +109,13 @@ export declare const CurrentContentProjectionSchema: Schema.Union<readonly [Sche
|
|
|
313
109
|
readonly response: Schema.Union<readonly [Schema.Struct<{
|
|
314
110
|
readonly categories: Schema.$Array<Schema.Struct<{
|
|
315
111
|
readonly categoryKey: Schema.String;
|
|
316
|
-
readonly label: Schema.
|
|
317
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
318
|
-
readonly kind: Schema.Literal<"math">;
|
|
319
|
-
readonly math: Schema.String;
|
|
320
|
-
}>, Schema.Struct<{
|
|
321
|
-
readonly kind: Schema.Literal<"text">;
|
|
322
|
-
readonly text: Schema.String;
|
|
323
|
-
}>]>>;
|
|
112
|
+
readonly label: Schema.String;
|
|
324
113
|
readonly order: Schema.Int;
|
|
325
114
|
}>>;
|
|
326
115
|
readonly kind: Schema.Literal<"category">;
|
|
327
116
|
readonly statements: Schema.$Array<Schema.Struct<{
|
|
328
117
|
readonly correctCategoryKey: Schema.String;
|
|
329
|
-
readonly label: Schema.
|
|
330
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
331
|
-
readonly kind: Schema.Literal<"math">;
|
|
332
|
-
readonly math: Schema.String;
|
|
333
|
-
}>, Schema.Struct<{
|
|
334
|
-
readonly kind: Schema.Literal<"text">;
|
|
335
|
-
readonly text: Schema.String;
|
|
336
|
-
}>]>>;
|
|
118
|
+
readonly label: Schema.String;
|
|
337
119
|
readonly order: Schema.Int;
|
|
338
120
|
readonly statementKey: Schema.String;
|
|
339
121
|
}>>;
|
|
@@ -341,14 +123,7 @@ export declare const CurrentContentProjectionSchema: Schema.Union<readonly [Sche
|
|
|
341
123
|
readonly kind: Schema.Literal<"multiple-choice">;
|
|
342
124
|
readonly options: Schema.$Array<Schema.Struct<{
|
|
343
125
|
readonly isCorrect: Schema.Boolean;
|
|
344
|
-
readonly label: Schema.
|
|
345
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
346
|
-
readonly kind: Schema.Literal<"math">;
|
|
347
|
-
readonly math: Schema.String;
|
|
348
|
-
}>, Schema.Struct<{
|
|
349
|
-
readonly kind: Schema.Literal<"text">;
|
|
350
|
-
readonly text: Schema.String;
|
|
351
|
-
}>]>>;
|
|
126
|
+
readonly label: Schema.String;
|
|
352
127
|
readonly optionKey: Schema.String;
|
|
353
128
|
readonly order: Schema.Int;
|
|
354
129
|
}>>;
|
|
@@ -356,14 +131,7 @@ export declare const CurrentContentProjectionSchema: Schema.Union<readonly [Sche
|
|
|
356
131
|
readonly kind: Schema.Literal<"single-choice">;
|
|
357
132
|
readonly options: Schema.$Array<Schema.Struct<{
|
|
358
133
|
readonly isCorrect: Schema.Boolean;
|
|
359
|
-
readonly label: Schema.
|
|
360
|
-
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
361
|
-
readonly kind: Schema.Literal<"math">;
|
|
362
|
-
readonly math: Schema.String;
|
|
363
|
-
}>, Schema.Struct<{
|
|
364
|
-
readonly kind: Schema.Literal<"text">;
|
|
365
|
-
readonly text: Schema.String;
|
|
366
|
-
}>]>>;
|
|
134
|
+
readonly label: Schema.String;
|
|
367
135
|
readonly optionKey: Schema.String;
|
|
368
136
|
readonly order: Schema.Int;
|
|
369
137
|
}>>;
|
|
@@ -392,7 +160,7 @@ export declare const CurrentContentProjectionSchema: Schema.Union<readonly [Sche
|
|
|
392
160
|
}>;
|
|
393
161
|
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
394
162
|
}>]>]>;
|
|
395
|
-
export type
|
|
163
|
+
export type ContentProjection = typeof ContentProjectionSchema.Type;
|
|
396
164
|
/** Public-route projections accepted by Nakafa's path-based runtime seam. */
|
|
397
165
|
export declare const RoutedContentProjectionSchema: Schema.Union<readonly [Schema.Struct<{
|
|
398
166
|
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
@@ -462,7 +230,7 @@ export declare const RoutedContentProjectionSchema: Schema.Union<readonly [Schem
|
|
|
462
230
|
readonly parentPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
463
231
|
readonly sitemap: Schema.Literal<true>;
|
|
464
232
|
readonly topicTitle: Schema.String;
|
|
465
|
-
}>, Schema.
|
|
233
|
+
}>, Schema.Struct<{
|
|
466
234
|
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
467
235
|
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
468
236
|
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
@@ -477,21 +245,7 @@ export declare const RoutedContentProjectionSchema: Schema.Union<readonly [Schem
|
|
|
477
245
|
}>;
|
|
478
246
|
readonly sitemap: Schema.Literal<true>;
|
|
479
247
|
readonly sourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
480
|
-
}
|
|
481
|
-
readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
|
|
482
|
-
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
483
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
484
|
-
readonly pageKey: Schema.brand<Schema.String, "@NakafaAI/AksaraPageKey">;
|
|
485
|
-
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
486
|
-
readonly kind: Schema.Literal<"public-page">;
|
|
487
|
-
readonly metadata: Schema.Struct<{
|
|
488
|
-
readonly description: Schema.Trimmed;
|
|
489
|
-
readonly lastModified: Schema.String;
|
|
490
|
-
readonly title: Schema.Trimmed;
|
|
491
|
-
}>;
|
|
492
|
-
readonly sitemap: Schema.Literal<true>;
|
|
493
|
-
readonly sourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
494
|
-
}>]>]>;
|
|
248
|
+
}>]>;
|
|
495
249
|
export type RoutedContentProjection = typeof RoutedContentProjectionSchema.Type;
|
|
496
250
|
/** Returns the release family that owns one discriminated projection. */
|
|
497
251
|
export declare function familyForProjection(projection: ContentProjection): "article" | "material" | "page" | "question";
|
package/dist/projection/spec.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { Match, Schema } from "effect";
|
|
2
2
|
import { ArticleProjectionSchema, canonicalizeArticleProjection, } from "#contracts/projection/article";
|
|
3
3
|
import { canonicalizeMaterialProjection, MaterialLessonProjectionSchema, } from "#contracts/projection/material";
|
|
4
|
-
import { canonicalizePublicPageProjection, PublicPageProjectionSchema,
|
|
4
|
+
import { canonicalizePublicPageProjection, PublicPageProjectionSchema, } from "#contracts/projection/page";
|
|
5
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
|
-
ReadablePublicPageProjectionSchema,
|
|
11
|
-
QuestionBodyProjectionSchema,
|
|
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,
|
|
@@ -21,7 +14,7 @@ export const CurrentContentProjectionSchema = Schema.Union([
|
|
|
21
14
|
export const RoutedContentProjectionSchema = Schema.Union([
|
|
22
15
|
ArticleProjectionSchema,
|
|
23
16
|
MaterialLessonProjectionSchema,
|
|
24
|
-
|
|
17
|
+
PublicPageProjectionSchema,
|
|
25
18
|
]);
|
|
26
19
|
const matchProjectionFamily = Match.type().pipe(Match.discriminatorsExhaustive("kind")({
|
|
27
20
|
article: () => "article",
|