@altnovatrail/spec 0.13.0 → 0.15.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 -2
- package/consentagev1/index.d.ts +218 -0
- package/exportv1/index.d.ts +1388 -0
- package/{legalv1 → legalv2}/index.d.ts +22 -7
- package/package.json +13 -5
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, from 0.11.0 on those of its deployment configuration,
|
|
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, from 0.13.0 on those of the passport of its legal texts, and from 0.14.0 on those of its table of the age of digital consent and of the files of its export. 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;
|
|
@@ -18,6 +18,14 @@ From 0.11.0 on, it holds the types of the deployment configuration too: the file
|
|
|
18
18
|
|
|
19
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
20
|
|
|
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
|
+
|
|
23
|
+
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
|
+
|
|
25
|
+
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
|
+
|
|
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.
|
|
28
|
+
|
|
21
29
|
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:
|
|
22
30
|
|
|
23
31
|
```ts
|
|
@@ -38,7 +46,10 @@ function show(task: open.Task, manifest: open.Manifest) {
|
|
|
38
46
|
- **`@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.
|
|
39
47
|
- **`@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.
|
|
40
48
|
- **`@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/
|
|
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.
|
|
50
|
+
- **`@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.
|
|
42
53
|
- **`@altnovatrail/spec/canvas`** holds the types of `<novatrail-canvas>`:
|
|
43
54
|
- `CanvasElement`, which describes the element's properties `tool`, `task`, `workedExample`, `demoState`, `manifest`, `media`, `history`, `marks` and `filled` and its method `exportWork()`;
|
|
44
55
|
- `Media`, the function by which the consumer gives the files of the pictures: the canvas goes to no network;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// Code generated by tools/types from consent-age/schemas; DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The types of the table of the age of digital consent, version 1 of the part, generated from the
|
|
5
|
+
* schemas in consent-age/schemas by tools/types (R72, R73 and R134 in spec's docs/decisions.md):
|
|
6
|
+
* the same types as the Go package consentagev1, by the same names — the table
|
|
7
|
+
* consent-age/consent-age.yaml, with the age of each country from a day on and the law that sets
|
|
8
|
+
* it, the vectors of reading and the vectors of the category. The countries a learner's may be are
|
|
9
|
+
* Country. A vector of reading's table is any JSON value, unknown, as a reader gets it. The schemas
|
|
10
|
+
* decide what is valid: a type gives the shape of a value alone, and code that reads a value from
|
|
11
|
+
* elsewhere checks it against its schema first, and then against the rules of reading
|
|
12
|
+
* (consent-age/README.md, section 5); the category of a learner is section 6. A field the object
|
|
13
|
+
* always holds is required; any other is optional.
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// The types of category-vector.schema.json.
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* CategoryVector is the type of category-vector.schema.json.
|
|
22
|
+
*
|
|
23
|
+
* A test vector of the category (section 8 of the text of the part): a table that section 5
|
|
24
|
+
* accepts, and what section 6 gives on it — the category of a learner, and whether a profile's age
|
|
25
|
+
* is asked again.
|
|
26
|
+
*/
|
|
27
|
+
export interface CategoryVector {
|
|
28
|
+
/**
|
|
29
|
+
* The table the cases are computed on.
|
|
30
|
+
*/
|
|
31
|
+
readonly table: ConsentAge;
|
|
32
|
+
/**
|
|
33
|
+
* The cases.
|
|
34
|
+
*/
|
|
35
|
+
readonly cases: readonly CategoryCase[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* CategoryCase is the type of category-vector.schema.json#/$defs/category_case.
|
|
40
|
+
*/
|
|
41
|
+
export interface CategoryCase {
|
|
42
|
+
/**
|
|
43
|
+
* The learner's country.
|
|
44
|
+
*/
|
|
45
|
+
readonly country: Country;
|
|
46
|
+
/**
|
|
47
|
+
* The learner's age in years, as it is given.
|
|
48
|
+
*/
|
|
49
|
+
readonly age_years?: number;
|
|
50
|
+
/**
|
|
51
|
+
* The day the age is given.
|
|
52
|
+
*/
|
|
53
|
+
readonly day?: Day;
|
|
54
|
+
/**
|
|
55
|
+
* The category: of a learner of age_years on day, or the one a profile keeps.
|
|
56
|
+
*/
|
|
57
|
+
readonly category: CategoryCaseCategory;
|
|
58
|
+
/**
|
|
59
|
+
* The age of digital consent of the country that the category was given by: of the country on
|
|
60
|
+
* day, or the one the profile keeps with its category.
|
|
61
|
+
*/
|
|
62
|
+
readonly applied: number;
|
|
63
|
+
/**
|
|
64
|
+
* The day the profile comes to work.
|
|
65
|
+
*/
|
|
66
|
+
readonly today?: Day;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the profile's age is asked again before its next work.
|
|
69
|
+
*/
|
|
70
|
+
readonly ask_again?: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* CategoryCaseCategory is the type of
|
|
75
|
+
* category-vector.schema.json#/$defs/category_case/properties/category.
|
|
76
|
+
*
|
|
77
|
+
* The category: of a learner of age_years on day, or the one a profile keeps.
|
|
78
|
+
*/
|
|
79
|
+
export type CategoryCaseCategory = "under_13" | "from_13_to_consent" | "from_consent_to_18" | "adult";
|
|
80
|
+
|
|
81
|
+
// The types of consent-age.schema.json.
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* ConsentAge is the type of consent-age.schema.json.
|
|
85
|
+
*
|
|
86
|
+
* The table of the age of digital consent by country, consent-age/consent-age.yaml (section 4 of
|
|
87
|
+
* the text of the part): the age of each country with the law that sets it, and the age of a
|
|
88
|
+
* country the table does not hold.
|
|
89
|
+
*/
|
|
90
|
+
export interface ConsentAge {
|
|
91
|
+
/**
|
|
92
|
+
* The version of the part, the integer in consent-age/VERSION.
|
|
93
|
+
*/
|
|
94
|
+
readonly format: number;
|
|
95
|
+
/**
|
|
96
|
+
* The age of digital consent of a country the table does not hold: a parent gives consent for
|
|
97
|
+
* every learner under 18 there (R134).
|
|
98
|
+
*/
|
|
99
|
+
readonly outside_table: number;
|
|
100
|
+
/**
|
|
101
|
+
* The countries, by their codes of ISO 3166-1 alpha-2.
|
|
102
|
+
*/
|
|
103
|
+
readonly countries: Readonly<Partial<Record<Country, readonly Entry[]>>>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Country is the type of consent-age.schema.json#/$defs/country.
|
|
108
|
+
*
|
|
109
|
+
* A country, by its code of ISO 3166-1 alpha-2: one of the 249 codes ISO 3166-1 assigns officially,
|
|
110
|
+
* as the iso-codes project of Debian keeps them (data/iso_3166-1.json, commit d055275). A code ISO
|
|
111
|
+
* only reserves, such as UK or EL, is none.
|
|
112
|
+
*/
|
|
113
|
+
export type Country = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Entry is the type of consent-age.schema.json#/$defs/entry.
|
|
117
|
+
*/
|
|
118
|
+
export interface Entry {
|
|
119
|
+
/**
|
|
120
|
+
* The age of digital consent: from it on a learner gives consent themselves, below it a parent
|
|
121
|
+
* gives it.
|
|
122
|
+
*/
|
|
123
|
+
readonly age: number;
|
|
124
|
+
/**
|
|
125
|
+
* The day from which the age applies; a day still to come is a law adopted and not yet applying.
|
|
126
|
+
*/
|
|
127
|
+
readonly from: Day;
|
|
128
|
+
/**
|
|
129
|
+
* The law, by its official title in its own language and its number in the official journal.
|
|
130
|
+
*/
|
|
131
|
+
readonly law: Words;
|
|
132
|
+
/**
|
|
133
|
+
* The article, section or paragraph of the law, as the law writes it.
|
|
134
|
+
*/
|
|
135
|
+
readonly provision: string;
|
|
136
|
+
/**
|
|
137
|
+
* The words of the provision that set the age, verbatim, in the language of the law; for an age
|
|
138
|
+
* that is GDPR's own, the words of its article 8(1).
|
|
139
|
+
*/
|
|
140
|
+
readonly quote: Words;
|
|
141
|
+
/**
|
|
142
|
+
* The URL of the official text that was read: the official journal or the official database of
|
|
143
|
+
* the country's laws, or EUR-Lex.
|
|
144
|
+
*/
|
|
145
|
+
readonly source: string;
|
|
146
|
+
/**
|
|
147
|
+
* The day the source was read.
|
|
148
|
+
*/
|
|
149
|
+
readonly read: Day;
|
|
150
|
+
/**
|
|
151
|
+
* What else the reader of the entry needs, in English.
|
|
152
|
+
*/
|
|
153
|
+
readonly note?: Words;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Day is the type of consent-age.schema.json#/$defs/day.
|
|
158
|
+
*
|
|
159
|
+
* A day of the calendar in UTC, YYYY-MM-DD.
|
|
160
|
+
*/
|
|
161
|
+
export type Day = string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Words is the type of consent-age.schema.json#/$defs/words.
|
|
165
|
+
*/
|
|
166
|
+
export type Words = string;
|
|
167
|
+
|
|
168
|
+
// The types of reading-vector.schema.json.
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* ReadingVector is the type of reading-vector.schema.json.
|
|
172
|
+
*
|
|
173
|
+
* A test vector of reading (section 8 of the text of the part): tables, each perhaps with the table
|
|
174
|
+
* of the release before, and what section 5 gives. A reader implements section 5 and gets exactly
|
|
175
|
+
* this.
|
|
176
|
+
*/
|
|
177
|
+
export interface ReadingVector {
|
|
178
|
+
/**
|
|
179
|
+
* The tables.
|
|
180
|
+
*/
|
|
181
|
+
readonly cases: readonly Case[];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Case is the type of reading-vector.schema.json#/$defs/case.
|
|
186
|
+
*/
|
|
187
|
+
export interface Case {
|
|
188
|
+
/**
|
|
189
|
+
* The table as YAML reads it: any value, not only one the schema accepts.
|
|
190
|
+
*/
|
|
191
|
+
readonly table: unknown;
|
|
192
|
+
/**
|
|
193
|
+
* The table of the release before, which consent-age.ages-kept reads: a table its schema accepts.
|
|
194
|
+
* Left out when that release has no consent-age/.
|
|
195
|
+
*/
|
|
196
|
+
readonly previous?: unknown;
|
|
197
|
+
/**
|
|
198
|
+
* The reader accepts the table. Left out when it refuses it.
|
|
199
|
+
*/
|
|
200
|
+
readonly accepted?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* The step that refuses the table: the schema, or the ID of the rule. Left out when the reader
|
|
203
|
+
* accepts it.
|
|
204
|
+
*/
|
|
205
|
+
readonly refused_by?: CaseRefusedBy;
|
|
206
|
+
/**
|
|
207
|
+
* Every name that step gives, in the order of code units.
|
|
208
|
+
*/
|
|
209
|
+
readonly names?: readonly string[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* CaseRefusedBy is the type of reading-vector.schema.json#/$defs/case/properties/refused_by.
|
|
214
|
+
*
|
|
215
|
+
* The step that refuses the table: the schema, or the ID of the rule. Left out when the reader
|
|
216
|
+
* accepts it.
|
|
217
|
+
*/
|
|
218
|
+
export type CaseRefusedBy = "schema" | "consent-age.days" | "consent-age.entries-ordered" | "consent-age.ages-kept";
|