@mailwoman/registry 11.0.0 → 11.1.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 +3 -3
- package/docs/data-policy.md +5 -5
- package/docs/performance.md +1 -1
- package/docs/rgy1.md +5 -5
- package/lib/artifacts/country-airport-collision.ts +7 -5
- package/lib/artifacts/iata-airport/membership.ts +7 -5
- package/lib/artifacts/iata-airport/records.ts +7 -5
- package/lib/artifacts/iso3166-1/alpha2-membership.ts +7 -5
- package/lib/artifacts/iso3166-1/alpha3-membership.ts +7 -5
- package/lib/artifacts/iso3166-1/records.ts +7 -5
- package/lib/errors.ts +11 -8
- package/lib/iata/airports/records.ts +3 -4
- package/lib/iata/airports/validate.ts +6 -5
- package/lib/index.ts +10 -6
- package/lib/inspect.ts +5 -5
- package/lib/iso3166/alpha2.ts +5 -5
- package/lib/iso3166/alpha3.ts +6 -6
- package/lib/iso3166/records.ts +9 -8
- package/lib/iso3166/relations.ts +5 -5
- package/lib/key.ts +9 -7
- package/lib/normalize.ts +12 -8
- package/lib/overlap/country-airport.ts +14 -12
- package/lib/rgy1/base64.ts +3 -4
- package/lib/rgy1/reader.ts +8 -7
- package/lib/rgy1/sections.generated.ts +6 -5
- package/lib/rgy1/views.ts +5 -6
- package/lib/types.ts +8 -7
- package/lib/wasm.ts +11 -9
- package/out/artifacts/country-airport-collision.d.ts +0 -8
- package/out/artifacts/country-airport-collision.d.ts.map +1 -1
- package/out/artifacts/country-airport-collision.js +6 -5
- package/out/artifacts/country-airport-collision.js.map +1 -1
- package/out/artifacts/iata-airport/membership.d.ts +0 -8
- package/out/artifacts/iata-airport/membership.d.ts.map +1 -1
- package/out/artifacts/iata-airport/membership.js +6 -5
- package/out/artifacts/iata-airport/membership.js.map +1 -1
- package/out/artifacts/iata-airport/records.d.ts +0 -8
- package/out/artifacts/iata-airport/records.d.ts.map +1 -1
- package/out/artifacts/iata-airport/records.js +6 -5
- package/out/artifacts/iata-airport/records.js.map +1 -1
- package/out/artifacts/iso3166-1/alpha2-membership.d.ts +0 -8
- package/out/artifacts/iso3166-1/alpha2-membership.d.ts.map +1 -1
- package/out/artifacts/iso3166-1/alpha2-membership.js +6 -5
- package/out/artifacts/iso3166-1/alpha2-membership.js.map +1 -1
- package/out/artifacts/iso3166-1/alpha3-membership.d.ts +0 -8
- package/out/artifacts/iso3166-1/alpha3-membership.d.ts.map +1 -1
- package/out/artifacts/iso3166-1/alpha3-membership.js +6 -5
- package/out/artifacts/iso3166-1/alpha3-membership.js.map +1 -1
- package/out/artifacts/iso3166-1/records.d.ts +0 -8
- package/out/artifacts/iso3166-1/records.d.ts.map +1 -1
- package/out/artifacts/iso3166-1/records.js +6 -5
- package/out/artifacts/iso3166-1/records.js.map +1 -1
- package/out/errors.d.ts +8 -8
- package/out/errors.d.ts.map +1 -1
- package/out/errors.js +10 -8
- package/out/errors.js.map +1 -1
- package/out/iata/airports/records.d.ts +0 -7
- package/out/iata/airports/records.d.ts.map +1 -1
- package/out/iata/airports/records.js +2 -4
- package/out/iata/airports/records.js.map +1 -1
- package/out/iata/airports/validate.d.ts +0 -8
- package/out/iata/airports/validate.d.ts.map +1 -1
- package/out/iata/airports/validate.js +5 -5
- package/out/iata/airports/validate.js.map +1 -1
- package/out/index.d.ts +5 -6
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -11
- package/out/index.js.map +1 -1
- package/out/inspect.d.ts +2 -5
- package/out/inspect.d.ts.map +1 -1
- package/out/inspect.js +4 -5
- package/out/inspect.js.map +1 -1
- package/out/iso3166/alpha2.d.ts +0 -8
- package/out/iso3166/alpha2.d.ts.map +1 -1
- package/out/iso3166/alpha2.js +4 -5
- package/out/iso3166/alpha2.js.map +1 -1
- package/out/iso3166/alpha3.d.ts +1 -9
- package/out/iso3166/alpha3.d.ts.map +1 -1
- package/out/iso3166/alpha3.js +5 -6
- package/out/iso3166/alpha3.js.map +1 -1
- package/out/iso3166/records.d.ts +0 -11
- package/out/iso3166/records.d.ts.map +1 -1
- package/out/iso3166/records.js +8 -8
- package/out/iso3166/records.js.map +1 -1
- package/out/iso3166/relations.d.ts +0 -7
- package/out/iso3166/relations.d.ts.map +1 -1
- package/out/iso3166/relations.js +4 -5
- package/out/iso3166/relations.js.map +1 -1
- package/out/key.d.ts +6 -7
- package/out/key.d.ts.map +1 -1
- package/out/key.js +8 -7
- package/out/key.js.map +1 -1
- package/out/normalize.d.ts +9 -8
- package/out/normalize.d.ts.map +1 -1
- package/out/normalize.js +2 -12
- package/out/normalize.js.map +1 -1
- package/out/overlap/country-airport.d.ts +2 -16
- package/out/overlap/country-airport.d.ts.map +1 -1
- package/out/overlap/country-airport.js +13 -12
- package/out/overlap/country-airport.js.map +1 -1
- package/out/rgy1/base64.d.ts +0 -4
- package/out/rgy1/base64.d.ts.map +1 -1
- package/out/rgy1/base64.js +2 -4
- package/out/rgy1/base64.js.map +1 -1
- package/out/rgy1/reader.d.ts +0 -11
- package/out/rgy1/reader.d.ts.map +1 -1
- package/out/rgy1/reader.js +7 -7
- package/out/rgy1/reader.js.map +1 -1
- package/out/rgy1/sections.generated.d.ts +3 -5
- package/out/rgy1/sections.generated.d.ts.map +1 -1
- package/out/rgy1/sections.generated.js +5 -5
- package/out/rgy1/sections.generated.js.map +1 -1
- package/out/rgy1/views.d.ts +2 -9
- package/out/rgy1/views.d.ts.map +1 -1
- package/out/rgy1/views.js +4 -6
- package/out/rgy1/views.js.map +1 -1
- package/out/sdk/fetch.d.ts +1 -5
- package/out/sdk/fetch.d.ts.map +1 -1
- package/out/sdk/fetch.js +5 -7
- package/out/sdk/fetch.js.map +1 -1
- package/out/sdk/fetch.run.d.ts +0 -12
- package/out/sdk/fetch.run.d.ts.map +1 -1
- package/out/sdk/fetch.run.js +6 -7
- package/out/sdk/fetch.run.js.map +1 -1
- package/out/sdk/sources.d.ts +6 -15
- package/out/sdk/sources.d.ts.map +1 -1
- package/out/sdk/sources.js +16 -13
- package/out/sdk/sources.js.map +1 -1
- package/out/tools/artifact-path.d.ts +0 -5
- package/out/tools/artifact-path.d.ts.map +1 -1
- package/out/tools/artifact-path.js +2 -5
- package/out/tools/artifact-path.js.map +1 -1
- package/out/tools/bench.run.d.ts +0 -17
- package/out/tools/bench.run.d.ts.map +1 -1
- package/out/tools/bench.run.js +13 -10
- package/out/tools/bench.run.js.map +1 -1
- package/out/tools/build-wasm.run.d.ts +0 -16
- package/out/tools/build-wasm.run.d.ts.map +1 -1
- package/out/tools/build-wasm.run.js +8 -10
- package/out/tools/build-wasm.run.js.map +1 -1
- package/out/tools/generate-sections.run.d.ts +0 -11
- package/out/tools/generate-sections.run.d.ts.map +1 -1
- package/out/tools/generate-sections.run.js +5 -14
- package/out/tools/generate-sections.run.js.map +1 -1
- package/out/tools/generate.run.d.ts +0 -16
- package/out/tools/generate.run.d.ts.map +1 -1
- package/out/tools/generate.run.js +11 -14
- package/out/tools/generate.run.js.map +1 -1
- package/out/tools/normalize.d.ts +1 -13
- package/out/tools/normalize.d.ts.map +1 -1
- package/out/tools/normalize.js +14 -14
- package/out/tools/normalize.js.map +1 -1
- package/out/tools/normalize.run.d.ts +0 -12
- package/out/tools/normalize.run.d.ts.map +1 -1
- package/out/tools/normalize.run.js +4 -6
- package/out/tools/normalize.run.js.map +1 -1
- package/out/types.d.ts +5 -7
- package/out/types.d.ts.map +1 -1
- package/out/types.js +2 -11
- package/out/types.js.map +1 -1
- package/out/wasm.d.ts +0 -13
- package/out/wasm.d.ts.map +1 -1
- package/out/wasm.js +10 -9
- package/out/wasm.js.map +1 -1
- package/package.json +8 -3
- package/sdk/fetch.run.ts +7 -7
- package/sdk/fetch.ts +6 -7
- package/sdk/sources.ts +17 -13
- package/tools/artifact-path.ts +2 -5
- package/tools/bench.run.ts +19 -10
- package/tools/build-wasm.run.ts +9 -10
- package/tools/generate-sections.run.ts +6 -14
- package/tools/generate.run.ts +12 -14
- package/tools/normalize.run.ts +5 -6
- package/tools/normalize.ts +15 -14
package/README.md
CHANGED
|
@@ -45,9 +45,9 @@ is the explicit step that trims and upper-cases, and it reports what it did. A m
|
|
|
45
45
|
`not-found-in-snapshot`: the source holds no such code, and the issuing authority may still have assigned
|
|
46
46
|
it. `inspectArtifact` reads an artifact's profile, sources and coverage.
|
|
47
47
|
|
|
48
|
-
Each subpath retains its own artifact and no other. `iso3166/alpha2`
|
|
49
|
-
`overlap/country-airport`'s `isCountryAirportCollision`
|
|
50
|
-
`interpretCountryOrAirportCode`
|
|
48
|
+
Each subpath retains its own artifact and no other. `iso3166/alpha2` loads an 85-byte bitset;
|
|
49
|
+
`overlap/country-airport`'s `isCountryAirportCollision` loads the 2,197-byte collision bitset;
|
|
50
|
+
`interpretCountryOrAirportCode` loads the two record artifacts (51 KB and 1.1 MB). The root entry
|
|
51
51
|
re-exports the subpaths and decodes an artifact at its first call.
|
|
52
52
|
|
|
53
53
|
## Brands
|
package/docs/data-policy.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Data policy
|
|
2
2
|
|
|
3
3
|
This package compiles identifier data from published sources into lookup artifacts. This document states
|
|
4
|
-
where the data comes from, under what terms, what the open profile does and
|
|
4
|
+
where the data comes from, under what terms, what the open profile does and doesn't hold, and how a
|
|
5
5
|
source update moves through the repository.
|
|
6
6
|
|
|
7
7
|
## Profiles
|
|
8
8
|
|
|
9
|
-
A profile is a
|
|
9
|
+
A profile is a set of pinned sources with an identifier such as `open-2026-11`. An artifact's header states its profile, and every
|
|
10
10
|
predicate in this package answers for one profile. The built profile is `open-2026-11`.
|
|
11
11
|
|
|
12
12
|
| Profile | Sources | Where |
|
|
@@ -51,7 +51,7 @@ pinned bytes. At the pinned publication:
|
|
|
51
51
|
when the code is a current alpha-2 entry, `source-extension` for a code such as `XK`, `unstated` when
|
|
52
52
|
the column is empty. The `airport-located-in-country` relation holds only the first kind.
|
|
53
53
|
|
|
54
|
-
A miss means `not-found-in-snapshot`: the source holds no such code. It
|
|
54
|
+
A miss means `not-found-in-snapshot`: the source holds no such code. It isn't a claim that the issuing
|
|
55
55
|
authority never assigned it.
|
|
56
56
|
|
|
57
57
|
OurAirports and Wikidata disagree on the country list in a way the coverage declaration records rather
|
|
@@ -61,7 +61,7 @@ than hides: OurAirports lists `XK`, `XP` and `ZZ`, which are not ISO codes, and
|
|
|
61
61
|
## How a source update moves through the repository
|
|
62
62
|
|
|
63
63
|
1. `node packages/registry/sdk/fetch.run.ts --repin` downloads the sources into
|
|
64
|
-
`$
|
|
64
|
+
`$MAILWOMAN_CACHE_ROOT/sources/registry/` and rewrites the lock. Without `--repin`, a changed
|
|
65
65
|
publication fails the run.
|
|
66
66
|
2. `node packages/registry/tools/normalize.run.ts` rewrites `data/normalized/*.json` and
|
|
67
67
|
`data/manifests/coverage.json`. The normalized files hold one record per line so the diff reads by
|
|
@@ -74,7 +74,7 @@ than hides: OurAirports lists `XK`, `XP` and `ZZ`, which are not ISO codes, and
|
|
|
74
74
|
|
|
75
75
|
Network access happens only in step 1. A build never fetches.
|
|
76
76
|
|
|
77
|
-
## What
|
|
77
|
+
## What's not committed
|
|
78
78
|
|
|
79
79
|
The raw source files live under the data root and are not committed. The lock's digests identify them.
|
|
80
80
|
`PROVENANCE.md` conventions for the corpus do not apply here because no row of these sources trains a
|
package/docs/performance.md
CHANGED
|
@@ -111,7 +111,7 @@ decode and validation of the three bitsets costs 0.6 ms.
|
|
|
111
111
|
## What the run shows
|
|
112
112
|
|
|
113
113
|
- On strings, the JavaScript `Set` is the fastest arm at every batch size: 5 to 14 ns per code against 23
|
|
114
|
-
to 25 ns for the TypeScript bitset
|
|
114
|
+
to 25 ns for the TypeScript bitset. The bitset pays for `charCodeAt` and the key arithmetic that the `Set`'s
|
|
115
115
|
interned string hash avoids. The bitset's advantage is memory and startup rather than per-probe time: 2,197
|
|
116
116
|
bytes decoded in 0.6 ms against a `Set` of 201 strings built from a 2.6 MB JSON parse.
|
|
117
117
|
- The wasm batch over packed bytes reaches 5.9 to 7.7 ns per code from 256 codes up, with the simd build 0.5
|
package/docs/rgy1.md
CHANGED
|
@@ -14,7 +14,7 @@ no reader compares strings and no comparator has to agree across languages.
|
|
|
14
14
|
|
|
15
15
|
Every integer is unsigned little-endian. Version 1 limits every offset and length to `u32`, so an
|
|
16
16
|
artifact is smaller than 4 GiB. Every offset is relative to byte 0 of the artifact, never to a backing
|
|
17
|
-
buffer. A reader given a subarray behaves as it would given
|
|
17
|
+
buffer. A reader given a subarray behaves as it would given a buffer that holds only those bytes.
|
|
18
18
|
|
|
19
19
|
`align8(x)` is `x` rounded up to a multiple of 8.
|
|
20
20
|
|
|
@@ -42,10 +42,10 @@ The header is one JSON object serialized without whitespace, with its keys in by
|
|
|
42
42
|
nested object's keys in byte order. Numbers are integers. Strings are UTF-8 with JSON's mandatory escapes
|
|
43
43
|
only. The writer produces this form by serializing a `serde_json::Map`, which is a `BTreeMap`.
|
|
44
44
|
|
|
45
|
-
The header
|
|
45
|
+
The header stores no wall-clock time, host path or hash of the artifact itself. The artifact's SHA-256
|
|
46
46
|
lives in `data/manifests/artifacts.json`, written by `tools/generate.run.ts` after the bytes exist.
|
|
47
47
|
|
|
48
|
-
Fields every artifact
|
|
48
|
+
Fields every artifact stores:
|
|
49
49
|
|
|
50
50
|
| Key | Meaning |
|
|
51
51
|
| ---------------------- | ---------------------------------------------------------------------------- |
|
|
@@ -84,8 +84,8 @@ Sections appear in directory order, each starting at a multiple of 8 at or after
|
|
|
84
84
|
end, with zero bytes in any gap. The first section starts at the first payload offset. Fewer than eight
|
|
85
85
|
zero bytes may follow the last section, so the total length is a multiple of 8.
|
|
86
86
|
|
|
87
|
-
A reader refuses an unknown kind marked required and skips an unknown kind that
|
|
88
|
-
with an encoding the reader
|
|
87
|
+
A reader refuses an unknown kind marked required and skips an unknown kind that's not. A known kind
|
|
88
|
+
with an encoding the reader doesn't implement is refused.
|
|
89
89
|
|
|
90
90
|
## Keys
|
|
91
91
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The `country-airport-collision` artifact of the `open-2026-11` profile, 3056 bytes,
|
|
6
|
+
* SHA-256 2154993ce8f65602a0000b9ca3ea0d5ed29a1f1719ce39ff6dd791d0ec8b106b.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* Generated by tools/generate.run.ts from data/normalized.
|
|
9
|
+
* Edit the data or the compiler rather than this file.
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import { decodeBase64 } from "#rgy1/base64"
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The `iata-airport-membership` artifact of the `open-2026-11` profile, 2792 bytes,
|
|
6
|
+
* SHA-256 01b6677cd90b33574ce988b169c85445e378c82216f60c7888fce51e451525d9.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* Generated by tools/generate.run.ts from data/normalized.
|
|
9
|
+
* Edit the data or the compiler rather than this file.
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import { decodeBase64 } from "#rgy1/base64"
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The `iata-airport-records` artifact of the `open-2026-11` profile, 1123320 bytes,
|
|
6
|
+
* SHA-256 c93d306a490f652f20d1867dfdd33532413e9638e4509ca6d2ce08e68332a972.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* Generated by tools/generate.run.ts from data/normalized.
|
|
9
|
+
* Edit the data or the compiler rather than this file.
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import { decodeBase64 } from "#rgy1/base64"
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The `iso3166-1-alpha2-membership` artifact of the `open-2026-11` profile, 672 bytes,
|
|
6
|
+
* SHA-256 7daca3d6e81761ac09a2ddb8940ec8d09ffdf8f02fd7c56e04f2b30bb894022a.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* Generated by tools/generate.run.ts from data/normalized.
|
|
9
|
+
* Edit the data or the compiler rather than this file.
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import { decodeBase64 } from "#rgy1/base64"
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The `iso3166-1-alpha3-membership` artifact of the `open-2026-11` profile, 2784 bytes,
|
|
6
|
+
* SHA-256 2fe14e6fe8677e47a5aeb1079cbc4be78b05e55dd2e00c952ad44ab133269beb.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* Generated by tools/generate.run.ts from data/normalized.
|
|
9
|
+
* Edit the data or the compiler rather than this file.
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import { decodeBase64 } from "#rgy1/base64"
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The `iso3166-1-records` artifact of the `open-2026-11` profile, 51624 bytes,
|
|
6
|
+
* SHA-256 6d04f2396d2a6189b8bb6c4da3c8fa621805db2e375b9d17af343b800a00f597.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* Generated by tools/generate.run.ts from data/normalized.
|
|
9
|
+
* Edit the data or the compiler rather than this file.
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import { decodeBase64 } from "#rgy1/base64"
|
package/lib/errors.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* The small error vocabulary a strict parse answers with.
|
|
7
6
|
*
|
|
8
|
-
* The four reasons are distinct so a caller can tell a misspelling from an absence.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* The four reasons are distinct so a caller can tell a misspelling from an absence.
|
|
8
|
+
* `shape` is the wrong length or alphabet.
|
|
9
|
+
*
|
|
10
|
+
* `case` is the right letters in the wrong case.
|
|
11
|
+
* `not-found-in-snapshot` is a canonical spelling the profile holds no record for.
|
|
12
|
+
*
|
|
13
|
+
* `status-excluded` is a code the profile holds under a status the strict brand leaves out.
|
|
14
|
+
* The messages name no record, so a membership-only import pulls in no name dictionary.
|
|
12
15
|
*/
|
|
13
16
|
|
|
14
17
|
/**
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* Airport record retrieval and the located-in-country relation over the `iata-airport-records` artifact.
|
|
7
6
|
*/
|
|
8
7
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The strict airport-code predicate over the `iata-airport-membership` bitset.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* An import of it retains that 2,197-byte bitset and the reader,
|
|
8
|
+
* and no airport record, coordinate or name.
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
import { iataAirportMembershipArtifact } from "#artifacts/iata-airport/membership"
|
package/lib/index.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* `@mailwoman/registry`: standardized identifiers and their relationships,
|
|
6
|
+
* compiled from pinned open sources.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
8
|
+
* The root entry re-exports the narrow modules.
|
|
9
|
+
* Every export is a function or a type, and no module decodes an artifact until its
|
|
10
|
+
* first call, so importing the root costs the modules the bundler keeps and no table.
|
|
7
11
|
*
|
|
8
|
-
* The root entry re-exports the narrow modules. Every export is a function or a type, and no module decodes an
|
|
9
|
-
* artifact until its first call, so importing the root costs the modules the bundler keeps and no table.
|
|
10
12
|
* Import a subpath such as `@mailwoman/registry/iso3166/alpha2` when a bundle must retain one table only.
|
|
11
13
|
*/
|
|
12
14
|
|
|
@@ -17,6 +19,7 @@ export type { ArtifactInspection } from "#inspect"
|
|
|
17
19
|
export { inspectArtifact } from "#inspect"
|
|
18
20
|
export { isCountryCodeAlpha2, parseCountryCodeAlpha2 } from "#iso3166/alpha2"
|
|
19
21
|
export { isCountryCodeAlpha3, parseCountryCodeAlpha3 } from "#iso3166/alpha3"
|
|
22
|
+
|
|
20
23
|
export {
|
|
21
24
|
countryRecordCount,
|
|
22
25
|
countryRecordsHeader,
|
|
@@ -24,6 +27,7 @@ export {
|
|
|
24
27
|
getCountryByAlpha3,
|
|
25
28
|
getCountryByNumeric,
|
|
26
29
|
} from "#iso3166/records"
|
|
30
|
+
|
|
27
31
|
export { alpha2ForAlpha3, alpha2ForNumeric, alpha3ForAlpha2 } from "#iso3166/relations"
|
|
28
32
|
export type { Normalization } from "#normalize"
|
|
29
33
|
export { canonicalSpelling } from "#normalize"
|
package/lib/inspect.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Coverage and provenance inspection: what an artifact's profile holds, read from its header and directory.
|
|
5
|
+
* Coverage and provenance inspection: what an artifact's profile holds,
|
|
6
|
+
* read from its header and directory.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { type Artifact, type ArtifactHeader, Artifact as RGY1Artifact } from "#rgy1/reader"
|
package/lib/iso3166/alpha2.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The strict alpha-2 country-code predicate over the `iso3166-1-alpha2-membership` bitset.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
* that 85-byte bitset and the reader, and no name, airport or record.
|
|
7
|
+
* An import of it retains that 85-byte bitset and the reader, and no name, airport or record.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { iso31661Alpha2MembershipArtifact } from "#artifacts/iso3166-1/alpha2-membership"
|
package/lib/iso3166/alpha3.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The strict alpha-3 country-code predicate over the `iso3166-1-alpha3-membership` bitset.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
* that 2,197-byte bitset and the reader, and no name, airport or record.
|
|
7
|
+
* An import of it retains that 2,197-byte bitset and the reader, and no name, airport or record.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { iso31661Alpha3MembershipArtifact } from "#artifacts/iso3166-1/alpha3-membership"
|
|
@@ -31,7 +31,7 @@ export function alpha3Membership(): BitsetView {
|
|
|
31
31
|
* `AUS` is one.
|
|
32
32
|
* `aus` and `AU` are not.
|
|
33
33
|
*
|
|
34
|
-
* A former code such as `DDR`
|
|
34
|
+
* A former code such as `DDR` isn't: the records artifact still describes it.
|
|
35
35
|
*/
|
|
36
36
|
export function isCountryCodeAlpha3(input: string): input is ISO.CountryCode_3166_1_Alpha3 {
|
|
37
37
|
return alpha3Membership().test(encode3(input))
|
package/lib/iso3166/records.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Country record retrieval over the `iso3166-1-records` artifact: three id tables, six columns and a string pool.
|
|
5
|
+
* Country record retrieval over the `iso3166-1-records` artifact: three id tables,
|
|
6
|
+
* six columns and a string pool.
|
|
7
7
|
*
|
|
8
|
-
* A record is materialized on request and cached by row, so a repeated read
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* A record is materialized on request and cached by row, so a repeated read
|
|
9
|
+
* of one country returns one object.
|
|
10
|
+
* The artifact holds every status; `getCountry*` answers a record of any status and reports it,
|
|
11
|
+
* while the brands and the membership predicates cover officially assigned codes only.
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import { iso31661RecordsArtifact } from "#artifacts/iso3166-1/records"
|
package/lib/iso3166/relations.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The code-equivalence relations of one country entity: alpha-2, alpha-3 and numeric codes of the same record.
|
|
5
|
+
* The code-equivalence relations of one country entity: alpha-2, alpha-3
|
|
6
|
+
* and numeric codes of the same record.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { getCountryByAlpha2, getCountryByAlpha3, getCountryByNumeric } from "#iso3166/records"
|
package/lib/key.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* Key encodings: the position of a code in its direct-address key space,
|
|
6
|
+
* mirroring `crates/registry-core/src/key.rs`.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
8
|
+
* Two or three upper-case ASCII letters encode base-26 with the first letter in the highest place.
|
|
9
|
+
* A three-digit numeric code encodes as its decimal value.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* anything else. A caller normalizes case or whitespace before calling, never here.
|
|
11
|
+
* Every encoder checks length and alphabet first and answers `-1` for anything else.
|
|
12
|
+
* A caller normalizes case or whitespace before calling, never here.
|
|
11
13
|
*/
|
|
12
14
|
|
|
13
15
|
/**
|
package/lib/normalize.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* Explicit input normalization, separate from the strict predicates.
|
|
7
6
|
*
|
|
8
|
-
* `canonicalSpelling` trims ASCII whitespace and upper-cases ASCII letters.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* `canonicalSpelling` trims ASCII whitespace and upper-cases ASCII letters.
|
|
8
|
+
* It reports each change.
|
|
9
|
+
*
|
|
10
|
+
* A caller who wants `" aus "` to reach `AUS` asks for that step.
|
|
11
|
+
* Every other character stays as written.
|
|
12
|
+
*
|
|
13
|
+
* A dot, a dash or a non-ASCII letter reaches the strict predicate unchanged
|
|
14
|
+
* and is refused there with `shape`.
|
|
15
|
+
* Free-text tokenization belongs to Mailwoman, outside this package.
|
|
12
16
|
*/
|
|
13
17
|
|
|
14
18
|
/**
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The country/airport collision index: codes that are both an officially assigned
|
|
6
|
+
* ISO 3166-1 alpha-3 code and an IATA airport code in the profile.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* `isCountryAirportCollision` reads only the 2,197-byte collision bitset.
|
|
9
|
+
* `interpretCountryOrAirportCode` reads the records artifacts and answers every
|
|
10
|
+
* interpretation as a discriminated union, each branch with its own brand and entity,
|
|
11
|
+
* so `AUS` is Australia under one namespace and an airport in the United States under another.
|
|
8
12
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* relations are separate: `same-spelling-as` is the collision, `located-in` is each branch's `country`. The caller
|
|
13
|
-
* ranks the interpretations, and the resolver in Mailwoman does it.
|
|
13
|
+
* The two relations are separate: `same-spelling-as` is the collision,
|
|
14
|
+
* `located-in` is each branch's `country`.
|
|
15
|
+
* The caller ranks the interpretations, and the resolver in Mailwoman does it.
|
|
14
16
|
*/
|
|
15
17
|
|
|
16
18
|
import { countryAirportCollisionArtifact } from "#artifacts/country-airport-collision"
|
|
@@ -69,9 +71,9 @@ export type CodeMatch =
|
|
|
69
71
|
/**
|
|
70
72
|
* Every namespace that holds the spelling, in namespace order: country first, then airport.
|
|
71
73
|
*
|
|
72
|
-
* The order is the namespace list's and
|
|
74
|
+
* The order is the namespace list's and isn't a ranking.
|
|
73
75
|
* An empty array is `not-found-in-snapshot` in every namespace, and a former country code
|
|
74
|
-
*
|
|
76
|
+
* isn't an interpretation here because the current-assignment brand leaves it out.
|
|
75
77
|
*/
|
|
76
78
|
export function interpretCountryOrAirportCode(input: string): CodeMatch[] {
|
|
77
79
|
const matches: CodeMatch[] = []
|
package/lib/rgy1/base64.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* Decodes a generated artifact module's base64 text into bytes, on the platforms the readers run on.
|
|
7
6
|
*/
|
|
8
7
|
|
package/lib/rgy1/reader.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* The synchronous RGY1 reader: validate an artifact once, then probe its tables in place.
|
|
7
6
|
*
|
|
8
|
-
* The reader mirrors `crates/registry-core/src/artifact.rs` and follows `docs/rgy1.md`.
|
|
9
|
-
* `DataView` over the caller's bytes, honoring `byteOffset`, so an
|
|
10
|
-
*
|
|
7
|
+
* The reader mirrors `crates/registry-core/src/artifact.rs` and follows `docs/rgy1.md`.
|
|
8
|
+
* It reads through a `DataView` over the caller's bytes, honoring `byteOffset`, so an
|
|
9
|
+
* artifact handed over as a subarray behaves as the same bytes would in their own buffer.
|
|
10
|
+
*
|
|
11
|
+
* No `Map` is rebuilt: a probe is an arithmetic index into the section's payload.
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The RGY1 section kinds.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
* definition rather than this file.
|
|
7
|
+
* Generated from definitions/sections.json by tools/generate-sections.run.ts.
|
|
8
|
+
* Edit the definition rather than this file.
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
/**
|
package/lib/rgy1/views.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* Typed views over an artifact's sections: bitset, id table, column, string pool and relation.
|
|
7
6
|
*/
|
|
8
7
|
|
|
@@ -33,7 +32,7 @@ export class BitsetView {
|
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
34
|
* Whether `key` is a member.
|
|
36
|
-
* A key outside the space
|
|
35
|
+
* A key outside the space isn't.
|
|
37
36
|
*/
|
|
38
37
|
test(key: number): boolean {
|
|
39
38
|
if (key < 0) return false
|
|
@@ -45,7 +44,7 @@ export class BitsetView {
|
|
|
45
44
|
|
|
46
45
|
/**
|
|
47
46
|
* Whether a code in its canonical spelling is a member.
|
|
48
|
-
* A code outside the grammar
|
|
47
|
+
* A code outside the grammar isn't.
|
|
49
48
|
*/
|
|
50
49
|
contains(code: string): boolean {
|
|
51
50
|
return this.test(encodeForArity(this.arity, code))
|
package/lib/types.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* Branded identifier types.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* A brand is a declaration-only unique symbol, so a branded value is a plain string at runtime
|
|
8
|
+
* and the compiler refuses to pass one namespace's code where another's is expected.
|
|
8
9
|
*
|
|
9
|
-
* A branded value records that a validator accepted it under a documented profile at the time of the call.
|
|
10
|
-
* issuing authority's later assignments are outside what the brand records.
|
|
10
|
+
* A branded value records that a validator accepted it under a documented profile at the time of the call.
|
|
11
|
+
* The issuing authority's later assignments are outside what the brand records.
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
/**
|