@altnovatrail/spec 0.16.7 → 0.17.1

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 CHANGED
@@ -20,11 +20,13 @@ From 0.13.0 on, it holds the types of the legal texts' passport too, `legal/lega
20
20
 
21
21
  From 0.15.0 on, `@altnovatrail/spec/legalv2` takes the place of `@altnovatrail/spec/legalv1`: the types of the part's version 2, whose version of a text may name its `translations` into languages of the interface other than English, each a Markdown file of its own, `texts/<id>/<n>.<tag>.md`, with no force of its own. A consumer of 0.14 that imports `legalv1` imports `legalv2` from 0.15 on.
22
22
 
23
+ From 0.17.0 on, `@altnovatrail/spec/legalv3` takes the place of `@altnovatrail/spec/legalv2`: the types of the part's version 3, whose `in_force_since` is the day from which a version applies, which may be later than the day it was approved, and whose test vector of reading names the day it reads a part on, `today`, and gives the next versions, `next`, beside the current ones. A consumer of 0.16 that imports `legalv2` imports `legalv3` from 0.17 on.
24
+
23
25
  From 0.14.0 on, it holds the types of the table of the age of digital consent too, `consent-age/consent-age.yaml`: for each country, by its code of ISO 3166-1 alpha-2, the age from which a learner gives consent themselves, from the day it applies, with the law and the provision that set it, a quote of the provision, its source and the date it was read ([the part's text](https://github.com/altnovatrail/spec/blob/main/consent-age/README.md)). `Country` is the 249 codes ISO 3166-1 assigns officially, which a screen may take as the countries it offers. They are generated from the part's schemas, `consent-age/schemas`, as the format's are.
24
26
 
25
27
  From 0.14.0 on, it holds the types of the files of an export too: the file the owner of an account gets of a profile or of the whole account — its manifest, the account, a profile with every record of it and what a device holds of it ([the part's text](https://github.com/altnovatrail/spec/blob/main/export/README.md)). A field that holds the JSON of a message of protobuf, or a value of `<novatrail-canvas>`, is `unknown`. They are generated from the part's schemas, `export/schemas`, as the format's are.
26
28
 
27
- From 0.14.0 on, it holds the types of the files of an export too: the file the owner of an account gets of a profile or of the whole account — its manifest, the account, a profile with every record of it and what a device holds of it ([the part's text](https://github.com/altnovatrail/spec/blob/main/export/README.md)). A field that holds the JSON of a message of protobuf, or a value of `<novatrail-canvas>`, is `unknown`. They are generated from the part's schemas, `export/schemas`, as the format's are.
29
+ From 0.17.0 on, `@altnovatrail/spec/exportv2` takes the place of `@altnovatrail/spec/exportv1`: the types of the part's version 2, whose profile carries its stored works, `works`, each with its history of writing, the contexts of its submissions and its picture, in place of `artefacts`. A consumer of 0.16 that imports `exportv1` imports `exportv2` from 0.17 on.
28
30
 
29
31
  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:
30
32
 
@@ -46,10 +48,9 @@ function show(task: open.Task, manifest: open.Manifest) {
46
48
  - **`@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.
47
49
  - **`@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.
48
50
  - **`@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.
49
- - **`@altnovatrail/spec/legalv2`** holds the types of version 2 of the legal texts: the passport, `Legal`, with each `Text` and its `TextVersion` with its `translations`, 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.
51
+ - **`@altnovatrail/spec/legalv3`** holds the types of version 3 of the legal texts: the passport, `Legal`, with each `Text` and its `TextVersion` with its `translations`, 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.
50
52
  - **`@altnovatrail/spec/consentagev1`** holds the types of version 1 of the table of the age of digital consent: the table, `ConsentAge`, with each country's `Entry`, the `Country` codes, and the test vectors of reading the table, `ReadingVector`, whose table is any JSON value, `unknown`, and of the category, `CategoryVector`. A type gives the shape alone: a reader checks the table against its schema and then against the rules of reading, section 5 of the part's text, and computes a learner's category as the part's text says.
51
- - **`@altnovatrail/spec/exportv1`** holds the types of version 1 of the format of the export: `Manifest`, `Account`, `Profile` with its `Attempt`, `Submission`, `Choice`, `EvidenceEntry` and `StateEntry`, `Device`, and the test vectors of reading an export, `ReadingVector`. A type gives the shape alone: a reader checks each file against its schema and then the export against the rules of reading, section 5 of the part's text.
52
- - **`@altnovatrail/spec/exportv1`** holds the types of version 1 of the format of the export: `Manifest`, `Account`, `Profile` with its `Attempt`, `Submission`, `Choice`, `EvidenceEntry` and `StateEntry`, `Device`, and the test vectors of reading an export, `ReadingVector`. A type gives the shape alone: a reader checks each file against its schema and then the export against the rules of reading, section 5 of the part's text.
53
+ - **`@altnovatrail/spec/exportv2`** holds the types of version 2 of the format of the export: `Manifest`, `Account`, `Profile` with its `Attempt`, `Submission`, `Choice`, `EvidenceEntry`, `StateEntry` and `Work`, `Device`, and the test vectors of reading an export, `ReadingVector`. A type gives the shape alone: a reader checks each file against its schema and then the export against the rules of reading, section 5 of the part's text.
53
54
  - **`@altnovatrail/spec/canvas`** holds the types of `<novatrail-canvas>`:
54
55
  - `CanvasElement`, which describes the element's properties `tool`, `task`, `workedExample`, `demoState`, `manifest`, `media`, `history`, `marks` and `filled` and its method `exportWork()`;
55
56
  - `Media`, the function by which the consumer gives the files of the pictures: the canvas goes to no network;
package/canvas/index.d.ts CHANGED
@@ -217,7 +217,8 @@ export interface CropNumbers {
217
217
  /**
218
218
  * The context of one submission of a sheet, which the element gives with its crop and takes back
219
219
  * with the tutor's marks: the crop's numbers, the groups of the strokes, and the digest of it all.
220
- * app keeps it on the device as it is, through JSON, unrounded, and sends it nowhere.
220
+ * app keeps it on the device as it is, through JSON, unrounded, and sends it only within a stored
221
+ * work, while the storage of the profile's works is on (R113).
221
222
  */
222
223
  export interface SheetSubmission {
223
224
  readonly crop: CropNumbers;
@@ -233,7 +234,8 @@ export interface SheetSubmission {
233
234
  * The context of one submission of a workbook: the table «box → stroke IDs», each filled box by its
234
235
  * place, in the task's order, and the digest of its strokes, of every box of the page and of the
235
236
  * table's rows. A context of another layout of the page the element does not take back. app keeps
236
- * it on the device as it is, and sends it nowhere.
237
+ * it on the device as it is, and sends it only within a stored work, while the storage of the
238
+ * profile's works is on (R113).
237
239
  */
238
240
  export interface WorkbookSubmission {
239
241
  readonly boxes: readonly Filling[];
@@ -1,9 +1,9 @@
1
1
  // Code generated by tools/types from export/schemas; DO NOT EDIT.
2
2
 
3
3
  /**
4
- * The types of the format of the export, version 1 of the part, generated from the schemas in
4
+ * The types of the format of the export, version 2 of the part, generated from the schemas in
5
5
  * export/schemas by tools/types (R72, R73 and R135 in spec's docs/decisions.md): the same types as
6
- * the Go package exportv1, by the same names — the files of an export, the manifest, the account, a
6
+ * the Go package exportv2, by the same names — the files of an export, the manifest, the account, a
7
7
  * profile with every record of it and what a device holds of it, and the vectors of reading. A
8
8
  * field that holds the JSON of a message of protobuf, or a value as the element <novatrail-canvas>
9
9
  * gives it, is any JSON value, unknown, as a reader gets it. The schemas decide what is valid: a
@@ -214,6 +214,20 @@ export interface QuotaCounter {
214
214
  readonly reserved_micro_usd: number;
215
215
  }
216
216
 
217
+ /**
218
+ * WorkSubmission is the type of common.schema.json#/$defs/work_submission.
219
+ */
220
+ export interface WorkSubmission {
221
+ /**
222
+ * The context of the submission, as the element <novatrail-canvas> gave it, in its own names.
223
+ */
224
+ readonly context: unknown;
225
+ /**
226
+ * How many events of the history the submission covers.
227
+ */
228
+ readonly history_length: number;
229
+ }
230
+
217
231
  // The types of device.schema.json.
218
232
 
219
233
  /**
@@ -262,27 +276,13 @@ export interface DeviceAttempt {
262
276
  * Each submission's context (SheetSubmission or WorkbookSubmission, as the canvas gave it) and
263
277
  * the history length when it was sent; the PNG work is not exported.
264
278
  */
265
- readonly submissions: readonly DeviceAttemptSubmission[];
279
+ readonly submissions: readonly WorkSubmission[];
266
280
  /**
267
281
  * The attempt's mode, the step's place, the ticks of the chips and the technique IDs received.
268
282
  */
269
283
  readonly step_state?: DeviceAttemptStepState;
270
284
  }
271
285
 
272
- /**
273
- * DeviceAttemptSubmission is the type of device.schema.json#/$defs/device_attempt_submission.
274
- */
275
- export interface DeviceAttemptSubmission {
276
- /**
277
- * The context of the submission, as the element <novatrail-canvas> gave it, in its own names.
278
- */
279
- readonly context: unknown;
280
- /**
281
- * How many events of the history the submission covers.
282
- */
283
- readonly history_length: number;
284
- }
285
-
286
286
  /**
287
287
  * DeviceAttemptStepState is the type of device.schema.json#/$defs/device_attempt_step_state.
288
288
  */
@@ -516,9 +516,10 @@ export interface Profile {
516
516
  */
517
517
  readonly state: StateEntry;
518
518
  /**
519
- * Artefacts kept on the server; empty while storage is off.
519
+ * The stored works, the works of the profile kept on the server, newest first; empty while
520
+ * storage is off (R113).
520
521
  */
521
- readonly artefacts: readonly Artefact[];
522
+ readonly works: readonly Work[];
522
523
  /**
523
524
  * Whether the storage of the profile's works on the server is on (R113).
524
525
  */
@@ -1224,29 +1225,46 @@ export interface StateEntryModule {
1224
1225
  }
1225
1226
 
1226
1227
  /**
1227
- * Artefact is the type of profile.schema.json#/$defs/artefact.
1228
+ * Work is the type of profile.schema.json#/$defs/work.
1228
1229
  */
1229
- export interface Artefact {
1230
+ export interface Work {
1230
1231
  /**
1231
- * What the artefact is: an essay, a drawing or a recording.
1232
+ * The attempt whose work it is.
1232
1233
  */
1233
- readonly kind: ArtefactKind;
1234
+ readonly attempt_id: ID;
1234
1235
  /**
1235
- * The attempt whose work it is.
1236
+ * What the work is, by its task: handwriting on an item with a verdict, an essay by a rubric, or
1237
+ * a drawing.
1236
1238
  */
1237
- readonly attempt_id?: ID;
1239
+ readonly kind: WorkKind;
1238
1240
  /**
1239
- * The text of an essay.
1241
+ * When api kept the work, the last time it was put.
1240
1242
  */
1241
- readonly text?: string;
1243
+ readonly stored_at: Time;
1244
+ /**
1245
+ * The history of writing as the canvas gave it, the JSON array its bytes hold, not their base64:
1246
+ * write/erase/clear/undo events with t; strokes with id, kind and points x, y, t, p.
1247
+ */
1248
+ readonly history: unknown;
1249
+ /**
1250
+ * Each submission of the attempt, in order: its context, as the canvas gave it, and the history
1251
+ * length when it was sent.
1252
+ */
1253
+ readonly submissions: readonly WorkSubmission[];
1254
+ /**
1255
+ * The picture of the work: the PNG of the strokes the surface shows at the end, in base64 (RFC
1256
+ * 4648, section 4).
1257
+ */
1258
+ readonly picture: string;
1242
1259
  }
1243
1260
 
1244
1261
  /**
1245
- * ArtefactKind is the type of profile.schema.json#/$defs/artefact/properties/kind.
1262
+ * WorkKind is the type of profile.schema.json#/$defs/work/properties/kind.
1246
1263
  *
1247
- * What the artefact is: an essay, a drawing or a recording.
1264
+ * What the work is, by its task: handwriting on an item with a verdict, an essay by a rubric, or a
1265
+ * drawing.
1248
1266
  */
1249
- export type ArtefactKind = "essay" | "drawing" | "recording";
1267
+ export type WorkKind = "handwriting" | "essay" | "drawing";
1250
1268
 
1251
1269
  /**
1252
1270
  * StorageConsent is the type of profile.schema.json#/$defs/storage_consent.
@@ -1,9 +1,9 @@
1
1
  // Code generated by tools/types from legal/schemas; DO NOT EDIT.
2
2
 
3
3
  /**
4
- * The types of the legal texts, version 2 of the part, generated from the schemas in legal/schemas
4
+ * The types of the legal texts, version 3 of the part, generated from the schemas in legal/schemas
5
5
  * by tools/types (R72, R73 and R130 in spec's docs/decisions.md): the same types as the Go package
6
- * legalv2, by the same names — the passport legal/legal.yaml, with the texts, their versions and
6
+ * legalv3, by the same names — the passport legal/legal.yaml, with the texts, their versions and
7
7
  * the sets of texts of the samples page, and the vectors of reading. The words of a version are a
8
8
  * file of their own, texts/<id>/<n>.md, and those of its translations too, texts/<id>/<n>.<tag>.md,
9
9
  * which no type holds. A vector's passport is any JSON value, unknown, as a reader gets it. The
@@ -95,8 +95,9 @@ export interface TextVersion {
95
95
  */
96
96
  readonly status: StatusStatus;
97
97
  /**
98
- * The date the author approved the version, YYYY-MM-DD. Only a version in force has it, and it
99
- * always has it.
98
+ * The day from which the version applies, YYYY-MM-DD: the day the author approved it, or, for a
99
+ * text whose place is app, a later day, so that app shows the version before it applies. Only a
100
+ * version in force has it, and it always has it.
100
101
  */
101
102
  readonly in_force_since?: string;
102
103
  }
@@ -115,8 +116,9 @@ export interface Status {
115
116
  */
116
117
  readonly status: StatusStatus;
117
118
  /**
118
- * The date the author approved the version, YYYY-MM-DD. Only a version in force has it, and it
119
- * always has it.
119
+ * The day from which the version applies, YYYY-MM-DD: the day the author approved it, or, for a
120
+ * text whose place is app, a later day, so that app shows the version before it applies. Only a
121
+ * version in force has it, and it always has it.
120
122
  */
121
123
  readonly in_force_since?: string;
122
124
  }
@@ -200,8 +202,9 @@ export interface SetVersion {
200
202
  */
201
203
  readonly status: StatusStatus;
202
204
  /**
203
- * The date the author approved the version, YYYY-MM-DD. Only a version in force has it, and it
204
- * always has it.
205
+ * The day from which the version applies, YYYY-MM-DD: the day the author approved it, or, for a
206
+ * text whose place is app, a later day, so that app shows the version before it applies. Only a
207
+ * version in force has it, and it always has it.
205
208
  */
206
209
  readonly in_force_since?: string;
207
210
  }
@@ -225,8 +228,9 @@ export interface TextRef {
225
228
  /**
226
229
  * ReadingVector is the type of reading-vector.schema.json.
227
230
  *
228
- * A test vector of reading (section 7 of the legal text): parts, each perhaps with the part of the
229
- * release before, and what section 5 gives. A reader implements section 5 and gets exactly this.
231
+ * A test vector of reading (section 7 of the legal text): parts, each read on a day and perhaps
232
+ * with the part of the release before, and what section 5 gives. A reader implements section 5 and
233
+ * gets exactly this.
230
234
  */
231
235
  export interface ReadingVector {
232
236
  /**
@@ -239,15 +243,26 @@ export interface ReadingVector {
239
243
  * Case is the type of reading-vector.schema.json#/$defs/case.
240
244
  */
241
245
  export interface Case {
246
+ /**
247
+ * The day the part is read on, YYYY-MM-DD: a version in force applies from its in_force_since,
248
+ * and legal.operator and the current and next versions depend on it.
249
+ */
250
+ readonly today: string;
242
251
  /**
243
252
  * The part of the release before, which legal.in-force-unchanged reads. Left out when that
244
253
  * release has no legal/.
245
254
  */
246
255
  readonly previous?: Part;
247
256
  /**
248
- * What the reader gives a part it accepts. Left out when it refuses the part.
257
+ * What the reader gives a part it accepts: its current versions. Left out when it refuses the
258
+ * part.
249
259
  */
250
260
  readonly current?: Current;
261
+ /**
262
+ * What the reader gives a part it accepts besides its current versions: the versions in force
263
+ * whose day is still to come. Left out when it refuses the part.
264
+ */
265
+ readonly next?: Next;
251
266
  /**
252
267
  * The step that refuses the part: the schema, or the ID of the rule. Left out when the reader
253
268
  * accepts it.
@@ -284,11 +299,12 @@ export interface Part {
284
299
  /**
285
300
  * Current is the type of reading-vector.schema.json#/$defs/case/properties/current.
286
301
  *
287
- * What the reader gives a part it accepts. Left out when it refuses the part.
302
+ * What the reader gives a part it accepts: its current versions. Left out when it refuses the part.
288
303
  */
289
304
  export interface Current {
290
305
  /**
291
- * The current version of every text that has one.
306
+ * The current version of every text that has one: its version in force with the highest number
307
+ * whose day has come.
292
308
  */
293
309
  readonly texts: Versions;
294
310
  /**
@@ -302,10 +318,28 @@ export interface Current {
302
318
  */
303
319
  export type Versions = Readonly<Record<string, number>>;
304
320
 
321
+ /**
322
+ * Next is the type of reading-vector.schema.json#/$defs/case/properties/next.
323
+ *
324
+ * What the reader gives a part it accepts besides its current versions: the versions in force whose
325
+ * day is still to come. Left out when it refuses the part.
326
+ */
327
+ export interface Next {
328
+ /**
329
+ * The next version of every text that has one: the one that becomes current on the nearest day
330
+ * still to come, its version in force with the highest number among those of that day.
331
+ */
332
+ readonly texts: Versions;
333
+ /**
334
+ * The next version of every set that has one.
335
+ */
336
+ readonly sets: Versions;
337
+ }
338
+
305
339
  /**
306
340
  * CaseRefusedBy is the type of reading-vector.schema.json#/$defs/case/properties/refused_by.
307
341
  *
308
342
  * The step that refuses the part: the schema, or the ID of the rule. Left out when the reader
309
343
  * accepts it.
310
344
  */
311
- export type CaseRefusedBy = "schema" | "legal.files" | "legal.versions" | "legal.set-texts" | "legal.markdown" | "legal.in-force-unchanged";
345
+ export type CaseRefusedBy = "schema" | "legal.files" | "legal.versions" | "legal.set-texts" | "legal.markdown" | "legal.operator" | "legal.in-force-unchanged";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altnovatrail/spec",
3
- "version": "0.16.7",
3
+ "version": "0.17.1",
4
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. And the types of the table of the age of digital consent, which gives each country's age with the law that sets it. And the types of the files of an export, the file the owner of an account gets of a profile or of the account.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -26,14 +26,14 @@
26
26
  "./deploymentv1": {
27
27
  "types": "./deploymentv1/index.d.ts"
28
28
  },
29
- "./legalv2": {
30
- "types": "./legalv2/index.d.ts"
29
+ "./legalv3": {
30
+ "types": "./legalv3/index.d.ts"
31
31
  },
32
32
  "./consentagev1": {
33
33
  "types": "./consentagev1/index.d.ts"
34
34
  },
35
- "./exportv1": {
36
- "types": "./exportv1/index.d.ts"
35
+ "./exportv2": {
36
+ "types": "./exportv2/index.d.ts"
37
37
  },
38
38
  "./package.json": "./package.json"
39
39
  },
@@ -43,9 +43,9 @@
43
43
  "admissionv0",
44
44
  "format",
45
45
  "deploymentv1",
46
- "legalv2",
46
+ "legalv3",
47
47
  "consentagev1",
48
- "exportv1"
48
+ "exportv2"
49
49
  ],
50
50
  "sideEffects": false
51
51
  }