@twin.org/standards-ld-contexts 0.0.3-next.66 → 0.0.3-next.68

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.
@@ -98,6 +98,7 @@ export const LD_CONTEXTS = {
98
98
  };
99
99
  /**
100
100
  * Add all the contexts to the document cache.
101
+ * @returns A promise that resolves when all contexts have been added to the cache.
101
102
  */
102
103
  export async function addAllContextsToDocumentCache() {
103
104
  for (const url in LD_CONTEXTS) {
@@ -107,6 +108,8 @@ export async function addAllContextsToDocumentCache() {
107
108
  /**
108
109
  * Add a context to the document cache.
109
110
  * @param url The URL of the context to add to the cache.
111
+ * @returns A promise that resolves when the context has been added to the cache.
112
+ * @throws GeneralError if the context URL is not found in the known contexts map.
110
113
  */
111
114
  export async function addContextToDocumentCache(url) {
112
115
  if (Is.empty(LD_CONTEXTS[url])) {
@@ -1 +1 @@
1
- {"version":3,"file":"ldContexts.js","sourceRoot":"","sources":["../../src/ldContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,qBAAqB,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpG,OAAO,qBAAqB,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpG,OAAO,QAAQ,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpF,OAAO,OAAO,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChF,OAAO,IAAI,MAAM,wBAAwB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,SAAS,MAAM,iCAAiC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC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E,WAAW;IACX,4BAA4B,EAAE,OAAO;IACrC,mCAAmC,EAAE,OAAO;IAC5C,kCAAkC,EAAE,OAAO;IAE3C,UAAU;IACV,8BAA8B,EAAE,SAAS;IACzC,wCAAwC,EAAE,OAAO;IACjD,sCAAsC,EAAE,OAAO;IAC/C,8CAA8C,EAAE,SAAS;IACzD,kDAAkD,EAAE,aAAa;IACjE,6CAA6C,EAAE,kBAAkB;IACjE,8BAA8B,EAAE,SAAS;IACzC,uCAAuC,EAAE,cAAc;IAEvD,WAAW;IACX,8BAA8B,EAAE,OAAO;IACvC,kCAAkC,EAAE,OAAO;IAE3C,UAAU;IACV,qCAAqC,EAAE,MAAM;IAC7C,iDAAiD,EAAE,MAAM;IACzD,uCAAuC,EAAE,MAAM;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B;IAClD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,GAAW;IAC1D,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,YAAY,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { GeneralError, Is } from \"@twin.org/core\";\nimport { JsonLdProcessor } from \"@twin.org/data-json-ld\";\nimport dataspaceProtocol2024 from \"./ldContexts/dataspace-protocol-2024.json\" with { type: \"json\" };\nimport dataspaceProtocol2025 from \"./ldContexts/dataspace-protocol-2025.json\" with { type: \"json\" };\nimport dcmitype from \"./ldContexts/dublin-core-dcmitype.json\" with { type: \"json\" };\nimport dcTerms from \"./ldContexts/dublin-core-terms.json\" with { type: \"json\" };\nimport foaf from \"./ldContexts/foaf.json\" with { type: \"json\" };\nimport gaiaX2411 from \"./ldContexts/gaia-x-v24.11.json\" with { type: \"json\" };\nimport gs1epcis from \"./ldContexts/gs1-epcis.json\" with { type: \"json\" };\nimport gs1vocab from \"./ldContexts/gs1-vocab.json\" with { type: \"json\" };\nimport odrlDataspaceProtocol from \"./ldContexts/odrl-dataspace-protocol.json\" with { type: \"json\" };\nimport schemaOrg from \"./ldContexts/schema.org.json\" with { type: \"json\" };\nimport unCefactD23B from \"./ldContexts/un-cefact-d23b.json\" with { type: \"json\" };\nimport w3cActivityStreams from \"./ldContexts/w3c-activity-streams.json\" with { type: \"json\" };\nimport w3cDataIntegrityV2 from \"./ldContexts/w3c-data-integrity-v2.json\" with { type: \"json\" };\nimport w3cDcat from \"./ldContexts/w3c-dcat.json\" with { type: \"json\" };\nimport w3cOdrl from \"./ldContexts/w3c-odrl.json\" with { type: \"json\" };\nimport w3cRdf from \"./ldContexts/w3c-rdf.json\" with { type: \"json\" };\nimport w3cVcV1 from \"./ldContexts/w3c-vc-data-model-v1.json\" with { type: \"json\" };\nimport w3cVcV2 from \"./ldContexts/w3c-vc-data-model-v2.json\" with { type: \"json\" };\nimport w3idCidV1 from \"./ldContexts/w3id-cid-v1.json\" with { type: \"json\" };\nimport w3idDidV1 from \"./ldContexts/w3id-did-v1.json\" with { type: \"json\" };\nimport w3idEd25519V1 from \"./ldContexts/w3id-ed25519-v1.json\" with { type: \"json\" };\nimport w3idJwsV1 from \"./ldContexts/w3id-jws-2020-v1.json\" with { type: \"json\" };\nimport w3idMultiKeyV1 from \"./ldContexts/w3id-multikey-v1.json\" with { type: \"json\" };\n\n/**\n * Map of all the ld contexts by their URL.\n */\nexport const LD_CONTEXTS: { [id: string]: unknown } = {\n\t// Data Space Protocol\n\t\"https://w3id.org/dspace/2024/1/\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2024/1/context.json\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2024/1/context.jsonld\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2025/1/\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/context.json\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/context.jsonld\": dataspaceProtocol2025,\n\t\"https://schema.twindev.org/dataspace-protocol/\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/odrl-profile.jsonld\": odrlDataspaceProtocol,\n\n\t// DCSA does not have JSON-LD context definitions\n\n\t// Dublin Core\n\t\"http://purl.org/dc/terms/\": dcTerms,\n\t\"http://purl.org/dc/dcmitype/\": dcmitype,\n\t\"https://schema.twindev.org/dublin-core/terms.jsonld\": dcTerms,\n\t\"https://schema.twindev.org/dublin-core/dcmitype.jsonld\": dcmitype,\n\n\t// Foaf\n\t\"https://schema.twindev.org/foaf/\": foaf,\n\t\"https://schema.twindev.org/foaf/types.jsonld\": foaf,\n\t\"http://xmlns.com/foaf/0.1/\": foaf,\n\n\t// Gaia-X\n\t\"https://w3id.org/gaia-x/2411\": gaiaX2411,\n\t\"https://w3id.org/gaia-x/2411#\": gaiaX2411,\n\t\"https://schema.twindev.org/gaia-x-loire/\": gaiaX2411,\n\t\"https://schema.twindev.org/gaia-x-loire/types.jsonld\": gaiaX2411,\n\n\t// GS1 EPCIS\n\t\"https://ref.gs1.org/epcis/\": gs1epcis,\n\t\"https://ref.gs1.org/epcis\": gs1epcis,\n\t\"https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld\": gs1epcis,\n\n\t// GS1 Vocab\n\t\"https://gs1.org/voc/\": gs1vocab,\n\t\"https://ref.gs1.org/voc/data/gs1Voc.jsonld\": gs1vocab,\n\n\t// schema.org\n\t\"https://schema.org\": schemaOrg,\n\t\"http://schema.org\": schemaOrg,\n\t\"https://schema.org/\": schemaOrg,\n\t\"http://schema.org/\": schemaOrg,\n\t\"https://schema.org/docs/jsonldcontext.jsonld\": schemaOrg,\n\n\t// UN/CEFACT\n\t\"https://vocabulary.uncefact.org\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/unece-context.jsonld\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/unece-context-D23B.jsonld\": unCefactD23B,\n\n\t// W3C Activity Streams\n\t\"https://www.w3.org/ns/activitystreams#\": w3cActivityStreams,\n\t\"https://www.w3.org/ns/activitystreams\": w3cActivityStreams,\n\t\"https://www.w3.org/ns/activitystreams.jsonld\": w3cActivityStreams,\n\n\t// W3C DCAT\n\t\"http://www.w3.org/ns/dcat#\": w3cDcat,\n\t\"https://www.w3.org/ns/dcat.jsonld\": w3cDcat,\n\t\"http://www.w3.org/ns/dcat.jsonld\": w3cDcat,\n\n\t// W3C DID\n\t\"https://www.w3.org/ns/did/v1\": w3idDidV1,\n\t\"https://www.w3.org/2018/credentials/v1\": w3cVcV1,\n\t\"https://www.w3.org/ns/credentials/v2\": w3cVcV2,\n\t\"https://w3id.org/security/suites/jws-2020/v1\": w3idJwsV1,\n\t\"https://w3id.org/security/suites/ed25519-2020/v1\": w3idEd25519V1,\n\t\"https://w3id.org/security/data-integrity/v2\": w3cDataIntegrityV2,\n\t\"https://www.w3.org/ns/cid/v1\": w3idCidV1,\n\t\"https://w3id.org/security/multikey/v1\": w3idMultiKeyV1,\n\n\t// W3C ODRL\n\t\"http://www.w3.org/ns/odrl/2/\": w3cOdrl,\n\t\"http://www.w3.org/ns/odrl.jsonld\": w3cOdrl,\n\n\t// W3C RDF\n\t\"https://schema.twindev.org/w3c-rdf/\": w3cRdf,\n\t\"https://schema.twindev.org/w3c-rdf/types.jsonld\": w3cRdf,\n\t\"http://www.w3.org/2000/01/rdf-schema#\": w3cRdf\n};\n\n/**\n * Add all the contexts to the document cache.\n */\nexport async function addAllContextsToDocumentCache(): Promise<void> {\n\tfor (const url in LD_CONTEXTS) {\n\t\tawait JsonLdProcessor.documentCacheAdd(url, LD_CONTEXTS[url]);\n\t}\n}\n\n/**\n * Add a context to the document cache.\n * @param url The URL of the context to add to the cache.\n */\nexport async function addContextToDocumentCache(url: string): Promise<void> {\n\tif (Is.empty(LD_CONTEXTS[url])) {\n\t\tthrow new GeneralError(\"ldContext\", \"missing\", { url });\n\t}\n\tawait JsonLdProcessor.documentCacheAdd(url, LD_CONTEXTS[url]);\n}\n"]}
1
+ {"version":3,"file":"ldContexts.js","sourceRoot":"","sources":["../../src/ldContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,qBAAqB,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpG,OAAO,qBAAqB,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpG,OAAO,QAAQ,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpF,OAAO,OAAO,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChF,OAAO,IAAI,MAAM,wBAAwB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,SAAS,MAAM,iCAAiC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9E,OAAO,QAAQ,MAAM,6BAA6B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACzE,OAAO,QAAQ,MAAM,6BAA6B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACzE,OAAO,qBAAqB,MAAM,2CAA2C,CAAC,OAAO,IAA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,SAAS;IACzD,kDAAkD,EAAE,aAAa;IACjE,6CAA6C,EAAE,kBAAkB;IACjE,8BAA8B,EAAE,SAAS;IACzC,uCAAuC,EAAE,cAAc;IAEvD,WAAW;IACX,8BAA8B,EAAE,OAAO;IACvC,kCAAkC,EAAE,OAAO;IAE3C,UAAU;IACV,qCAAqC,EAAE,MAAM;IAC7C,iDAAiD,EAAE,MAAM;IACzD,uCAAuC,EAAE,MAAM;CAC/C,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B;IAClD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,GAAW;IAC1D,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,YAAY,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { GeneralError, Is } from \"@twin.org/core\";\nimport { JsonLdProcessor } from \"@twin.org/data-json-ld\";\nimport dataspaceProtocol2024 from \"./ldContexts/dataspace-protocol-2024.json\" with { type: \"json\" };\nimport dataspaceProtocol2025 from \"./ldContexts/dataspace-protocol-2025.json\" with { type: \"json\" };\nimport dcmitype from \"./ldContexts/dublin-core-dcmitype.json\" with { type: \"json\" };\nimport dcTerms from \"./ldContexts/dublin-core-terms.json\" with { type: \"json\" };\nimport foaf from \"./ldContexts/foaf.json\" with { type: \"json\" };\nimport gaiaX2411 from \"./ldContexts/gaia-x-v24.11.json\" with { type: \"json\" };\nimport gs1epcis from \"./ldContexts/gs1-epcis.json\" with { type: \"json\" };\nimport gs1vocab from \"./ldContexts/gs1-vocab.json\" with { type: \"json\" };\nimport odrlDataspaceProtocol from \"./ldContexts/odrl-dataspace-protocol.json\" with { type: \"json\" };\nimport schemaOrg from \"./ldContexts/schema.org.json\" with { type: \"json\" };\nimport unCefactD23B from \"./ldContexts/un-cefact-d23b.json\" with { type: \"json\" };\nimport w3cActivityStreams from \"./ldContexts/w3c-activity-streams.json\" with { type: \"json\" };\nimport w3cDataIntegrityV2 from \"./ldContexts/w3c-data-integrity-v2.json\" with { type: \"json\" };\nimport w3cDcat from \"./ldContexts/w3c-dcat.json\" with { type: \"json\" };\nimport w3cOdrl from \"./ldContexts/w3c-odrl.json\" with { type: \"json\" };\nimport w3cRdf from \"./ldContexts/w3c-rdf.json\" with { type: \"json\" };\nimport w3cVcV1 from \"./ldContexts/w3c-vc-data-model-v1.json\" with { type: \"json\" };\nimport w3cVcV2 from \"./ldContexts/w3c-vc-data-model-v2.json\" with { type: \"json\" };\nimport w3idCidV1 from \"./ldContexts/w3id-cid-v1.json\" with { type: \"json\" };\nimport w3idDidV1 from \"./ldContexts/w3id-did-v1.json\" with { type: \"json\" };\nimport w3idEd25519V1 from \"./ldContexts/w3id-ed25519-v1.json\" with { type: \"json\" };\nimport w3idJwsV1 from \"./ldContexts/w3id-jws-2020-v1.json\" with { type: \"json\" };\nimport w3idMultiKeyV1 from \"./ldContexts/w3id-multikey-v1.json\" with { type: \"json\" };\n\n/**\n * Map of all the ld contexts by their URL.\n */\nexport const LD_CONTEXTS: { [id: string]: unknown } = {\n\t// Data Space Protocol\n\t\"https://w3id.org/dspace/2024/1/\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2024/1/context.json\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2024/1/context.jsonld\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2025/1/\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/context.json\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/context.jsonld\": dataspaceProtocol2025,\n\t\"https://schema.twindev.org/dataspace-protocol/\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/odrl-profile.jsonld\": odrlDataspaceProtocol,\n\n\t// DCSA does not have JSON-LD context definitions\n\n\t// Dublin Core\n\t\"http://purl.org/dc/terms/\": dcTerms,\n\t\"http://purl.org/dc/dcmitype/\": dcmitype,\n\t\"https://schema.twindev.org/dublin-core/terms.jsonld\": dcTerms,\n\t\"https://schema.twindev.org/dublin-core/dcmitype.jsonld\": dcmitype,\n\n\t// Foaf\n\t\"https://schema.twindev.org/foaf/\": foaf,\n\t\"https://schema.twindev.org/foaf/types.jsonld\": foaf,\n\t\"http://xmlns.com/foaf/0.1/\": foaf,\n\n\t// Gaia-X\n\t\"https://w3id.org/gaia-x/2411\": gaiaX2411,\n\t\"https://w3id.org/gaia-x/2411#\": gaiaX2411,\n\t\"https://schema.twindev.org/gaia-x-loire/\": gaiaX2411,\n\t\"https://schema.twindev.org/gaia-x-loire/types.jsonld\": gaiaX2411,\n\n\t// GS1 EPCIS\n\t\"https://ref.gs1.org/epcis/\": gs1epcis,\n\t\"https://ref.gs1.org/epcis\": gs1epcis,\n\t\"https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld\": gs1epcis,\n\n\t// GS1 Vocab\n\t\"https://gs1.org/voc/\": gs1vocab,\n\t\"https://ref.gs1.org/voc/data/gs1Voc.jsonld\": gs1vocab,\n\n\t// schema.org\n\t\"https://schema.org\": schemaOrg,\n\t\"http://schema.org\": schemaOrg,\n\t\"https://schema.org/\": schemaOrg,\n\t\"http://schema.org/\": schemaOrg,\n\t\"https://schema.org/docs/jsonldcontext.jsonld\": schemaOrg,\n\n\t// UN/CEFACT\n\t\"https://vocabulary.uncefact.org\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/unece-context.jsonld\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/unece-context-D23B.jsonld\": unCefactD23B,\n\n\t// W3C Activity Streams\n\t\"https://www.w3.org/ns/activitystreams#\": w3cActivityStreams,\n\t\"https://www.w3.org/ns/activitystreams\": w3cActivityStreams,\n\t\"https://www.w3.org/ns/activitystreams.jsonld\": w3cActivityStreams,\n\n\t// W3C DCAT\n\t\"http://www.w3.org/ns/dcat#\": w3cDcat,\n\t\"https://www.w3.org/ns/dcat.jsonld\": w3cDcat,\n\t\"http://www.w3.org/ns/dcat.jsonld\": w3cDcat,\n\n\t// W3C DID\n\t\"https://www.w3.org/ns/did/v1\": w3idDidV1,\n\t\"https://www.w3.org/2018/credentials/v1\": w3cVcV1,\n\t\"https://www.w3.org/ns/credentials/v2\": w3cVcV2,\n\t\"https://w3id.org/security/suites/jws-2020/v1\": w3idJwsV1,\n\t\"https://w3id.org/security/suites/ed25519-2020/v1\": w3idEd25519V1,\n\t\"https://w3id.org/security/data-integrity/v2\": w3cDataIntegrityV2,\n\t\"https://www.w3.org/ns/cid/v1\": w3idCidV1,\n\t\"https://w3id.org/security/multikey/v1\": w3idMultiKeyV1,\n\n\t// W3C ODRL\n\t\"http://www.w3.org/ns/odrl/2/\": w3cOdrl,\n\t\"http://www.w3.org/ns/odrl.jsonld\": w3cOdrl,\n\n\t// W3C RDF\n\t\"https://schema.twindev.org/w3c-rdf/\": w3cRdf,\n\t\"https://schema.twindev.org/w3c-rdf/types.jsonld\": w3cRdf,\n\t\"http://www.w3.org/2000/01/rdf-schema#\": w3cRdf\n};\n\n/**\n * Add all the contexts to the document cache.\n * @returns A promise that resolves when all contexts have been added to the cache.\n */\nexport async function addAllContextsToDocumentCache(): Promise<void> {\n\tfor (const url in LD_CONTEXTS) {\n\t\tawait JsonLdProcessor.documentCacheAdd(url, LD_CONTEXTS[url]);\n\t}\n}\n\n/**\n * Add a context to the document cache.\n * @param url The URL of the context to add to the cache.\n * @returns A promise that resolves when the context has been added to the cache.\n * @throws GeneralError if the context URL is not found in the known contexts map.\n */\nexport async function addContextToDocumentCache(url: string): Promise<void> {\n\tif (Is.empty(LD_CONTEXTS[url])) {\n\t\tthrow new GeneralError(\"ldContext\", \"missing\", { url });\n\t}\n\tawait JsonLdProcessor.documentCacheAdd(url, LD_CONTEXTS[url]);\n}\n"]}
@@ -6,10 +6,13 @@ export declare const LD_CONTEXTS: {
6
6
  };
7
7
  /**
8
8
  * Add all the contexts to the document cache.
9
+ * @returns A promise that resolves when all contexts have been added to the cache.
9
10
  */
10
11
  export declare function addAllContextsToDocumentCache(): Promise<void>;
11
12
  /**
12
13
  * Add a context to the document cache.
13
14
  * @param url The URL of the context to add to the cache.
15
+ * @returns A promise that resolves when the context has been added to the cache.
16
+ * @throws GeneralError if the context URL is not found in the known contexts map.
14
17
  */
15
18
  export declare function addContextToDocumentCache(url: string): Promise<void>;
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.68](https://github.com/iotaledger/twin-standards/compare/standards-ld-contexts-v0.0.3-next.67...standards-ld-contexts-v0.0.3-next.68) (2026-06-22)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **standards-ld-contexts:** Synchronize repo versions
9
+
10
+ ## [0.0.3-next.67](https://github.com/iotaledger/twin-standards/compare/standards-ld-contexts-v0.0.3-next.66...standards-ld-contexts-v0.0.3-next.67) (2026-06-12)
11
+
12
+
13
+ ### Miscellaneous Chores
14
+
15
+ * **standards-ld-contexts:** Synchronize repo versions
16
+
3
17
  ## [0.0.3-next.66](https://github.com/iotaledger/twin-standards/compare/standards-ld-contexts-v0.0.3-next.65...standards-ld-contexts-v0.0.3-next.66) (2026-06-09)
4
18
 
5
19
 
@@ -7,3 +7,5 @@ Add all the contexts to the document cache.
7
7
  ## Returns
8
8
 
9
9
  `Promise`\<`void`\>
10
+
11
+ A promise that resolves when all contexts have been added to the cache.
@@ -15,3 +15,9 @@ The URL of the context to add to the cache.
15
15
  ## Returns
16
16
 
17
17
  `Promise`\<`void`\>
18
+
19
+ A promise that resolves when the context has been added to the cache.
20
+
21
+ ## Throws
22
+
23
+ GeneralError if the context URL is not found in the known contexts map.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/standards-ld-contexts",
3
- "version": "0.0.3-next.66",
3
+ "version": "0.0.3-next.68",
4
4
  "description": "Local JSON-LD contexts for offline and controlled use.",
5
5
  "repository": {
6
6
  "type": "git",