- Add
async function typeTableLoader({registryEntryId})
option to look up thetypeTable
to use by id for bothencode
anddecode
.
- NOTE: The handling of
typeTable
andtypeTableLoader
is more strict than before and requies one option be used when appropriate. This could cause issues with code that was depending on undefined behavior. - Refactor
registryEntryId
encoding and decoding logic. Trying to be more readable and handle more error and edge cases. This is a work in progress.
- Fix varint processing when registry IDs require multiple bytes.
- Fix bug with registry IDs that are expressed using varints larger than 1 byte in size. This would break any previous use of this, but that previous use is invalid and non-interoperable. When a registry entry is used that requires more than one byte, the payload is now appropriately a two element tagged array containing a bytestring and the encoded JSON-LD document instead of a sequence containing a tagged bytestring and the encoded document.
- Fix compression of values in arrays of arrays.
- Internal refactor for simpler code, better maintenance, and better better separation of concerns.
- Fix property-scope processing bug that applied property-scope context without removing any type-scope context first.
- Ensure error is thrown if unexpected protected term redefinition is attempted.
- Ensure
@propagate
context flag is considered. - Add missing
@propagate
to keywords table.
- Added support for passing through (without semantic compression) terms not defined in contexts and other plain values.
- Restructure term registry system to be more general with a type table. The
type table expresses type-namespaced tables of values that can be used when encoding and decoding. This type table (of tables) can be passed by the user
when encoding and decoding and will be given preference over any processing-
mode-specific codecs (such as multibase codecs).
The supported types include:
- context: for JSON-LD context URLs, this subsumes the old 'appContextMap' and any contexts expressed in the old arbitrary string table as well.
- url: for any JSON-LD URL value, such as values associated with
@id
or@type
(or their aliases) JSON keys. - none: for any untyped or plain literal values.
- <any JSON-LD type expressed as URL>: for any values associated with any custom JSON-LD types.
- Restructure CBOR-LD tag system to use a range of tags where the tag value informs what values for the tables above should be used via a registry. Legacy tags (0x0501) are still supported, and new tags are in the range 0x0600-0x06FF. In addition, the tag value is part of a varint that begins the CBOR-LD paylaod if necessary that allows for more registry entries than the number of tags in that range.
- BREAKING: Add support for compressing RFC 2397 data URLs. Base64 encoded data is compressed as binary.
- Add VCDM v2 context value.
- BREAKING: Encode cryptosuite strings using a separate registry (specific to cryptosuites) to further reduce their encoded size (instead of using the global table). This approach is incompatible with previous encodings that used the global table.
- BREAKING: Encode all URIs using the vocab term codec. This allows
arbitrary URIs to be encoded with the same small integers as other terms.
The mapping in a context needs to use a redundant form:
{"URI":"URI"}
. This technique assume a use case where the CBOR-LD size has high priority over context size. - Improve and test examples.
- Update dependencies.
- BREAKING: Remove and reserve cryptosuite values from term registry in favor of the new cryptosuite codec.
- Use
appContextMap
inCryptosuiteEncoder
. - Ensure custom
appContextMap
is used first before registered table of term codecs in cryptosuite codecs.
- Ensure custom
appContextMap
is used first before registered table of term codecs.
- BREAKING: Require node 18+ (current non-EOL node versions).
- BREAKING: Add support for compressing base64url-encoded multibase values.
- BREAKING: Add support for compressing Data Integrity cryptosuite strings.
- Update dependencies:
- Use
cborg@4
. - Use
uuid@9
.
- Use
- Add
https://w3id.org/security/data-integrity/v2
registered context. - Add
https://purl.imsglobal.org/spec/ob/v3p0/context.json
registered context.
- BREAKING: Convert to module (ESM).
- BREAKING: Require Node.js >=14.
- Update dependencies.
- Lint module.
- Add
https://w3id.org/vc/status-list/v1
registered context.
- Add
https://w3id.org/dcc/v1c
registered context.
- Add
https://w3id.org/vc-revocation-list-2020/v1
registered context.
- Add latest contexts from the cborld term codec registry.
- BREAKING: Fixed broken security ed25519 suite context URLs.
- BREAKING: Removed CLI, see: https://github.com/digitalbazaar/cborld-cli
- BREAKING: Use
cborg
as the underlying CBOR library. - BREAKING: Assign term IDs for defined terms in pairs using even numbers
for terms with single values and odd numbers for multiple values. This
approach avoids adding additional tags for multiple values and is based
on the fact that JSON-LD keywords themselves will be assigned term IDs that
exceed the CBOR single byte value limit of 24. Custom term IDs therefore
start at 100 and will use two bytes per term up to
65536-100
custom terms. - BREAKING: Support embedded and scoped contexts in JSON-LD and, more
generally, any JSON-LD document that has all of its terms defined. The
only exceptions are contexts that use change the
@propagate
setting from its default; these are not presently supported but may be in a future version. - BREAKING: Treat the last 8-bits of the CBOR-LD tag as a compression mode with support for mode=0 (no compression) or mode=1 (compression as implemented with the above term ID rules, sorting, etc. -- to be updated in the spec). Future compression modes can be added to support other algorithms.
- BREAKING: Type encoding depends on
@type
in term definitions and does not require a CBOR Map to be used when encoding values. If a value cannot be encoded to match the@type
, it is the encoders job to provide a default uncompressed value that is distinguishable from a compressed one. For example, a compressed@type
value forfoo
may use aUint8Array
but an uncompressed value may use any other major CBOR type.
- Update to latest
@digitalbazaar/cbor
version that has theignoreBOM
fix.
- Add entry for X25519 2020 crypto suite context codec.
- BREAKING: Use
@digitalbazaar/cbor
as a temporary measure to get better Web/browser compatiblity for cbor-ld. The plan is to switch tocborg
library in another subsequent major release. - BREAKING: Temporarily disable
diagnose
mode. This will be re-enabled in some way once the transition to thecborg
library is complete. - BREAKING: Disabled errors that throw when using an app context map with tag numbers from the registry. This is currently allowed to enable people to use the library even when a new version hasn't been released that supports newly registered tags. We'll explore if this is right path forward or if we need to do something else in the future.
- BREAKING: Removed support for node 10.x. Node 10.x reaches EOL at
the end of April 2021 (a little over 30 days from the time this entry was
written) and it is lacking in features required to run
@digitalbazaar/cbor
. Support is therefore being removed.
- Add support for compressing
xsd:date
types.
- Use
match-all
for compatibility with Node.js <12. - NOTE: The required Node.js version may be increased to v12 sometime after
v10 hits end-of-life. The above
match-all
support may be removed at that time.
- UrlCodec decode dropped base58 multibase prefix.
- Get entries based on cborMap type.
- Handle decoding of encoded empty object.
- Refactoring to allow simple karma tests to pass.
- BREAKING: Move documentLoader towards alignment with JSON-LD spec. Allows reuse of jsonld.js document loaders.
- Browser support unfinished in this release.
- Add core files.