@altnovatrail/spec 0.12.0 → 0.13.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 +4 -1
- package/legalv1/index.d.ts +296 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @altnovatrail/spec
|
|
2
2
|
|
|
3
|
-
The types of [NovaTrail](https://github.com/altnovatrail)'s module format for TypeScript, from 0.8.0 on those of its admission table,
|
|
3
|
+
The types of [NovaTrail](https://github.com/altnovatrail)'s module format for TypeScript, from 0.8.0 on those of its admission table, from 0.11.0 on those of its deployment configuration, and from 0.13.0 on those of the passport of its legal texts. The package covers:
|
|
4
4
|
- the parts of a module and their open views;
|
|
5
5
|
- the canonical view and the inventory of a package;
|
|
6
6
|
- the module index;
|
|
@@ -16,6 +16,8 @@ From 0.10.0 on, it holds the page of the workbook too, which format 0.4 makes a
|
|
|
16
16
|
|
|
17
17
|
From 0.11.0 on, it holds the types of the deployment configuration too: the file `/deployment.json`, which the learner's app reads at its start from the root of its origin, with the origin of the platform's API and the parameters of the sign-in service ([the format's text](https://github.com/altnovatrail/spec/blob/main/deployment/README.md)). They are generated from its schemas, `deployment/schemas`, as the format's are, and the fields of the file keep their names in camelCase, such as `signIn.apiKey`.
|
|
18
18
|
|
|
19
|
+
From 0.13.0 on, it holds the types of the legal texts' passport too, `legal/legal.yaml`: each text of the platform — the privacy policy, the terms of use, the consents and the forms —, where it is shown, its versions with their status, the date each came into force and its gist in each language of the interface, and the sets of texts of the samples page ([the part's text](https://github.com/altnovatrail/spec/blob/main/legal/README.md)). The words of each version are a Markdown file of their own, `legal/texts/<id>/<n>.md`, which no type holds. They are generated from the part's schemas, `legal/schemas`, as the format's are.
|
|
20
|
+
|
|
19
21
|
The types are declarations alone, with no code to run, so import them with `import type`; the page's JSON is data, which a module imports with `with { type: "json" }` or reads as a file:
|
|
20
22
|
|
|
21
23
|
```ts
|
|
@@ -36,6 +38,7 @@ function show(task: open.Task, manifest: open.Manifest) {
|
|
|
36
38
|
- **`@altnovatrail/spec/formatv0/open`** holds the open view of each part, which is what the learner's app gets ([the format's text](https://github.com/altnovatrail/spec/blob/main/format/README.md#6-open-fields), section 6). Each type keeps its name from `formatv0` and only the fields marked `x-open`, so an open view has no check, no template and no solver.
|
|
37
39
|
- **`@altnovatrail/spec/admissionv0`** holds the types of the admission table's major version 0: the table, with its providers, deployment facts, rules of capabilities and cells, and the test vectors of the admission function's answers.
|
|
38
40
|
- **`@altnovatrail/spec/deploymentv1`** holds the types of the deployment configuration's version 1: the file, `Deployment`, and the test vectors of reading it, `ReadingVector`, whose file is any JSON value, `unknown`. A type gives the shape alone: a reader checks the file against its schema and then against the rules of reading, section 5 of the format's text.
|
|
41
|
+
- **`@altnovatrail/spec/legalv1`** holds the types of version 1 of the legal texts: the passport, `Legal`, with each `Text` and its `TextVersion`, each `Set` and its `SetVersion`, and the test vectors of reading the part, `ReadingVector`, whose passport is any JSON value, `unknown`. A type gives the shape alone: a reader checks the passport against its schema and then the part against the rules of reading, section 5 of the part's text.
|
|
39
42
|
- **`@altnovatrail/spec/canvas`** holds the types of `<novatrail-canvas>`:
|
|
40
43
|
- `CanvasElement`, which describes the element's properties `tool`, `task`, `workedExample`, `demoState`, `manifest`, `media`, `history`, `marks` and `filled` and its method `exportWork()`;
|
|
41
44
|
- `Media`, the function by which the consumer gives the files of the pictures: the canvas goes to no network;
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
// Code generated by tools/types from legal/schemas; DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The types of the legal texts, version 1 of the part, generated from the schemas in legal/schemas
|
|
5
|
+
* by tools/types (R72, R73 and R130 in spec's docs/decisions.md): the same types as the Go package
|
|
6
|
+
* legalv1, by the same names — the passport legal/legal.yaml, with the texts, their versions and
|
|
7
|
+
* the sets of texts of the samples page, and the vectors of reading. The words of a version are a
|
|
8
|
+
* file of their own, texts/<id>/<n>.md, which no type holds. A vector's passport is any JSON value,
|
|
9
|
+
* unknown, as a reader gets it. The schemas decide what is valid: a type gives the shape of a value
|
|
10
|
+
* alone, and code that reads a value from elsewhere checks it against its schema first, and then
|
|
11
|
+
* against the rules of reading (legal/README.md, section 5). A field the object always holds is
|
|
12
|
+
* required; any other is optional.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// The types of legal.schema.json.
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Legal is the type of legal.schema.json.
|
|
21
|
+
*
|
|
22
|
+
* The passport of the legal texts, legal/legal.yaml (section 4 of the legal text): the texts, their
|
|
23
|
+
* versions with their status, date and summary, and the sets of texts of the samples page.
|
|
24
|
+
*/
|
|
25
|
+
export interface Legal {
|
|
26
|
+
/**
|
|
27
|
+
* The version of the part, the integer in legal/VERSION.
|
|
28
|
+
*/
|
|
29
|
+
readonly format: number;
|
|
30
|
+
/**
|
|
31
|
+
* The texts, by their IDs.
|
|
32
|
+
*/
|
|
33
|
+
readonly texts: Readonly<Record<ID, Text>>;
|
|
34
|
+
/**
|
|
35
|
+
* The sets of texts of the samples page, by their IDs.
|
|
36
|
+
*/
|
|
37
|
+
readonly sets: Readonly<Record<SetID, Set>>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* ID is the type of legal.schema.json#/$defs/id.
|
|
42
|
+
*
|
|
43
|
+
* The ID of a text or of a set: lower-case Latin letters and digits in words joined by hyphens,
|
|
44
|
+
* beginning with a letter.
|
|
45
|
+
*/
|
|
46
|
+
export type ID = string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Text is the type of legal.schema.json#/$defs/text.
|
|
50
|
+
*/
|
|
51
|
+
export interface Text {
|
|
52
|
+
/**
|
|
53
|
+
* Where the text is shown: app, on its pages and consents; samples_page, the notice of a set of
|
|
54
|
+
* texts; form, a form a person signs outside every screen.
|
|
55
|
+
*/
|
|
56
|
+
readonly place: TextPlace;
|
|
57
|
+
/**
|
|
58
|
+
* The versions of the text, from 1 on, in order.
|
|
59
|
+
*/
|
|
60
|
+
readonly versions: readonly TextVersion[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* TextPlace is the type of legal.schema.json#/$defs/text/properties/place.
|
|
65
|
+
*
|
|
66
|
+
* Where the text is shown: app, on its pages and consents; samples_page, the notice of a set of
|
|
67
|
+
* texts; form, a form a person signs outside every screen.
|
|
68
|
+
*/
|
|
69
|
+
export type TextPlace = "app" | "samples_page" | "form";
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* TextVersion is the type of legal.schema.json#/$defs/text_version.
|
|
73
|
+
*/
|
|
74
|
+
export interface TextVersion {
|
|
75
|
+
/**
|
|
76
|
+
* The gist of the version in each language of the interface, by the language's tag: what a screen
|
|
77
|
+
* in that language shows beside the English text in force. A self-hosted copy writes both too:
|
|
78
|
+
* one build of app serves every copy.
|
|
79
|
+
*/
|
|
80
|
+
readonly summary: Gist;
|
|
81
|
+
/**
|
|
82
|
+
* The number of the version.
|
|
83
|
+
*/
|
|
84
|
+
readonly version: number;
|
|
85
|
+
/**
|
|
86
|
+
* draft, shown to nobody and free to change; or in_force, approved by the author and never
|
|
87
|
+
* changed again.
|
|
88
|
+
*/
|
|
89
|
+
readonly status: StatusStatus;
|
|
90
|
+
/**
|
|
91
|
+
* The date the author approved the version, YYYY-MM-DD. Only a version in force has it, and it
|
|
92
|
+
* always has it.
|
|
93
|
+
*/
|
|
94
|
+
readonly in_force_since?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Status is the type of legal.schema.json#/$defs/status.
|
|
99
|
+
*/
|
|
100
|
+
export interface Status {
|
|
101
|
+
/**
|
|
102
|
+
* The number of the version.
|
|
103
|
+
*/
|
|
104
|
+
readonly version: number;
|
|
105
|
+
/**
|
|
106
|
+
* draft, shown to nobody and free to change; or in_force, approved by the author and never
|
|
107
|
+
* changed again.
|
|
108
|
+
*/
|
|
109
|
+
readonly status: StatusStatus;
|
|
110
|
+
/**
|
|
111
|
+
* The date the author approved the version, YYYY-MM-DD. Only a version in force has it, and it
|
|
112
|
+
* always has it.
|
|
113
|
+
*/
|
|
114
|
+
readonly in_force_since?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* StatusStatus is the type of legal.schema.json#/$defs/status/properties/status.
|
|
119
|
+
*
|
|
120
|
+
* draft, shown to nobody and free to change; or in_force, approved by the author and never changed
|
|
121
|
+
* again.
|
|
122
|
+
*/
|
|
123
|
+
export type StatusStatus = "draft" | "in_force";
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Gist is the type of legal.schema.json#/$defs/text_version/properties/summary.
|
|
127
|
+
*
|
|
128
|
+
* The gist of the version in each language of the interface, by the language's tag: what a screen
|
|
129
|
+
* in that language shows beside the English text in force. A self-hosted copy writes both too: one
|
|
130
|
+
* build of app serves every copy.
|
|
131
|
+
*/
|
|
132
|
+
export interface Gist {
|
|
133
|
+
/**
|
|
134
|
+
* The gist in English.
|
|
135
|
+
*/
|
|
136
|
+
readonly en: Summary;
|
|
137
|
+
/**
|
|
138
|
+
* The gist in Russian.
|
|
139
|
+
*/
|
|
140
|
+
readonly ru: Summary;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Summary is the type of legal.schema.json#/$defs/summary.
|
|
145
|
+
*/
|
|
146
|
+
export type Summary = string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* SetID is the type of legal.schema.json#/$defs/set_id.
|
|
150
|
+
*
|
|
151
|
+
* The ID of a set: as the ID of a text, of at most 24 characters, so that the set's ID and version
|
|
152
|
+
* joined by a hyphen fit the 32 characters of a sample's text_set_version.
|
|
153
|
+
*/
|
|
154
|
+
export type SetID = string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Set is the type of legal.schema.json#/$defs/set.
|
|
158
|
+
*/
|
|
159
|
+
export interface Set {
|
|
160
|
+
/**
|
|
161
|
+
* The versions of the set, from 1 on, in order.
|
|
162
|
+
*/
|
|
163
|
+
readonly versions: readonly SetVersion[];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* SetVersion is the type of legal.schema.json#/$defs/set_version.
|
|
168
|
+
*/
|
|
169
|
+
export interface SetVersion {
|
|
170
|
+
/**
|
|
171
|
+
* The notice the samples page shows before writing.
|
|
172
|
+
*/
|
|
173
|
+
readonly notice: TextRef;
|
|
174
|
+
/**
|
|
175
|
+
* The form a person signs outside the page, before the first sample.
|
|
176
|
+
*/
|
|
177
|
+
readonly form: TextRef;
|
|
178
|
+
/**
|
|
179
|
+
* The number of the version.
|
|
180
|
+
*/
|
|
181
|
+
readonly version: number;
|
|
182
|
+
/**
|
|
183
|
+
* draft, shown to nobody and free to change; or in_force, approved by the author and never
|
|
184
|
+
* changed again.
|
|
185
|
+
*/
|
|
186
|
+
readonly status: StatusStatus;
|
|
187
|
+
/**
|
|
188
|
+
* The date the author approved the version, YYYY-MM-DD. Only a version in force has it, and it
|
|
189
|
+
* always has it.
|
|
190
|
+
*/
|
|
191
|
+
readonly in_force_since?: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* TextRef is the type of legal.schema.json#/$defs/text_ref.
|
|
196
|
+
*/
|
|
197
|
+
export interface TextRef {
|
|
198
|
+
/**
|
|
199
|
+
* The ID of the text.
|
|
200
|
+
*/
|
|
201
|
+
readonly text: ID;
|
|
202
|
+
/**
|
|
203
|
+
* The version of the text.
|
|
204
|
+
*/
|
|
205
|
+
readonly version: number;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// The types of reading-vector.schema.json.
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* ReadingVector is the type of reading-vector.schema.json.
|
|
212
|
+
*
|
|
213
|
+
* A test vector of reading (section 7 of the legal text): parts, each perhaps with the part of the
|
|
214
|
+
* release before, and what section 5 gives. A reader implements section 5 and gets exactly this.
|
|
215
|
+
*/
|
|
216
|
+
export interface ReadingVector {
|
|
217
|
+
/**
|
|
218
|
+
* The parts.
|
|
219
|
+
*/
|
|
220
|
+
readonly cases: readonly Case[];
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Case is the type of reading-vector.schema.json#/$defs/case.
|
|
225
|
+
*/
|
|
226
|
+
export interface Case {
|
|
227
|
+
/**
|
|
228
|
+
* The part of the release before, which legal.in-force-unchanged reads. Left out when that
|
|
229
|
+
* release has no legal/.
|
|
230
|
+
*/
|
|
231
|
+
readonly previous?: Part;
|
|
232
|
+
/**
|
|
233
|
+
* What the reader gives a part it accepts. Left out when it refuses the part.
|
|
234
|
+
*/
|
|
235
|
+
readonly current?: Current;
|
|
236
|
+
/**
|
|
237
|
+
* The step that refuses the part: the schema, or the ID of the rule. Left out when the reader
|
|
238
|
+
* accepts it.
|
|
239
|
+
*/
|
|
240
|
+
readonly refused_by?: CaseRefusedBy;
|
|
241
|
+
/**
|
|
242
|
+
* Every name that step gives, in the order of code units.
|
|
243
|
+
*/
|
|
244
|
+
readonly names?: readonly string[];
|
|
245
|
+
/**
|
|
246
|
+
* The passport as YAML reads it: any value, not only one the schema accepts.
|
|
247
|
+
*/
|
|
248
|
+
readonly passport: unknown;
|
|
249
|
+
/**
|
|
250
|
+
* The files under texts/, by their paths from the part.
|
|
251
|
+
*/
|
|
252
|
+
readonly files: Readonly<Record<string, string>>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Part is the type of reading-vector.schema.json#/$defs/part.
|
|
257
|
+
*/
|
|
258
|
+
export interface Part {
|
|
259
|
+
/**
|
|
260
|
+
* The passport as YAML reads it: any value, not only one the schema accepts.
|
|
261
|
+
*/
|
|
262
|
+
readonly passport: unknown;
|
|
263
|
+
/**
|
|
264
|
+
* The files under texts/, by their paths from the part.
|
|
265
|
+
*/
|
|
266
|
+
readonly files: Readonly<Record<string, string>>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Current is the type of reading-vector.schema.json#/$defs/case/properties/current.
|
|
271
|
+
*
|
|
272
|
+
* What the reader gives a part it accepts. Left out when it refuses the part.
|
|
273
|
+
*/
|
|
274
|
+
export interface Current {
|
|
275
|
+
/**
|
|
276
|
+
* The current version of every text that has one.
|
|
277
|
+
*/
|
|
278
|
+
readonly texts: Versions;
|
|
279
|
+
/**
|
|
280
|
+
* The current version of every set that has one.
|
|
281
|
+
*/
|
|
282
|
+
readonly sets: Versions;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Versions is the type of reading-vector.schema.json#/$defs/versions.
|
|
287
|
+
*/
|
|
288
|
+
export type Versions = Readonly<Record<string, number>>;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* CaseRefusedBy is the type of reading-vector.schema.json#/$defs/case/properties/refused_by.
|
|
292
|
+
*
|
|
293
|
+
* The step that refuses the part: the schema, or the ID of the rule. Left out when the reader
|
|
294
|
+
* accepts it.
|
|
295
|
+
*/
|
|
296
|
+
export type CaseRefusedBy = "schema" | "legal.files" | "legal.versions" | "legal.set-texts" | "legal.markdown" | "legal.in-force-unchanged";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altnovatrail/spec",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The types of NovaTrail's module format for TypeScript, generated from its schemas: the parts of a module and their open views, the canonical view, the inventory, the module index and the test vectors. And the types of the element <novatrail-canvas>, the contract of the canvas and the app. And the types of the admission table, which says which AI provider may serve which age category. And the numbers and widths of the workbook's page and its test vectors, as JSON, by which a canvas lays the page out. And the types of the deployment configuration, the file /deployment.json that the app reads at its start.",
|
|
3
|
+
"version": "0.13.0",
|
|
4
|
+
"description": "The types of NovaTrail's module format for TypeScript, generated from its schemas: the parts of a module and their open views, the canonical view, the inventory, the module index and the test vectors. And the types of the element <novatrail-canvas>, the contract of the canvas and the app. And the types of the admission table, which says which AI provider may serve which age category. And the numbers and widths of the workbook's page and its test vectors, as JSON, by which a canvas lays the page out. And the types of the deployment configuration, the file /deployment.json that the app reads at its start. And the types of the legal texts' passport, which names each text, its versions and the sets of texts of the samples page.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
"./deploymentv1": {
|
|
27
27
|
"types": "./deploymentv1/index.d.ts"
|
|
28
28
|
},
|
|
29
|
+
"./legalv1": {
|
|
30
|
+
"types": "./legalv1/index.d.ts"
|
|
31
|
+
},
|
|
29
32
|
"./package.json": "./package.json"
|
|
30
33
|
},
|
|
31
34
|
"files": [
|
|
@@ -33,7 +36,8 @@
|
|
|
33
36
|
"canvas",
|
|
34
37
|
"admissionv0",
|
|
35
38
|
"format",
|
|
36
|
-
"deploymentv1"
|
|
39
|
+
"deploymentv1",
|
|
40
|
+
"legalv1"
|
|
37
41
|
],
|
|
38
42
|
"sideEffects": false
|
|
39
43
|
}
|