@twin.org/standards-unece 0.0.3-next.10 → 0.0.3-next.11

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.
@@ -12,7 +12,7 @@ export class UneceDataTypes {
12
12
  * Register the JSON-LD Redirects.
13
13
  */
14
14
  static registerRedirects() {
15
- JsonLdProcessor.addRedirect(new RegExp(UneceContexts.ContextRoot), UneceContexts.ContextRedirect);
15
+ JsonLdProcessor.addRedirect(new RegExp(UneceContexts.Namespace), UneceContexts.JsonLdContext);
16
16
  }
17
17
  /**
18
18
  * Register all the data types.
@@ -20,8 +20,9 @@ export class UneceDataTypes {
20
20
  static async registerTypes() {
21
21
  for (const type of Object.values(UneceTypes)) {
22
22
  const json = await import(`../schemas/Unece${type}.json`, { assert: { type: "json" } });
23
- DataTypeHandlerFactory.register(`${UneceContexts.ContextRoot}${type}`, () => ({
24
- context: UneceContexts.ContextRoot,
23
+ DataTypeHandlerFactory.register(`${UneceContexts.Namespace}${type}`, () => ({
24
+ namespace: UneceContexts.Namespace,
25
+ jsonLdContext: UneceContexts.JsonLdContext,
25
26
  type,
26
27
  jsonSchema: async () => json
27
28
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"uneceDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/uneceDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,cAAc;IAC1B;;OAEG;IACI,MAAM,CAAC,iBAAiB;QAC9B,eAAe,CAAC,WAAW,CAC1B,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,EACrC,aAAa,CAAC,eAAe,CAC7B,CAAC;IACH,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa;QAChC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,mBAAmB,IAAI,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;YAExF,sBAAsB,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,WAAW,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC7E,OAAO,EAAE,aAAa,CAAC,WAAW;gBAClC,IAAI;gBACJ,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,IAAmB;aAC3C,CAAC,CAAC,CAAC;QACL,CAAC;IACF,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory, type IJsonSchema } from \"@twin.org/data-core\";\nimport { JsonLdProcessor } from \"@twin.org/data-json-ld\";\nimport { UneceContexts } from \"../models/uneceContexts.js\";\nimport { UneceTypes } from \"../models/uneceTypes.js\";\n\n/**\n * Handle all the data types for UN/CEFACT.\n */\nexport class UneceDataTypes {\n\t/**\n\t * Register the JSON-LD Redirects.\n\t */\n\tpublic static registerRedirects(): void {\n\t\tJsonLdProcessor.addRedirect(\n\t\t\tnew RegExp(UneceContexts.ContextRoot),\n\t\t\tUneceContexts.ContextRedirect\n\t\t);\n\t}\n\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static async registerTypes(): Promise<void> {\n\t\tfor (const type of Object.values(UneceTypes)) {\n\t\t\tconst json = await import(`../schemas/Unece${type}.json`, { assert: { type: \"json\" } });\n\n\t\t\tDataTypeHandlerFactory.register(`${UneceContexts.ContextRoot}${type}`, () => ({\n\t\t\t\tcontext: UneceContexts.ContextRoot,\n\t\t\t\ttype,\n\t\t\t\tjsonSchema: async () => json as IJsonSchema\n\t\t\t}));\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"uneceDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/uneceDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,cAAc;IAC1B;;OAEG;IACI,MAAM,CAAC,iBAAiB;QAC9B,eAAe,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC/F,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa;QAChC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,mBAAmB,IAAI,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;YAExF,sBAAsB,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,SAAS,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC3E,SAAS,EAAE,aAAa,CAAC,SAAS;gBAClC,aAAa,EAAE,aAAa,CAAC,aAAa;gBAC1C,IAAI;gBACJ,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,IAAmB;aAC3C,CAAC,CAAC,CAAC;QACL,CAAC;IACF,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory, type IJsonSchema } from \"@twin.org/data-core\";\nimport { JsonLdProcessor } from \"@twin.org/data-json-ld\";\nimport { UneceContexts } from \"../models/uneceContexts.js\";\nimport { UneceTypes } from \"../models/uneceTypes.js\";\n\n/**\n * Handle all the data types for UN/CEFACT.\n */\nexport class UneceDataTypes {\n\t/**\n\t * Register the JSON-LD Redirects.\n\t */\n\tpublic static registerRedirects(): void {\n\t\tJsonLdProcessor.addRedirect(new RegExp(UneceContexts.Namespace), UneceContexts.JsonLdContext);\n\t}\n\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static async registerTypes(): Promise<void> {\n\t\tfor (const type of Object.values(UneceTypes)) {\n\t\t\tconst json = await import(`../schemas/Unece${type}.json`, { assert: { type: \"json\" } });\n\n\t\t\tDataTypeHandlerFactory.register(`${UneceContexts.Namespace}${type}`, () => ({\n\t\t\t\tnamespace: UneceContexts.Namespace,\n\t\t\t\tjsonLdContext: UneceContexts.JsonLdContext,\n\t\t\t\ttype,\n\t\t\t\tjsonSchema: async () => json as IJsonSchema\n\t\t\t}));\n\t\t}\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"uneceContextType.js","sourceRoot":"","sources":["../../../src/models/uneceContextType.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { UneceContexts } from \"./uneceContexts.js\";\n\n/**\n * The UNECE JSON-LD context type.\n */\nexport type UneceContextType =\n\t| typeof UneceContexts.ContextRoot\n\t| [typeof UneceContexts.ContextRoot, ...IJsonLdContextDefinitionElement[]];\n"]}
1
+ {"version":3,"file":"uneceContextType.js","sourceRoot":"","sources":["../../../src/models/uneceContextType.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { UneceContexts } from \"./uneceContexts.js\";\n\n/**\n * The UNECE JSON-LD context type.\n */\nexport type UneceContextType =\n\t| typeof UneceContexts.Namespace\n\t| [typeof UneceContexts.Namespace, ...IJsonLdContextDefinitionElement[]];\n"]}
@@ -6,12 +6,12 @@
6
6
  // eslint-disable-next-line @typescript-eslint/naming-convention
7
7
  export const UneceContexts = {
8
8
  /**
9
- * Context Root.
9
+ * Namespace.
10
10
  */
11
- ContextRoot: "https://vocabulary.uncefact.org/",
11
+ Namespace: "https://vocabulary.uncefact.org/",
12
12
  /**
13
- * The UNECE namespace.
13
+ * The JSON-LD Context URL.
14
14
  */
15
- ContextRedirect: "https://vocabulary.uncefact.org/unece-context-D23B.jsonld"
15
+ JsonLdContext: "https://vocabulary.uncefact.org/unece-context-D23B.jsonld"
16
16
  };
17
17
  //# sourceMappingURL=uneceContexts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"uneceContexts.js","sourceRoot":"","sources":["../../../src/models/uneceContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B;;OAEG;IACH,WAAW,EAAE,kCAAkC;IAE/C;;OAEG;IACH,eAAe,EAAE,2DAA2D;CACnE,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of UNECE contexts.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const UneceContexts = {\n\t/**\n\t * Context Root.\n\t */\n\tContextRoot: \"https://vocabulary.uncefact.org/\",\n\n\t/**\n\t * The UNECE namespace.\n\t */\n\tContextRedirect: \"https://vocabulary.uncefact.org/unece-context-D23B.jsonld\"\n} as const;\n\n/**\n * The types of UNECE contexts.\n */\nexport type UneceContexts = (typeof UneceContexts)[keyof typeof UneceContexts];\n"]}
1
+ {"version":3,"file":"uneceContexts.js","sourceRoot":"","sources":["../../../src/models/uneceContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B;;OAEG;IACH,SAAS,EAAE,kCAAkC;IAE7C;;OAEG;IACH,aAAa,EAAE,2DAA2D;CACjE,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of UNECE contexts.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const UneceContexts = {\n\t/**\n\t * Namespace.\n\t */\n\tNamespace: \"https://vocabulary.uncefact.org/\",\n\n\t/**\n\t * The JSON-LD Context URL.\n\t */\n\tJsonLdContext: \"https://vocabulary.uncefact.org/unece-context-D23B.jsonld\"\n} as const;\n\n/**\n * The types of UNECE contexts.\n */\nexport type UneceContexts = (typeof UneceContexts)[keyof typeof UneceContexts];\n"]}
@@ -3,4 +3,4 @@ import type { UneceContexts } from "./uneceContexts.js";
3
3
  /**
4
4
  * The UNECE JSON-LD context type.
5
5
  */
6
- export type UneceContextType = typeof UneceContexts.ContextRoot | [typeof UneceContexts.ContextRoot, ...IJsonLdContextDefinitionElement[]];
6
+ export type UneceContextType = typeof UneceContexts.Namespace | [typeof UneceContexts.Namespace, ...IJsonLdContextDefinitionElement[]];
@@ -3,13 +3,13 @@
3
3
  */
4
4
  export declare const UneceContexts: {
5
5
  /**
6
- * Context Root.
6
+ * Namespace.
7
7
  */
8
- readonly ContextRoot: "https://vocabulary.uncefact.org/";
8
+ readonly Namespace: "https://vocabulary.uncefact.org/";
9
9
  /**
10
- * The UNECE namespace.
10
+ * The JSON-LD Context URL.
11
11
  */
12
- readonly ContextRedirect: "https://vocabulary.uncefact.org/unece-context-D23B.jsonld";
12
+ readonly JsonLdContext: "https://vocabulary.uncefact.org/unece-context-D23B.jsonld";
13
13
  };
14
14
  /**
15
15
  * The types of UNECE contexts.
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @twin.org/standards-unece - Changelog
2
2
 
3
+ ## [0.0.3-next.11](https://github.com/twinfoundation/standards/compare/standards-unece-v0.0.3-next.10...standards-unece-v0.0.3-next.11) (2026-01-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * improved namespaces and contexts ([#102](https://github.com/twinfoundation/standards/issues/102)) ([c74c370](https://github.com/twinfoundation/standards/commit/c74c370cd8145d6166ca4454353f3774c302ac3b))
9
+
3
10
  ## [0.0.3-next.10](https://github.com/twinfoundation/standards/compare/standards-unece-v0.0.3-next.9...standards-unece-v0.0.3-next.10) (2026-01-13)
4
11
 
5
12
 
@@ -1,5 +1,5 @@
1
1
  # Type Alias: UneceContextType
2
2
 
3
- > **UneceContextType** = *typeof* [`ContextRoot`](../variables/UneceContexts.md#contextroot) \| \[*typeof* [`ContextRoot`](../variables/UneceContexts.md#contextroot), `...IJsonLdContextDefinitionElement[]`\]
3
+ > **UneceContextType** = *typeof* [`Namespace`](../variables/UneceContexts.md#namespace) \| \[*typeof* [`Namespace`](../variables/UneceContexts.md#namespace), `...IJsonLdContextDefinitionElement[]`\]
4
4
 
5
5
  The UNECE JSON-LD context type.
@@ -6,14 +6,14 @@ The types of UNECE contexts.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### ContextRoot
9
+ ### Namespace
10
10
 
11
- > `readonly` **ContextRoot**: `"https://vocabulary.uncefact.org/"` = `"https://vocabulary.uncefact.org/"`
11
+ > `readonly` **Namespace**: `"https://vocabulary.uncefact.org/"` = `"https://vocabulary.uncefact.org/"`
12
12
 
13
- Context Root.
13
+ Namespace.
14
14
 
15
- ### ContextRedirect
15
+ ### JsonLdContext
16
16
 
17
- > `readonly` **ContextRedirect**: `"https://vocabulary.uncefact.org/unece-context-D23B.jsonld"` = `"https://vocabulary.uncefact.org/unece-context-D23B.jsonld"`
17
+ > `readonly` **JsonLdContext**: `"https://vocabulary.uncefact.org/unece-context-D23B.jsonld"` = `"https://vocabulary.uncefact.org/unece-context-D23B.jsonld"`
18
18
 
19
- The UNECE namespace.
19
+ The JSON-LD Context URL.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/standards-unece",
3
- "version": "0.0.3-next.10",
3
+ "version": "0.0.3-next.11",
4
4
  "description": "Models which define the structure of UN/CEFACT Standard",
5
5
  "repository": {
6
6
  "type": "git",