@mailwoman/core 11.2.0 → 11.3.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 +2 -2
- package/lib/api/ckan.ts +1 -1
- package/lib/api/disk-storage.ts +2 -2
- package/lib/api/ogc.ts +1 -1
- package/lib/api/retry.ts +7 -2
- package/lib/api/test/transport.ts +1 -1
- package/lib/{binary-frame.ts → asset/binary-frame.ts} +1 -1
- package/lib/async/abort.ts +100 -0
- package/lib/{memoize.ts → async/memoize.ts} +2 -2
- package/lib/{promises.ts → async/promises.ts} +1 -1
- package/lib/cloudflare/tokens.ts +1 -1
- package/lib/cloudflare/wrangler.ts +3 -3
- package/lib/crypto/digest.ts +1 -1
- package/lib/crypto/ed25519.ts +8 -0
- package/lib/crypto/node.ts +1 -1
- package/lib/data-root.ts +16 -3
- package/lib/decoder/containment.ts +4 -1
- package/lib/decoder/serialize/outline.ts +19 -6
- package/lib/decoder/types.ts +9 -1
- package/lib/env/schema.ts +5 -0
- package/lib/fs/deflate64.ts +1 -1
- package/lib/fs/lock.ts +183 -25
- package/lib/fs/readers.ts +1 -1
- package/lib/fs/writers.ts +1 -1
- package/lib/geocode/result.ts +50 -6
- package/lib/html/text.ts +2 -2
- package/lib/index.ts +0 -1
- package/lib/layers/artifact.ts +2 -2
- package/lib/layers/coverage.ts +1 -1
- package/lib/layers/manifest.ts +94 -2
- package/lib/layers/provenance.ts +246 -0
- package/lib/layers/publication.ts +4 -3
- package/lib/layers/selection.ts +2 -2
- package/lib/license/branch.ts +66 -0
- package/lib/license/configured.ts +4 -2
- package/lib/license/declaration.ts +1 -1
- package/lib/license/key/file.ts +1 -1
- package/lib/license/key.ts +148 -201
- package/lib/license/provenance.ts +193 -0
- package/lib/license/register.ts +7 -78
- package/lib/license/stamp.ts +8 -2
- package/lib/license/text-url.ts +55 -0
- package/lib/license/training.ts +67 -0
- package/lib/license.ts +7 -6
- package/lib/locale/registry.ts +1 -1
- package/lib/locale/zh-cn-units.ts +1 -1
- package/lib/module/workspace.ts +1 -1
- package/lib/{routing.ts → network/routing.ts} +1 -1
- package/lib/pipeline/result.ts +6 -25
- package/lib/pipeline/runtime-pipeline.ts +129 -144
- package/lib/pipeline/stage.ts +290 -0
- package/lib/pipeline/types.ts +33 -14
- package/lib/pipeline.ts +14 -2
- package/lib/{git.ts → repo/git.ts} +21 -1
- package/lib/{release-config.ts → repo/release-config.ts} +8 -0
- package/lib/{spdx-header.ts → repo/spdx-header.ts} +8 -0
- package/lib/{workspaces.ts → repo/workspaces.ts} +1 -1
- package/lib/resolver/lookup-types.ts +1 -1
- package/lib/resolver/region-database-provider.ts +33 -0
- package/lib/resolver/synthetic-id-ranges.ts +19 -9
- package/lib/resolver/types.ts +220 -7
- package/lib/resolver.ts +14 -1
- package/lib/state-machine.ts +1 -1
- package/lib/strings/python-json.ts +3 -2
- package/lib/utils/chunk-process.ts +2 -2
- package/lib/utils/geodatabase-archive.ts +1 -1
- package/lib/utils/time.ts +136 -12
- package/lib/utils.ts +4 -4
- package/out/api/ckan.js +1 -1
- package/out/api/ckan.js.map +1 -1
- package/out/api/disk-storage.d.ts.map +1 -1
- package/out/api/disk-storage.js +2 -2
- package/out/api/disk-storage.js.map +1 -1
- package/out/api/ogc.js +1 -1
- package/out/api/ogc.js.map +1 -1
- package/out/api/retry.d.ts.map +1 -1
- package/out/api/retry.js +6 -2
- package/out/api/retry.js.map +1 -1
- package/out/api/test/transport.js +1 -1
- package/out/api/test/transport.js.map +1 -1
- package/out/asset/binary-frame.d.ts.map +1 -0
- package/out/{binary-frame.js → asset/binary-frame.js} +1 -1
- package/out/asset/binary-frame.js.map +1 -0
- package/out/asset/load-ledger.d.ts.map +1 -0
- package/out/asset/load-ledger.js.map +1 -0
- package/out/asset/overture-pins.d.ts.map +1 -0
- package/out/asset/overture-pins.js.map +1 -0
- package/out/asset/postcode-prefix-files.d.ts.map +1 -0
- package/out/asset/postcode-prefix-files.js.map +1 -0
- package/out/async/abort.d.ts +57 -0
- package/out/async/abort.d.ts.map +1 -0
- package/out/async/abort.js +89 -0
- package/out/async/abort.js.map +1 -0
- package/out/async/memoize.d.ts.map +1 -0
- package/out/{memoize.js → async/memoize.js} +2 -2
- package/out/async/memoize.js.map +1 -0
- package/out/{promises.d.ts → async/promises.d.ts} +1 -1
- package/out/async/promises.d.ts.map +1 -0
- package/out/{promises.js → async/promises.js} +1 -1
- package/out/async/promises.js.map +1 -0
- package/out/cloudflare/tokens.js +1 -1
- package/out/cloudflare/tokens.js.map +1 -1
- package/out/cloudflare/wrangler.js +3 -3
- package/out/cloudflare/wrangler.js.map +1 -1
- package/out/crypto/digest.d.ts +1 -1
- package/out/crypto/digest.js +1 -1
- package/out/crypto/ed25519.d.ts +7 -0
- package/out/crypto/ed25519.d.ts.map +1 -1
- package/out/crypto/ed25519.js +7 -0
- package/out/crypto/ed25519.js.map +1 -1
- package/out/crypto/hash.d.ts.map +1 -0
- package/out/crypto/hash.js.map +1 -0
- package/out/crypto/node.js +1 -1
- package/out/crypto/node.js.map +1 -1
- package/out/data-root.d.ts +11 -3
- package/out/data-root.d.ts.map +1 -1
- package/out/data-root.js +14 -3
- package/out/data-root.js.map +1 -1
- package/out/decoder/containment.d.ts.map +1 -1
- package/out/decoder/containment.js +1 -1
- package/out/decoder/containment.js.map +1 -1
- package/out/decoder/serialize/outline.d.ts +9 -0
- package/out/decoder/serialize/outline.d.ts.map +1 -1
- package/out/decoder/serialize/outline.js +16 -6
- package/out/decoder/serialize/outline.js.map +1 -1
- package/out/decoder/types.d.ts +8 -0
- package/out/decoder/types.d.ts.map +1 -1
- package/out/decoder/types.js +1 -1
- package/out/decoder/types.js.map +1 -1
- package/out/env/schema.d.ts +1 -0
- package/out/env/schema.d.ts.map +1 -1
- package/out/env/schema.js +4 -0
- package/out/env/schema.js.map +1 -1
- package/out/env.d.ts +1 -0
- package/out/env.d.ts.map +1 -1
- package/out/fs/deflate64.js +1 -1
- package/out/fs/deflate64.js.map +1 -1
- package/out/fs/lock.d.ts +73 -4
- package/out/fs/lock.d.ts.map +1 -1
- package/out/fs/lock.js +96 -19
- package/out/fs/lock.js.map +1 -1
- package/out/fs/readers.js +1 -1
- package/out/fs/readers.js.map +1 -1
- package/out/fs/writers.d.ts +1 -1
- package/out/fs/writers.d.ts.map +1 -1
- package/out/fs/writers.js +1 -1
- package/out/fs/writers.js.map +1 -1
- package/out/geocode/result.d.ts +25 -1
- package/out/geocode/result.d.ts.map +1 -1
- package/out/geocode/result.js +49 -6
- package/out/geocode/result.js.map +1 -1
- package/out/html/text.js +2 -2
- package/out/html/trust-policies.d.ts.map +1 -0
- package/out/html/trust-policies.js.map +1 -0
- package/out/index.d.ts +0 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +0 -1
- package/out/index.js.map +1 -1
- package/out/layers/artifact.js +2 -2
- package/out/layers/artifact.js.map +1 -1
- package/out/layers/coverage.d.ts.map +1 -1
- package/out/layers/coverage.js +1 -1
- package/out/layers/coverage.js.map +1 -1
- package/out/layers/manifest.d.ts +53 -0
- package/out/layers/manifest.d.ts.map +1 -1
- package/out/layers/manifest.js +68 -2
- package/out/layers/manifest.js.map +1 -1
- package/out/layers/provenance.d.ts +127 -0
- package/out/layers/provenance.d.ts.map +1 -0
- package/out/layers/provenance.js +122 -0
- package/out/layers/provenance.js.map +1 -0
- package/out/layers/publication.d.ts.map +1 -1
- package/out/layers/publication.js +3 -3
- package/out/layers/publication.js.map +1 -1
- package/out/layers/selection.d.ts.map +1 -1
- package/out/layers/selection.js +2 -2
- package/out/layers/selection.js.map +1 -1
- package/out/license/branch.d.ts +33 -0
- package/out/license/branch.d.ts.map +1 -0
- package/out/license/branch.js +52 -0
- package/out/license/branch.js.map +1 -0
- package/out/license/configured.d.ts +1 -1
- package/out/license/configured.d.ts.map +1 -1
- package/out/license/configured.js +1 -9
- package/out/license/configured.js.map +1 -1
- package/out/license/declaration.d.ts +1 -1
- package/out/license/declaration.d.ts.map +1 -1
- package/out/license/key/file.js +1 -1
- package/out/license/key/file.js.map +1 -1
- package/out/license/key.d.ts +27 -115
- package/out/license/key.d.ts.map +1 -1
- package/out/license/key.js +98 -164
- package/out/license/key.js.map +1 -1
- package/out/license/provenance.d.ts +47 -0
- package/out/license/provenance.d.ts.map +1 -0
- package/out/license/provenance.js +134 -0
- package/out/license/provenance.js.map +1 -0
- package/out/license/register.d.ts +6 -47
- package/out/license/register.d.ts.map +1 -1
- package/out/license/register.js +7 -58
- package/out/license/register.js.map +1 -1
- package/out/license/stamp.d.ts +7 -1
- package/out/license/stamp.d.ts.map +1 -1
- package/out/license/stamp.js +2 -2
- package/out/license/stamp.js.map +1 -1
- package/out/license/text-url.d.ts +9 -0
- package/out/license/text-url.d.ts.map +1 -0
- package/out/license/text-url.js +49 -0
- package/out/license/text-url.js.map +1 -0
- package/out/license/training.d.ts +29 -0
- package/out/license/training.d.ts.map +1 -0
- package/out/license/training.js +52 -0
- package/out/license/training.js.map +1 -0
- package/out/license.d.ts +7 -6
- package/out/license.d.ts.map +1 -1
- package/out/license.js +7 -6
- package/out/license.js.map +1 -1
- package/out/locale/registry.d.ts.map +1 -1
- package/out/locale/registry.js +1 -1
- package/out/locale/registry.js.map +1 -1
- package/out/locale/zh-cn-units.js +1 -1
- package/out/locale/zh-cn-units.js.map +1 -1
- package/out/math/numeric.d.ts.map +1 -0
- package/out/math/numeric.js.map +1 -0
- package/out/math/random.d.ts.map +1 -0
- package/out/math/random.js.map +1 -0
- package/out/math/stats.d.ts.map +1 -0
- package/out/math/stats.js.map +1 -0
- package/out/module/workspace.js +1 -1
- package/out/module/workspace.js.map +1 -1
- package/out/network/routing.d.ts.map +1 -0
- package/out/{routing.js → network/routing.js} +1 -1
- package/out/network/routing.js.map +1 -0
- package/out/pipeline/result.d.ts +7 -24
- package/out/pipeline/result.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.d.ts +7 -2
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +56 -103
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/stage.d.ts +180 -0
- package/out/pipeline/stage.d.ts.map +1 -0
- package/out/pipeline/stage.js +130 -0
- package/out/pipeline/stage.js.map +1 -0
- package/out/pipeline/types.d.ts +31 -12
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +0 -8
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline.d.ts +5 -3
- package/out/pipeline.d.ts.map +1 -1
- package/out/pipeline.js +2 -1
- package/out/pipeline.js.map +1 -1
- package/out/{git.d.ts → repo/git.d.ts} +10 -1
- package/out/repo/git.d.ts.map +1 -0
- package/out/{git.js → repo/git.js} +14 -1
- package/out/repo/git.js.map +1 -0
- package/out/{release-config.d.ts → repo/release-config.d.ts} +8 -0
- package/out/repo/release-config.d.ts.map +1 -0
- package/out/repo/release-config.js.map +1 -0
- package/out/repo/scope-config.d.ts.map +1 -0
- package/out/repo/scope-config.js.map +1 -0
- package/out/repo/spdx-header.d.ts.map +1 -0
- package/out/{spdx-header.js → repo/spdx-header.js} +7 -0
- package/out/repo/spdx-header.js.map +1 -0
- package/out/repo/vale.d.ts.map +1 -0
- package/out/repo/vale.js.map +1 -0
- package/out/repo/workspaces.d.ts.map +1 -0
- package/out/{workspaces.js → repo/workspaces.js} +1 -1
- package/out/repo/workspaces.js.map +1 -0
- package/out/resolver/lookup-types.d.ts +1 -1
- package/out/resolver/region-database-provider.d.ts +30 -0
- package/out/resolver/region-database-provider.d.ts.map +1 -1
- package/out/resolver/synthetic-id-ranges.d.ts +15 -8
- package/out/resolver/synthetic-id-ranges.d.ts.map +1 -1
- package/out/resolver/synthetic-id-ranges.js +18 -9
- package/out/resolver/synthetic-id-ranges.js.map +1 -1
- package/out/resolver/types.d.ts +192 -8
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js +56 -0
- package/out/resolver/types.js.map +1 -1
- package/out/resolver.d.ts +3 -3
- package/out/resolver.d.ts.map +1 -1
- package/out/resolver.js +1 -1
- package/out/resolver.js.map +1 -1
- package/out/scripting/process.d.ts.map +1 -0
- package/out/scripting/process.js.map +1 -0
- package/out/scripting/workers.d.ts.map +1 -0
- package/out/scripting/workers.js.map +1 -0
- package/out/state-machine.d.ts +1 -1
- package/out/strings/python-json.d.ts +2 -1
- package/out/strings/python-json.d.ts.map +1 -1
- package/out/strings/python-json.js +1 -1
- package/out/strings/python-json.js.map +1 -1
- package/out/tools/build-deflate64-wasm.run.js +2 -2
- package/out/tools/build-deflate64-wasm.run.js.map +1 -1
- package/out/tools/coarse-placer/build/dataset.js +1 -1
- package/out/tools/coarse-placer/build/dataset.js.map +1 -1
- package/out/tools/coarse-placer/build/outlier/exposure.js +1 -1
- package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -1
- package/out/tools/coarse-placer/build/outlier/latin.d.ts.map +1 -1
- package/out/tools/coarse-placer/build/outlier/latin.js +5 -1
- package/out/tools/coarse-placer/build/outlier/latin.js.map +1 -1
- package/out/tools/coarse-placer/country-sets.d.ts +2 -2
- package/out/tools/coarse-placer/country-sets.js +2 -2
- package/out/tools/coarse-placer/outlier-rows.js +2 -2
- package/out/tools/coarse-placer/outlier-rows.js.map +1 -1
- package/out/tools/coarse-placer/train.js +1 -1
- package/out/tools/coarse-placer/train.js.map +1 -1
- package/out/tools/generate-language-types.js +2 -2
- package/out/tools/generate-language-types.js.map +1 -1
- package/out/tools/license/product-fixtures.run.d.ts +2 -0
- package/out/tools/license/product-fixtures.run.d.ts.map +1 -0
- package/out/tools/license/product-fixtures.run.js +350 -0
- package/out/tools/license/product-fixtures.run.js.map +1 -0
- package/out/utils/chunk-process.js +2 -2
- package/out/utils/chunk-process.js.map +1 -1
- package/out/utils/geodatabase-archive.js +1 -1
- package/out/utils/geodatabase-archive.js.map +1 -1
- package/out/utils/time.d.ts +15 -4
- package/out/utils/time.d.ts.map +1 -1
- package/out/utils/time.js +114 -12
- package/out/utils/time.js.map +1 -1
- package/out/utils.d.ts +4 -4
- package/out/utils.d.ts.map +1 -1
- package/out/utils.js +4 -4
- package/out/utils.js.map +1 -1
- package/out/values/identical.d.ts.map +1 -0
- package/out/values/identical.js.map +1 -0
- package/out/values/json.d.ts.map +1 -0
- package/out/values/json.js.map +1 -0
- package/out/values/objects.d.ts.map +1 -0
- package/out/values/objects.js.map +1 -0
- package/package.json +278 -243
- package/tools/build-deflate64-wasm.run.ts +2 -2
- package/tools/coarse-placer/build/dataset.ts +1 -1
- package/tools/coarse-placer/build/outlier/exposure.ts +1 -1
- package/tools/coarse-placer/build/outlier/latin.ts +5 -1
- package/tools/coarse-placer/country-sets.ts +2 -2
- package/tools/coarse-placer/outlier-rows.ts +2 -2
- package/tools/coarse-placer/train.ts +1 -1
- package/tools/generate-language-types.ts +2 -2
- package/tools/license/product-fixtures.run.ts +449 -0
- package/lib/collections.ts +0 -5
- package/lib/license/decision.ts +0 -329
- package/lib/license/obligations.ts +0 -256
- package/lib/license/record.ts +0 -277
- package/lib/scripting/ingest-chunk-script.ts +0 -87
- package/out/binary-frame.d.ts.map +0 -1
- package/out/binary-frame.js.map +0 -1
- package/out/collections.d.ts +0 -2
- package/out/collections.d.ts.map +0 -1
- package/out/collections.js +0 -5
- package/out/collections.js.map +0 -1
- package/out/git.d.ts.map +0 -1
- package/out/git.js.map +0 -1
- package/out/hash.d.ts.map +0 -1
- package/out/hash.js.map +0 -1
- package/out/identical.d.ts.map +0 -1
- package/out/identical.js.map +0 -1
- package/out/json.d.ts.map +0 -1
- package/out/json.js.map +0 -1
- package/out/license/decision.d.ts +0 -179
- package/out/license/decision.d.ts.map +0 -1
- package/out/license/decision.js +0 -169
- package/out/license/decision.js.map +0 -1
- package/out/license/obligations.d.ts +0 -102
- package/out/license/obligations.d.ts.map +0 -1
- package/out/license/obligations.js +0 -188
- package/out/license/obligations.js.map +0 -1
- package/out/license/record.d.ts +0 -136
- package/out/license/record.d.ts.map +0 -1
- package/out/license/record.js +0 -222
- package/out/license/record.js.map +0 -1
- package/out/load-ledger.d.ts.map +0 -1
- package/out/load-ledger.js.map +0 -1
- package/out/memoize.d.ts.map +0 -1
- package/out/memoize.js.map +0 -1
- package/out/numeric.d.ts.map +0 -1
- package/out/numeric.js.map +0 -1
- package/out/objects.d.ts.map +0 -1
- package/out/objects.js.map +0 -1
- package/out/overture-pins.d.ts.map +0 -1
- package/out/overture-pins.js.map +0 -1
- package/out/postcode-prefix-files.d.ts.map +0 -1
- package/out/postcode-prefix-files.js.map +0 -1
- package/out/process.d.ts.map +0 -1
- package/out/process.js.map +0 -1
- package/out/promises.d.ts.map +0 -1
- package/out/promises.js.map +0 -1
- package/out/random.d.ts.map +0 -1
- package/out/random.js.map +0 -1
- package/out/release-config.d.ts.map +0 -1
- package/out/release-config.js.map +0 -1
- package/out/routing.d.ts.map +0 -1
- package/out/routing.js.map +0 -1
- package/out/scope-config.d.ts.map +0 -1
- package/out/scope-config.js.map +0 -1
- package/out/scripting/ingest-chunk-script.d.ts +0 -58
- package/out/scripting/ingest-chunk-script.d.ts.map +0 -1
- package/out/scripting/ingest-chunk-script.js +0 -47
- package/out/scripting/ingest-chunk-script.js.map +0 -1
- package/out/spdx-header.d.ts.map +0 -1
- package/out/spdx-header.js.map +0 -1
- package/out/stats.d.ts.map +0 -1
- package/out/stats.js.map +0 -1
- package/out/trust-policies.d.ts.map +0 -1
- package/out/trust-policies.js.map +0 -1
- package/out/vale.d.ts.map +0 -1
- package/out/vale.js.map +0 -1
- package/out/workers.d.ts.map +0 -1
- package/out/workers.js.map +0 -1
- package/out/workspaces.d.ts.map +0 -1
- package/out/workspaces.js.map +0 -1
- /package/lib/{load-ledger.ts → asset/load-ledger.ts} +0 -0
- /package/lib/{overture-pins.ts → asset/overture-pins.ts} +0 -0
- /package/lib/{postcode-prefix-files.ts → asset/postcode-prefix-files.ts} +0 -0
- /package/lib/{hash.ts → crypto/hash.ts} +0 -0
- /package/lib/{trust-policies.ts → html/trust-policies.ts} +0 -0
- /package/lib/{numeric.ts → math/numeric.ts} +0 -0
- /package/lib/{random.ts → math/random.ts} +0 -0
- /package/lib/{stats.ts → math/stats.ts} +0 -0
- /package/lib/{scope-config.ts → repo/scope-config.ts} +0 -0
- /package/lib/{vale.ts → repo/vale.ts} +0 -0
- /package/lib/{process.ts → scripting/process.ts} +0 -0
- /package/lib/{workers.ts → scripting/workers.ts} +0 -0
- /package/lib/{identical.ts → values/identical.ts} +0 -0
- /package/lib/{json.ts → values/json.ts} +0 -0
- /package/lib/{objects.ts → values/objects.ts} +0 -0
- /package/out/{binary-frame.d.ts → asset/binary-frame.d.ts} +0 -0
- /package/out/{load-ledger.d.ts → asset/load-ledger.d.ts} +0 -0
- /package/out/{load-ledger.js → asset/load-ledger.js} +0 -0
- /package/out/{overture-pins.d.ts → asset/overture-pins.d.ts} +0 -0
- /package/out/{overture-pins.js → asset/overture-pins.js} +0 -0
- /package/out/{postcode-prefix-files.d.ts → asset/postcode-prefix-files.d.ts} +0 -0
- /package/out/{postcode-prefix-files.js → asset/postcode-prefix-files.js} +0 -0
- /package/out/{memoize.d.ts → async/memoize.d.ts} +0 -0
- /package/out/{hash.d.ts → crypto/hash.d.ts} +0 -0
- /package/out/{hash.js → crypto/hash.js} +0 -0
- /package/out/{trust-policies.d.ts → html/trust-policies.d.ts} +0 -0
- /package/out/{trust-policies.js → html/trust-policies.js} +0 -0
- /package/out/{numeric.d.ts → math/numeric.d.ts} +0 -0
- /package/out/{numeric.js → math/numeric.js} +0 -0
- /package/out/{random.d.ts → math/random.d.ts} +0 -0
- /package/out/{random.js → math/random.js} +0 -0
- /package/out/{stats.d.ts → math/stats.d.ts} +0 -0
- /package/out/{stats.js → math/stats.js} +0 -0
- /package/out/{routing.d.ts → network/routing.d.ts} +0 -0
- /package/out/{release-config.js → repo/release-config.js} +0 -0
- /package/out/{scope-config.d.ts → repo/scope-config.d.ts} +0 -0
- /package/out/{scope-config.js → repo/scope-config.js} +0 -0
- /package/out/{spdx-header.d.ts → repo/spdx-header.d.ts} +0 -0
- /package/out/{vale.d.ts → repo/vale.d.ts} +0 -0
- /package/out/{vale.js → repo/vale.js} +0 -0
- /package/out/{workspaces.d.ts → repo/workspaces.d.ts} +0 -0
- /package/out/{process.d.ts → scripting/process.d.ts} +0 -0
- /package/out/{process.js → scripting/process.js} +0 -0
- /package/out/{workers.d.ts → scripting/workers.d.ts} +0 -0
- /package/out/{workers.js → scripting/workers.js} +0 -0
- /package/out/{identical.d.ts → values/identical.d.ts} +0 -0
- /package/out/{identical.js → values/identical.js} +0 -0
- /package/out/{json.d.ts → values/json.d.ts} +0 -0
- /package/out/{json.js → values/json.js} +0 -0
- /package/out/{objects.d.ts → values/objects.d.ts} +0 -0
- /package/out/{objects.js → values/objects.js} +0 -0
package/lib/license/decision.ts
DELETED
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
-
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A license decision records three things: whether a person read a publisher's terms,
|
|
6
|
-
* the grant they elected, and what that grant permits for each act this
|
|
7
|
-
* repository performs on the publisher's data.
|
|
8
|
-
*
|
|
9
|
-
* Every register of third-party data uses this shape: the address-source register in
|
|
10
|
-
* `@mailwoman/corpus` and the building and landmark register in `@mailwoman/structures`.
|
|
11
|
-
* Each register defines its own operation list, such as `train` for an address corpus
|
|
12
|
-
* or `convert` for a building model, and passes it as the `Operation` parameter.
|
|
13
|
-
*
|
|
14
|
-
* {@linkcode LicenseResolution} in `#license/record` answers a different question.
|
|
15
|
-
* It records whether a license string mapped to an expression with known obligations,
|
|
16
|
-
* whereas a decision records a person's review of terms.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import { stringifyJSON } from "#json"
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The review state of a source's terms.
|
|
23
|
-
*
|
|
24
|
-
* Only an `elected` decision can admit a source into any build.
|
|
25
|
-
*/
|
|
26
|
-
export const LicenseReviewState = {
|
|
27
|
-
/**
|
|
28
|
-
* The publisher's terms have no review record.
|
|
29
|
-
*
|
|
30
|
-
* The research pass's license text is kept verbatim in
|
|
31
|
-
* {@linkcode UncheckedLicense.publisherStatement} and grants no license.
|
|
32
|
-
*/
|
|
33
|
-
Unchecked: "unchecked",
|
|
34
|
-
/**
|
|
35
|
-
* A reviewer read the terms, elected one grant, retrieved a copy and recorded the reason.
|
|
36
|
-
*/
|
|
37
|
-
Elected: "elected",
|
|
38
|
-
/**
|
|
39
|
-
* A reviewer read the terms and rejected the source.
|
|
40
|
-
* The row records the reason.
|
|
41
|
-
*/
|
|
42
|
-
Refused: "refused",
|
|
43
|
-
} as const
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* One of the {@link LicenseReviewState} values.
|
|
47
|
-
*/
|
|
48
|
-
export type LicenseReviewState = (typeof LicenseReviewState)[keyof typeof LicenseReviewState]
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* A license decision whose terms have no review record.
|
|
52
|
-
*/
|
|
53
|
-
export interface UncheckedLicense {
|
|
54
|
-
licenseID: string
|
|
55
|
-
state: typeof LicenseReviewState.Unchecked
|
|
56
|
-
/**
|
|
57
|
-
* The research pass's license text, verbatim.
|
|
58
|
-
*
|
|
59
|
-
* Most values are access labels such as `Free` or `Licensed` that make no
|
|
60
|
-
* statement about redistribution or adaptation.
|
|
61
|
-
*/
|
|
62
|
-
publisherStatement: string
|
|
63
|
-
note: string
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* What a grant permits for one operation.
|
|
68
|
-
*
|
|
69
|
-
* `unreviewed` means the terms lack an operation-specific review.
|
|
70
|
-
* Eligibility checks treat it as blocking.
|
|
71
|
-
* The state stays distinct from `refused`.
|
|
72
|
-
*/
|
|
73
|
-
export const OperationPermission = {
|
|
74
|
-
Permitted: "permitted",
|
|
75
|
-
Refused: "refused",
|
|
76
|
-
Unreviewed: "unreviewed",
|
|
77
|
-
} as const
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* One of the {@link OperationPermission} values.
|
|
81
|
-
*/
|
|
82
|
-
export type OperationPermission = (typeof OperationPermission)[keyof typeof OperationPermission]
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* The legal basis of a permission.
|
|
86
|
-
*
|
|
87
|
-
* Most permissions rest on a publisher grant.
|
|
88
|
-
* The other values mark permissions with a different basis.
|
|
89
|
-
*/
|
|
90
|
-
export const PermissionBasis = {
|
|
91
|
-
PublisherGrant: "publisher-grant",
|
|
92
|
-
StatutoryException: "statutory-exception",
|
|
93
|
-
OtherDocumented: "other-documented",
|
|
94
|
-
} as const
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* One of the {@link PermissionBasis} values.
|
|
98
|
-
*/
|
|
99
|
-
export type PermissionBasis = (typeof PermissionBasis)[keyof typeof PermissionBasis]
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* The permission recorded for one operation, with its basis and reason.
|
|
103
|
-
*/
|
|
104
|
-
export interface OperationDecision {
|
|
105
|
-
permission: OperationPermission
|
|
106
|
-
/**
|
|
107
|
-
* The audit requires a permission basis when the permission is `permitted`.
|
|
108
|
-
*/
|
|
109
|
-
basis?: PermissionBasis
|
|
110
|
-
/**
|
|
111
|
-
* The relevant sentence in the terms, or the reason for a refusal.
|
|
112
|
-
*/
|
|
113
|
-
because: string
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* A license decision whose terms a reviewer read and under which one grant was elected.
|
|
118
|
-
*/
|
|
119
|
-
export interface ElectedLicense<Operation extends string = string> {
|
|
120
|
-
licenseID: string
|
|
121
|
-
state: typeof LicenseReviewState.Elected
|
|
122
|
-
/**
|
|
123
|
-
* The elected terms as the publisher names them, such as `Licence Ouverte 2.0`.
|
|
124
|
-
*/
|
|
125
|
-
electedTerms: string
|
|
126
|
-
/**
|
|
127
|
-
* The SPDX identifier, when one applies.
|
|
128
|
-
*
|
|
129
|
-
* {@linkcode electedTermsLabel} prefers this value to {@linkcode ElectedLicense.electedTerms}.
|
|
130
|
-
*/
|
|
131
|
-
spdx?: string
|
|
132
|
-
/**
|
|
133
|
-
* Every grant the publisher states, where its surfaces state more than one.
|
|
134
|
-
*
|
|
135
|
-
* A publisher may state different terms in its dataset metadata, its download service
|
|
136
|
-
* and its website, and it may be offering the same material under more than one license.
|
|
137
|
-
* Creative Commons permits that.
|
|
138
|
-
*
|
|
139
|
-
* Where that happens, {@linkcode ElectedLicense.spdx} records the one a build filters on
|
|
140
|
-
* and this records what the publisher said, so a later reviewer reads the conflict
|
|
141
|
-
* rather than one reading presented as settled.
|
|
142
|
-
*
|
|
143
|
-
* The engineering policy elects the strictest grant for what a release may include.
|
|
144
|
-
* It doesn't establish which grant governs, and `electedBecause` states the substantive ground separately.
|
|
145
|
-
*/
|
|
146
|
-
candidateGrants?: readonly string[]
|
|
147
|
-
termsVersion?: string
|
|
148
|
-
/**
|
|
149
|
-
* The location of the retrieved copy of the terms, so later reviewers read the same text.
|
|
150
|
-
*/
|
|
151
|
-
retrievedCopy: string
|
|
152
|
-
retrievedAt?: string
|
|
153
|
-
/**
|
|
154
|
-
* The reason for electing this grant, or a note that the source offers only one.
|
|
155
|
-
*/
|
|
156
|
-
electedBecause: string
|
|
157
|
-
/**
|
|
158
|
-
* The permission for each reviewed operation.
|
|
159
|
-
*
|
|
160
|
-
* An omitted operation reads as `unreviewed`.
|
|
161
|
-
*/
|
|
162
|
-
operations?: Partial<Record<Operation, OperationDecision>>
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* A license decision whose terms a reviewer read and refused.
|
|
167
|
-
*/
|
|
168
|
-
export interface RefusedLicense {
|
|
169
|
-
licenseID: string
|
|
170
|
-
state: typeof LicenseReviewState.Refused
|
|
171
|
-
publisherStatement?: string
|
|
172
|
-
refusedBecause: string
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* A license decision in any review state.
|
|
177
|
-
*/
|
|
178
|
-
export type LicenseDecision<Operation extends string = string> =
|
|
179
|
-
| UncheckedLicense
|
|
180
|
-
| ElectedLicense<Operation>
|
|
181
|
-
| RefusedLicense
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Returns the label a share-alike or exclusion filter matches by prefix: the SPDX identifier
|
|
185
|
-
* when one is recorded, otherwise the publisher's name for the terms.
|
|
186
|
-
*
|
|
187
|
-
* The function returns `null` until someone has elected terms for the decision.
|
|
188
|
-
*/
|
|
189
|
-
export function electedTermsLabel(decision: LicenseDecision): string | null {
|
|
190
|
-
if (decision.state !== LicenseReviewState.Elected) return null
|
|
191
|
-
|
|
192
|
-
return decision.spdx ?? decision.electedTerms
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Returns the recorded permission for one operation under a license decision.
|
|
197
|
-
*
|
|
198
|
-
* The result is `unreviewed` when the decision isn't elected or doesn't mention the operation.
|
|
199
|
-
* The selected terms establish which terms apply.
|
|
200
|
-
* Each operation still needs its own review.
|
|
201
|
-
*/
|
|
202
|
-
export function permissionFor<Operation extends string>(
|
|
203
|
-
decision: LicenseDecision<Operation>,
|
|
204
|
-
operation: Operation
|
|
205
|
-
): OperationDecision {
|
|
206
|
-
if (decision.state !== LicenseReviewState.Elected) {
|
|
207
|
-
return {
|
|
208
|
-
permission: OperationPermission.Unreviewed,
|
|
209
|
-
because: `the decision reads ${decision.state}, so no operation has been read against terms`,
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return (
|
|
214
|
-
decision.operations?.[operation] ?? {
|
|
215
|
-
permission: OperationPermission.Unreviewed,
|
|
216
|
-
because: `the elected terms do not state whether ${operation} is permitted`,
|
|
217
|
-
}
|
|
218
|
-
)
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Returns a reason for every operation the decision doesn't permit,
|
|
223
|
-
* or an empty array when it permits them all.
|
|
224
|
-
*
|
|
225
|
-
* `licenseID` is the id the source row points at.
|
|
226
|
-
* A decision that's absent, unchecked or refused yields one reason naming that state.
|
|
227
|
-
*/
|
|
228
|
-
export function operationProblems<Operation extends string>(
|
|
229
|
-
licenseID: string,
|
|
230
|
-
decision: LicenseDecision<Operation> | undefined,
|
|
231
|
-
operations: readonly Operation[]
|
|
232
|
-
): string[] {
|
|
233
|
-
const named = stringifyJSON(licenseID)
|
|
234
|
-
|
|
235
|
-
if (!decision) return [`license ${named} is not declared in the register`]
|
|
236
|
-
|
|
237
|
-
if (decision.state !== LicenseReviewState.Elected) {
|
|
238
|
-
return [`license ${named} is ${decision.state}, and only elected terms admit a source`]
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const problems: string[] = []
|
|
242
|
-
|
|
243
|
-
for (const operation of operations) {
|
|
244
|
-
const reading = permissionFor(decision, operation)
|
|
245
|
-
|
|
246
|
-
if (reading.permission === OperationPermission.Permitted) continue
|
|
247
|
-
|
|
248
|
-
problems.push(`the elected terms read ${reading.permission} for ${operation}: ${reading.because}`)
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
return problems
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Returns every problem with one decision's own record, given the operations its register performs.
|
|
256
|
-
*
|
|
257
|
-
* A register's audit adds the checks that span decisions, such as a duplicate id
|
|
258
|
-
* or a decision no source points at.
|
|
259
|
-
*/
|
|
260
|
-
export function auditLicenseDecision<Operation extends string>(
|
|
261
|
-
decision: LicenseDecision<Operation>,
|
|
262
|
-
knownOperations: readonly Operation[]
|
|
263
|
-
): string[] {
|
|
264
|
-
const named = stringifyJSON(decision.licenseID)
|
|
265
|
-
|
|
266
|
-
switch (decision.state) {
|
|
267
|
-
case LicenseReviewState.Unchecked:
|
|
268
|
-
return decision.publisherStatement ? [] : [`license ${named} is unchecked and records no publisher statement`]
|
|
269
|
-
|
|
270
|
-
case LicenseReviewState.Refused:
|
|
271
|
-
return decision.refusedBecause ? [] : [`license ${named} is refused and gives no reason`]
|
|
272
|
-
|
|
273
|
-
case LicenseReviewState.Elected:
|
|
274
|
-
return auditElected(decision, named, knownOperations)
|
|
275
|
-
|
|
276
|
-
default:
|
|
277
|
-
return [`license ${named} carries an unknown review state`]
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
function auditElected<Operation extends string>(
|
|
282
|
-
decision: ElectedLicense<Operation>,
|
|
283
|
-
named: string,
|
|
284
|
-
knownOperations: readonly Operation[]
|
|
285
|
-
): string[] {
|
|
286
|
-
const problems: string[] = []
|
|
287
|
-
const known = new Set<string>(knownOperations)
|
|
288
|
-
const permissions = new Set<string>(Object.values(OperationPermission))
|
|
289
|
-
|
|
290
|
-
if (!decision.electedTerms) {
|
|
291
|
-
problems.push(`license ${named} is elected and names no terms`)
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
if (!decision.retrievedCopy) {
|
|
295
|
-
problems.push(`license ${named} is elected and names no retrieved copy`)
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
if (!decision.electedBecause) {
|
|
299
|
-
problems.push(`license ${named} is elected and gives no reason`)
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
for (const [operation, reading] of Object.entries<OperationDecision | undefined>(decision.operations ?? {})) {
|
|
303
|
-
if (!reading) continue
|
|
304
|
-
|
|
305
|
-
if (!reading.because) {
|
|
306
|
-
problems.push(`license ${named} reads ${reading.permission} for ${operation} and gives no reason`)
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// A permission must cite its basis in the terms so that a reviewer can check it.
|
|
310
|
-
// A refusal needs no basis.
|
|
311
|
-
if (reading.permission === OperationPermission.Permitted && !reading.basis) {
|
|
312
|
-
problems.push(`license ${named} permits ${operation} and names no basis for the permission`)
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
if (!permissions.has(reading.permission)) {
|
|
316
|
-
problems.push(
|
|
317
|
-
`license ${named} reads an unknown permission ${stringifyJSON(reading.permission)} for ${operation}`
|
|
318
|
-
)
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
if (!known.has(operation)) {
|
|
322
|
-
problems.push(
|
|
323
|
-
`license ${named} names ${stringifyJSON(operation)}, which is not an operation this repository performs`
|
|
324
|
-
)
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return problems
|
|
329
|
-
}
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
-
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Summarizes the obligations of an SPDX license expression for `mailwoman doctor`.
|
|
6
|
-
* The summary is a debugging aid and gives no legal advice.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { stringifyJSON } from "#json"
|
|
10
|
-
import type { LicenseKeyVerification } from "#license/key"
|
|
11
|
-
import type { LicenseKeyPublication } from "#license/publication"
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Returns whether a verification grants the commercial branch: the token is valid
|
|
15
|
-
* and its terms are commercial.
|
|
16
|
-
*
|
|
17
|
-
* A valid open-source token answers false, so the AGPL branch and its notice stay in place for it.
|
|
18
|
-
* The function lives here rather than in `key.ts` because this module sits in the
|
|
19
|
-
* docs site's plugin graph that jiti evaluates.
|
|
20
|
-
*
|
|
21
|
-
* A value import of `key.ts` would pull its zod schema into that graph.
|
|
22
|
-
*/
|
|
23
|
-
export function grantsCommercialTerms(key: LicenseKeyVerification | null | undefined): boolean {
|
|
24
|
-
return key?.status === "valid" && key.payload.terms === "LicenseRef-Commercial"
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The obligation classes the summary reports.
|
|
29
|
-
*
|
|
30
|
-
* - `attribution` requires crediting the source where derived results are shown or redistributed.
|
|
31
|
-
* - `share_alike` requires a derived work or database to use the same license, as in ODbL and AGPL.
|
|
32
|
-
* - `source_offer` requires offering the source, including modifications,
|
|
33
|
-
* to network users (AGPL-3.0 section 13).
|
|
34
|
-
*/
|
|
35
|
-
export const LicenseObligation = {
|
|
36
|
-
Attribution: "attribution",
|
|
37
|
-
ShareAlike: "share_alike",
|
|
38
|
-
SourceOffer: "source_offer",
|
|
39
|
-
} as const
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* An obligation class.
|
|
43
|
-
*/
|
|
44
|
-
export type LicenseObligation = (typeof LicenseObligation)[keyof typeof LicenseObligation]
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* The known obligations of each SPDX identifier.
|
|
48
|
-
*
|
|
49
|
-
* An empty list means the license has no obligations.
|
|
50
|
-
* An identifier missing from the table is reported as unrecognized so that an
|
|
51
|
-
* unknown license never reads as obligation-free.
|
|
52
|
-
*/
|
|
53
|
-
const KNOWN_OBLIGATIONS: ReadonlyMap<string, readonly LicenseObligation[]> = new Map<
|
|
54
|
-
string,
|
|
55
|
-
readonly LicenseObligation[]
|
|
56
|
-
>([
|
|
57
|
-
["AGPL-3.0-only", [LicenseObligation.Attribution, LicenseObligation.ShareAlike, LicenseObligation.SourceOffer]],
|
|
58
|
-
["AGPL-3.0-or-later", [LicenseObligation.Attribution, LicenseObligation.ShareAlike, LicenseObligation.SourceOffer]],
|
|
59
|
-
// Section 4 of commercial-LICENSE.md requires attribution.
|
|
60
|
-
["LicenseRef-Commercial", [LicenseObligation.Attribution]],
|
|
61
|
-
["ODbL-1.0", [LicenseObligation.Attribution, LicenseObligation.ShareAlike]],
|
|
62
|
-
// Open Data Commons publishes an attribution-only license beside ODbL.
|
|
63
|
-
// Readers confuse them because both are ODC.
|
|
64
|
-
// This one has no share-alike term.
|
|
65
|
-
["ODC-By-1.0", [LicenseObligation.Attribution]],
|
|
66
|
-
// Every identifier `readLicenseRecord` can resolve a share-alike mention to belongs here,
|
|
67
|
-
// so a stated CC-BY-SA grant reads as carrying share-alike rather than as an unrecognized identifier.
|
|
68
|
-
["CC-BY-SA-4.0", [LicenseObligation.Attribution, LicenseObligation.ShareAlike]],
|
|
69
|
-
["CC-BY-SA-3.0", [LicenseObligation.Attribution, LicenseObligation.ShareAlike]],
|
|
70
|
-
["CC-BY-SA-2.0", [LicenseObligation.Attribution, LicenseObligation.ShareAlike]],
|
|
71
|
-
["OGL-UK-3.0", [LicenseObligation.Attribution]],
|
|
72
|
-
["CDLA-Permissive-2.0", [LicenseObligation.Attribution]],
|
|
73
|
-
["CC-BY-4.0", [LicenseObligation.Attribution]],
|
|
74
|
-
["CC0-1.0", []],
|
|
75
|
-
["PDDL-1.0", []],
|
|
76
|
-
// The Datenlizenz Deutschland pair.
|
|
77
|
-
// Zero permits any use without restrictions or conditions.
|
|
78
|
-
// Namensnennung requires a source note naming the provider, the license and the dataset URI.
|
|
79
|
-
// It also requires a mark on changed data.
|
|
80
|
-
// Both texts are retained at internal/strategy/rights-receipts/address-skeletons-2026-10-17/.
|
|
81
|
-
["DL-DE-ZERO-2.0", []],
|
|
82
|
-
["DL-DE-BY-2.0", [LicenseObligation.Attribution]],
|
|
83
|
-
// US Government works have no copyright under 17 U.S.C. § 105. SPDX has no identifier for them, so this
|
|
84
|
-
// `LicenseRef` is defined in docs/engineering/reference/layer-interface.mdx.
|
|
85
|
-
["LicenseRef-USGov-Public-Domain", []],
|
|
86
|
-
// BAN publishes under Licence Ouverte 2.0.
|
|
87
|
-
["etalab-2.0", [LicenseObligation.Attribution]],
|
|
88
|
-
// The Taiwanese address registers behind Overture-TW use this license.
|
|
89
|
-
// The grant is void without the attribution statement, so the per-agency
|
|
90
|
-
// attribution list ships with the data.
|
|
91
|
-
["OGDL-Taiwan-1.0", [LicenseObligation.Attribution]],
|
|
92
|
-
// Mexico's national statistics institute publishes under its own "Términos de Libre Uso de la
|
|
93
|
-
// Información del INEGI", which identifies no Creative Commons license and includes no version.
|
|
94
|
-
// The terms permit copying, publishing, adapting, extracting and commercial use.
|
|
95
|
-
// They require the credit `Fuente: INEGI, <product name>`.
|
|
96
|
-
// They state no share-alike term.
|
|
97
|
-
// Retrieved 2026-09-27 and retained at internal/strategy/rights-receipts/mx-gb-2026-09-27/mx-inegi-terminos.html.
|
|
98
|
-
["LicenseRef-INEGI-Terms", [LicenseObligation.Attribution]],
|
|
99
|
-
// The GEBCO undersea gazetteer, under the operator's own election of 2026-11-02 (#2896).
|
|
100
|
-
// GEBCO and NOAA NCEI publish it with a citation request and no stated restriction.
|
|
101
|
-
// The disclaimer excludes only navigation and safety-at-sea use.
|
|
102
|
-
// The election rests on that publication without a written grant, and a request for one has gone to GEBCO.
|
|
103
|
-
// The citation is the obligation it records.
|
|
104
|
-
["LicenseRef-GEBCO-Operator-Election", [LicenseObligation.Attribution]],
|
|
105
|
-
["MIT", [LicenseObligation.Attribution]],
|
|
106
|
-
["Apache-2.0", [LicenseObligation.Attribution]],
|
|
107
|
-
])
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* A summarized license expression.
|
|
111
|
-
*/
|
|
112
|
-
export interface LicenseSummary {
|
|
113
|
-
/**
|
|
114
|
-
* The expression as recorded.
|
|
115
|
-
*/
|
|
116
|
-
expression: string
|
|
117
|
-
/**
|
|
118
|
-
* The expression's identifiers in order.
|
|
119
|
-
* `AGPL-3.0-only OR LicenseRef-Commercial` has two.
|
|
120
|
-
*/
|
|
121
|
-
identifiers: string[]
|
|
122
|
-
/**
|
|
123
|
-
* The union of the known obligations of every identifier.
|
|
124
|
-
*
|
|
125
|
-
* For `OR`, this union applies until a branch is chosen with {@link chooseLicenseBranch}.
|
|
126
|
-
*/
|
|
127
|
-
obligations: LicenseObligation[]
|
|
128
|
-
/**
|
|
129
|
-
* Whether every identifier is in the known table.
|
|
130
|
-
*
|
|
131
|
-
* `NOASSERTION`, a vendor-suffixed identifier such as `pddl-1.0-USGov-nrcs`
|
|
132
|
-
* and a misspelling are all unrecognized.
|
|
133
|
-
*/
|
|
134
|
-
recognized: boolean
|
|
135
|
-
/**
|
|
136
|
-
* The identifiers missing from the known table.
|
|
137
|
-
*/
|
|
138
|
-
unrecognized: string[]
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Splits an SPDX expression into its identifiers.
|
|
143
|
-
*
|
|
144
|
-
* The function removes parentheses and splits on `AND` and `OR`.
|
|
145
|
-
* A `WITH` exception stays attached to its license.
|
|
146
|
-
*/
|
|
147
|
-
export function licenseIdentifiers(expression: string): string[] {
|
|
148
|
-
return expression
|
|
149
|
-
.replaceAll(/[()]/g, " ")
|
|
150
|
-
.split(/\s+(?:AND|OR)\s+/i)
|
|
151
|
-
.map((part) => part.trim())
|
|
152
|
-
.filter((part) => part.length)
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Returns the license part of an identifier, without any `WITH` exception.
|
|
157
|
-
*/
|
|
158
|
-
function withoutException(identifier: string): string {
|
|
159
|
-
return identifier.split(/\s+WITH\s+/i)[0]!
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Summarizes the known obligations of an SPDX expression.
|
|
164
|
-
*/
|
|
165
|
-
export function summarizeLicense(expression: string): LicenseSummary {
|
|
166
|
-
const identifiers = licenseIdentifiers(expression)
|
|
167
|
-
const obligations = new Set<LicenseObligation>()
|
|
168
|
-
const unrecognized: string[] = []
|
|
169
|
-
|
|
170
|
-
for (const identifier of identifiers) {
|
|
171
|
-
const known = KNOWN_OBLIGATIONS.get(withoutException(identifier))
|
|
172
|
-
|
|
173
|
-
if (!known) {
|
|
174
|
-
unrecognized.push(identifier)
|
|
175
|
-
|
|
176
|
-
continue
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
for (const obligation of known) {
|
|
180
|
-
obligations.add(obligation)
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return {
|
|
185
|
-
expression,
|
|
186
|
-
identifiers,
|
|
187
|
-
obligations: [...obligations],
|
|
188
|
-
recognized: identifiers.length > 0 && unrecognized.length === 0,
|
|
189
|
-
unrecognized,
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Returns the branch of mailwoman's license expression that applies to this installation.
|
|
195
|
-
*
|
|
196
|
-
* The commercial branch applies only when the key is `valid` and the published
|
|
197
|
-
* key register hasn't marked it retired or unlisted.
|
|
198
|
-
* The doctor passes both the key and the register status.
|
|
199
|
-
* The stamp runs offline and passes only the key.
|
|
200
|
-
*/
|
|
201
|
-
export function appliedLicenseBranch(
|
|
202
|
-
expression: string,
|
|
203
|
-
key?: LicenseKeyVerification,
|
|
204
|
-
publication?: LicenseKeyPublication
|
|
205
|
-
): string {
|
|
206
|
-
const retired = publication === "retired" || publication === "unlisted"
|
|
207
|
-
|
|
208
|
-
return chooseLicenseBranch(expression, { commercialAgreement: grantsCommercialTerms(key) && !retired })
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Chooses the applicable branch of an `A OR B` expression.
|
|
213
|
-
*
|
|
214
|
-
* The first `LicenseRef-` branch applies when there's a commercial agreement.
|
|
215
|
-
* Otherwise the first open-source branch applies.
|
|
216
|
-
* An expression without `OR` is returned unchanged.
|
|
217
|
-
*/
|
|
218
|
-
export function chooseLicenseBranch(expression: string, options: { commercialAgreement: boolean }): string {
|
|
219
|
-
const branches = expression
|
|
220
|
-
.replaceAll(/[()]/g, " ")
|
|
221
|
-
.split(/\s+OR\s+/i)
|
|
222
|
-
.map((part) => part.trim())
|
|
223
|
-
.filter((part) => part.length)
|
|
224
|
-
|
|
225
|
-
if (branches.length < 2) return expression
|
|
226
|
-
|
|
227
|
-
const commercial = branches.find((branch) => branch.startsWith("LicenseRef-"))
|
|
228
|
-
const open = branches.find((branch) => !branch.startsWith("LicenseRef-"))
|
|
229
|
-
|
|
230
|
-
if (options.commercialAgreement && commercial) return commercial
|
|
231
|
-
|
|
232
|
-
return open ?? branches[0]!
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const LICENSE_REF = /^LicenseRef-[A-Za-z0-9.-]+$/u
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Throws unless every identifier in the expression may be recorded in a layer manifest.
|
|
239
|
-
*
|
|
240
|
-
* An admissible identifier is in the obligations table, matches `LicenseRef-…`, or is `NOASSERTION`.
|
|
241
|
-
* A `WITH` exception is ignored, as it is in {@link summarizeLicense}.
|
|
242
|
-
* The doctor reports `NOASSERTION` as degraded.
|
|
243
|
-
*
|
|
244
|
-
* A manifest is sealed, so an unknown identifier is rejected at build time.
|
|
245
|
-
*/
|
|
246
|
-
export function assertAdmissibleLicenseExpression(expression: string, context = "license"): void {
|
|
247
|
-
for (const identifier of licenseIdentifiers(expression)) {
|
|
248
|
-
const license = withoutException(identifier)
|
|
249
|
-
|
|
250
|
-
if (license === "NOASSERTION" || KNOWN_OBLIGATIONS.has(license) || LICENSE_REF.test(license)) continue
|
|
251
|
-
|
|
252
|
-
throw new Error(
|
|
253
|
-
`${context}: ${stringifyJSON(identifier)} is not an admissible license identifier. Use the SPDX identifier the obligations table knows (packages/core/lib/license/obligations.ts), a LicenseRef- this repository defines, or NOASSERTION.`
|
|
254
|
-
)
|
|
255
|
-
}
|
|
256
|
-
}
|