@twin.org/data-framework 0.0.1-next.8 → 0.0.1

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.
@@ -6,26 +6,35 @@ var dataCore = require('@twin.org/data-core');
6
6
  // Copyright 2024 IOTA Stiftung.
7
7
  // SPDX-License-Identifier: Apache-2.0.
8
8
  /**
9
- * The types of framework data.
9
+ * The contexts of framework data.
10
10
  */
11
11
  // eslint-disable-next-line @typescript-eslint/naming-convention
12
- const FrameworkTypes = {
12
+ const FrameworkContexts = {
13
13
  /**
14
14
  * Context Root.
15
15
  */
16
- ContextRoot: "https://schema.twindev.org/framework/",
16
+ ContextRoot: "https://schema.twindev.org/framework/"
17
+ };
18
+
19
+ // Copyright 2024 IOTA Stiftung.
20
+ // SPDX-License-Identifier: Apache-2.0.
21
+ /**
22
+ * The types of framework data.
23
+ */
24
+ // eslint-disable-next-line @typescript-eslint/naming-convention
25
+ const FrameworkTypes = {
17
26
  /**
18
27
  * Represents a urn.
19
28
  */
20
- Urn: "https://schema.twindev.org/framework/URN",
29
+ Urn: "URN",
21
30
  /**
22
31
  * Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
23
32
  */
24
- TimestampMilliseconds: "https://schema.twindev.org/framework/TimestampMilliseconds",
33
+ TimestampMilliseconds: "TimestampMilliseconds",
25
34
  /**
26
35
  * Represents a timestamp as an integer, seconds since 1 Jan 1970.
27
36
  */
28
- TimestampSeconds: "https://schema.twindev.org/framework/TimestampSeconds"
37
+ TimestampSeconds: "TimestampSeconds"
29
38
  };
30
39
 
31
40
  var type$2 = "integer";
@@ -59,19 +68,22 @@ class FrameworkDataTypes {
59
68
  * Register all the data types.
60
69
  */
61
70
  static registerTypes() {
62
- dataCore.DataTypeHandlerFactory.register(FrameworkTypes.Urn, () => ({
71
+ dataCore.DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.Urn}`, () => ({
72
+ context: FrameworkContexts.ContextRoot,
63
73
  type: FrameworkTypes.Urn,
64
74
  defaultValue: "",
65
75
  jsonSchema: async () => URNSchema,
66
76
  validate: async (propertyName, value, failures, container) => core.Urn.validate(propertyName, value, failures)
67
77
  }));
68
- dataCore.DataTypeHandlerFactory.register(FrameworkTypes.TimestampMilliseconds, () => ({
78
+ dataCore.DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.TimestampMilliseconds}`, () => ({
79
+ context: FrameworkContexts.ContextRoot,
69
80
  type: FrameworkTypes.TimestampMilliseconds,
70
81
  defaultValue: Date.now(),
71
82
  jsonSchema: async () => TimestampMillisecondsSchema,
72
83
  validate: async (propertyName, value, failures, container) => core.Validation.timestampMilliseconds(propertyName, value, failures)
73
84
  }));
74
- dataCore.DataTypeHandlerFactory.register(FrameworkTypes.TimestampSeconds, () => ({
85
+ dataCore.DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.TimestampSeconds}`, () => ({
86
+ context: FrameworkContexts.ContextRoot,
75
87
  type: FrameworkTypes.TimestampSeconds,
76
88
  defaultValue: Math.floor(Date.now() / 1000),
77
89
  jsonSchema: async () => TimestampSecondsSchema,
@@ -80,5 +92,6 @@ class FrameworkDataTypes {
80
92
  }
81
93
  }
82
94
 
95
+ exports.FrameworkContexts = FrameworkContexts;
83
96
  exports.FrameworkDataTypes = FrameworkDataTypes;
84
97
  exports.FrameworkTypes = FrameworkTypes;
@@ -4,26 +4,35 @@ import { DataTypeHandlerFactory } from '@twin.org/data-core';
4
4
  // Copyright 2024 IOTA Stiftung.
5
5
  // SPDX-License-Identifier: Apache-2.0.
6
6
  /**
7
- * The types of framework data.
7
+ * The contexts of framework data.
8
8
  */
9
9
  // eslint-disable-next-line @typescript-eslint/naming-convention
10
- const FrameworkTypes = {
10
+ const FrameworkContexts = {
11
11
  /**
12
12
  * Context Root.
13
13
  */
14
- ContextRoot: "https://schema.twindev.org/framework/",
14
+ ContextRoot: "https://schema.twindev.org/framework/"
15
+ };
16
+
17
+ // Copyright 2024 IOTA Stiftung.
18
+ // SPDX-License-Identifier: Apache-2.0.
19
+ /**
20
+ * The types of framework data.
21
+ */
22
+ // eslint-disable-next-line @typescript-eslint/naming-convention
23
+ const FrameworkTypes = {
15
24
  /**
16
25
  * Represents a urn.
17
26
  */
18
- Urn: "https://schema.twindev.org/framework/URN",
27
+ Urn: "URN",
19
28
  /**
20
29
  * Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
21
30
  */
22
- TimestampMilliseconds: "https://schema.twindev.org/framework/TimestampMilliseconds",
31
+ TimestampMilliseconds: "TimestampMilliseconds",
23
32
  /**
24
33
  * Represents a timestamp as an integer, seconds since 1 Jan 1970.
25
34
  */
26
- TimestampSeconds: "https://schema.twindev.org/framework/TimestampSeconds"
35
+ TimestampSeconds: "TimestampSeconds"
27
36
  };
28
37
 
29
38
  var type$2 = "integer";
@@ -57,19 +66,22 @@ class FrameworkDataTypes {
57
66
  * Register all the data types.
58
67
  */
59
68
  static registerTypes() {
60
- DataTypeHandlerFactory.register(FrameworkTypes.Urn, () => ({
69
+ DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.Urn}`, () => ({
70
+ context: FrameworkContexts.ContextRoot,
61
71
  type: FrameworkTypes.Urn,
62
72
  defaultValue: "",
63
73
  jsonSchema: async () => URNSchema,
64
74
  validate: async (propertyName, value, failures, container) => Urn.validate(propertyName, value, failures)
65
75
  }));
66
- DataTypeHandlerFactory.register(FrameworkTypes.TimestampMilliseconds, () => ({
76
+ DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.TimestampMilliseconds}`, () => ({
77
+ context: FrameworkContexts.ContextRoot,
67
78
  type: FrameworkTypes.TimestampMilliseconds,
68
79
  defaultValue: Date.now(),
69
80
  jsonSchema: async () => TimestampMillisecondsSchema,
70
81
  validate: async (propertyName, value, failures, container) => Validation.timestampMilliseconds(propertyName, value, failures)
71
82
  }));
72
- DataTypeHandlerFactory.register(FrameworkTypes.TimestampSeconds, () => ({
83
+ DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.TimestampSeconds}`, () => ({
84
+ context: FrameworkContexts.ContextRoot,
73
85
  type: FrameworkTypes.TimestampSeconds,
74
86
  defaultValue: Math.floor(Date.now() / 1000),
75
87
  jsonSchema: async () => TimestampSecondsSchema,
@@ -78,4 +90,4 @@ class FrameworkDataTypes {
78
90
  }
79
91
  }
80
92
 
81
- export { FrameworkDataTypes, FrameworkTypes };
93
+ export { FrameworkContexts, FrameworkDataTypes, FrameworkTypes };
@@ -1,2 +1,3 @@
1
1
  export * from "./dataTypes/frameworkDataTypes";
2
+ export * from "./models/frameworkContexts";
2
3
  export * from "./models/frameworkTypes";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The contexts of framework data.
3
+ */
4
+ export declare const FrameworkContexts: {
5
+ /**
6
+ * Context Root.
7
+ */
8
+ readonly ContextRoot: "https://schema.twindev.org/framework/";
9
+ };
10
+ /**
11
+ * The contexts of framework data.
12
+ */
13
+ export type FrameworkContexts = (typeof FrameworkContexts)[keyof typeof FrameworkContexts];
@@ -2,22 +2,18 @@
2
2
  * The types of framework data.
3
3
  */
4
4
  export declare const FrameworkTypes: {
5
- /**
6
- * Context Root.
7
- */
8
- readonly ContextRoot: "https://schema.twindev.org/framework/";
9
5
  /**
10
6
  * Represents a urn.
11
7
  */
12
- readonly Urn: "https://schema.twindev.org/framework/URN";
8
+ readonly Urn: "URN";
13
9
  /**
14
10
  * Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
15
11
  */
16
- readonly TimestampMilliseconds: "https://schema.twindev.org/framework/TimestampMilliseconds";
12
+ readonly TimestampMilliseconds: "TimestampMilliseconds";
17
13
  /**
18
14
  * Represents a timestamp as an integer, seconds since 1 Jan 1970.
19
15
  */
20
- readonly TimestampSeconds: "https://schema.twindev.org/framework/TimestampSeconds";
16
+ readonly TimestampSeconds: "TimestampSeconds";
21
17
  };
22
18
  /**
23
19
  * The types of framework data.
package/docs/changelog.md CHANGED
@@ -1,5 +1,150 @@
1
1
  # @twin.org/data-framework - Changelog
2
2
 
3
- ## v0.0.1-next.8
3
+ ## 0.0.1 (2025-07-03)
4
+
5
+
6
+ ### Features
7
+
8
+ * add document cache access methods ([dbf1e36](https://github.com/twinfoundation/data/commit/dbf1e36d176c5f428f8c52628fb5a1ff7a6a174a))
9
+ * expand Json LD Keyword ([70632d1](https://github.com/twinfoundation/data/commit/70632d1e11ad85cf3c57e118476b125a673f1681))
10
+ * use fully qualified names for data type lookups ([b7b5c74](https://github.com/twinfoundation/data/commit/b7b5c746b0180a87baa976f6a7a76cedd53d8ff7))
11
+ * use shared store mechanism ([#3](https://github.com/twinfoundation/data/issues/3)) ([33eb221](https://github.com/twinfoundation/data/commit/33eb221ccec2b4a79549c06e9a04225009b93a46))
12
+
13
+ ## [0.0.1-next.37](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.36...data-framework-v0.0.1-next.37) (2025-06-11)
14
+
15
+
16
+ ### Miscellaneous Chores
17
+
18
+ * **data-framework:** Synchronize repo versions
19
+
20
+
21
+ ### Dependencies
22
+
23
+ * The following workspace dependencies were updated
24
+ * dependencies
25
+ * @twin.org/data-core bumped from 0.0.1-next.36 to 0.0.1-next.37
26
+ * @twin.org/data-json-ld bumped from 0.0.1-next.36 to 0.0.1-next.37
27
+
28
+ ## [0.0.1-next.36](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.35...data-framework-v0.0.1-next.36) (2025-06-10)
29
+
30
+
31
+ ### Features
32
+
33
+ * expand Json LD Keyword ([70632d1](https://github.com/twinfoundation/data/commit/70632d1e11ad85cf3c57e118476b125a673f1681))
34
+
35
+
36
+ ### Dependencies
37
+
38
+ * The following workspace dependencies were updated
39
+ * dependencies
40
+ * @twin.org/data-core bumped from 0.0.1-next.35 to 0.0.1-next.36
41
+ * @twin.org/data-json-ld bumped from 0.0.1-next.35 to 0.0.1-next.36
42
+
43
+ ## [0.0.1-next.35](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.34...data-framework-v0.0.1-next.35) (2025-06-03)
44
+
45
+
46
+ ### Miscellaneous Chores
47
+
48
+ * **data-framework:** Synchronize repo versions
49
+
50
+
51
+ ### Dependencies
52
+
53
+ * The following workspace dependencies were updated
54
+ * dependencies
55
+ * @twin.org/data-core bumped from 0.0.1-next.34 to 0.0.1-next.35
56
+ * @twin.org/data-json-ld bumped from 0.0.1-next.34 to 0.0.1-next.35
57
+
58
+ ## [0.0.1-next.34](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.33...data-framework-v0.0.1-next.34) (2025-06-02)
59
+
60
+
61
+ ### Miscellaneous Chores
62
+
63
+ * **data-framework:** Synchronize repo versions
64
+
65
+
66
+ ### Dependencies
67
+
68
+ * The following workspace dependencies were updated
69
+ * dependencies
70
+ * @twin.org/data-core bumped from 0.0.1-next.33 to 0.0.1-next.34
71
+ * @twin.org/data-json-ld bumped from 0.0.1-next.33 to 0.0.1-next.34
72
+
73
+ ## [0.0.1-next.33](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.32...data-framework-v0.0.1-next.33) (2025-06-02)
74
+
75
+
76
+ ### Miscellaneous Chores
77
+
78
+ * **data-framework:** Synchronize repo versions
79
+
80
+
81
+ ### Dependencies
82
+
83
+ * The following workspace dependencies were updated
84
+ * dependencies
85
+ * @twin.org/data-core bumped from 0.0.1-next.32 to 0.0.1-next.33
86
+ * @twin.org/data-json-ld bumped from 0.0.1-next.32 to 0.0.1-next.33
87
+
88
+ ## [0.0.1-next.32](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.31...data-framework-v0.0.1-next.32) (2025-05-28)
89
+
90
+
91
+ ### Features
92
+
93
+ * use fully qualified names for data type lookups ([b7b5c74](https://github.com/twinfoundation/data/commit/b7b5c746b0180a87baa976f6a7a76cedd53d8ff7))
94
+
95
+
96
+ ### Dependencies
97
+
98
+ * The following workspace dependencies were updated
99
+ * dependencies
100
+ * @twin.org/data-core bumped from 0.0.1-next.31 to 0.0.1-next.32
101
+ * @twin.org/data-json-ld bumped from 0.0.1-next.31 to 0.0.1-next.32
102
+
103
+ ## [0.0.1-next.31](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.30...data-framework-v0.0.1-next.31) (2025-05-08)
104
+
105
+
106
+ ### Miscellaneous Chores
107
+
108
+ * **data-framework:** Synchronize repo versions
109
+
110
+
111
+ ### Dependencies
112
+
113
+ * The following workspace dependencies were updated
114
+ * dependencies
115
+ * @twin.org/data-core bumped from 0.0.1-next.30 to 0.0.1-next.31
116
+ * @twin.org/data-json-ld bumped from 0.0.1-next.30 to 0.0.1-next.31
117
+
118
+ ## [0.0.1-next.30](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.29...data-framework-v0.0.1-next.30) (2025-04-17)
119
+
120
+
121
+ ### Features
122
+
123
+ * use shared store mechanism ([#3](https://github.com/twinfoundation/data/issues/3)) ([33eb221](https://github.com/twinfoundation/data/commit/33eb221ccec2b4a79549c06e9a04225009b93a46))
124
+
125
+
126
+ ### Dependencies
127
+
128
+ * The following workspace dependencies were updated
129
+ * dependencies
130
+ * @twin.org/data-core bumped from 0.0.1-next.29 to 0.0.1-next.30
131
+ * @twin.org/data-json-ld bumped from 0.0.1-next.29 to 0.0.1-next.30
132
+
133
+ ## [0.0.1-next.29](https://github.com/twinfoundation/data/compare/data-framework-v0.0.1-next.28...data-framework-v0.0.1-next.29) (2025-03-28)
134
+
135
+
136
+ ### Features
137
+
138
+ * add document cache access methods ([dbf1e36](https://github.com/twinfoundation/data/commit/dbf1e36d176c5f428f8c52628fb5a1ff7a6a174a))
139
+
140
+
141
+ ### Dependencies
142
+
143
+ * The following workspace dependencies were updated
144
+ * dependencies
145
+ * @twin.org/data-core bumped from 0.0.1-next.28 to 0.0.1-next.29
146
+ * @twin.org/data-json-ld bumped from 0.0.1-next.28 to 0.0.1-next.29
147
+
148
+ ## v0.0.1-next.28
4
149
 
5
150
  - Initial Release
@@ -4,13 +4,13 @@ Handle all the framework data types.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new FrameworkDataTypes()
7
+ ### Constructor
8
8
 
9
- > **new FrameworkDataTypes**(): [`FrameworkDataTypes`](FrameworkDataTypes.md)
9
+ > **new FrameworkDataTypes**(): `FrameworkDataTypes`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`FrameworkDataTypes`](FrameworkDataTypes.md)
13
+ `FrameworkDataTypes`
14
14
 
15
15
  ## Methods
16
16
 
@@ -6,8 +6,10 @@
6
6
 
7
7
  ## Type Aliases
8
8
 
9
+ - [FrameworkContexts](type-aliases/FrameworkContexts.md)
9
10
  - [FrameworkTypes](type-aliases/FrameworkTypes.md)
10
11
 
11
12
  ## Variables
12
13
 
14
+ - [FrameworkContexts](variables/FrameworkContexts.md)
13
15
  - [FrameworkTypes](variables/FrameworkTypes.md)
@@ -0,0 +1,5 @@
1
+ # Type Alias: FrameworkContexts
2
+
3
+ > **FrameworkContexts** = *typeof* [`FrameworkContexts`](../variables/FrameworkContexts.md)\[keyof *typeof* [`FrameworkContexts`](../variables/FrameworkContexts.md)\]
4
+
5
+ The contexts of framework data.
@@ -1,5 +1,5 @@
1
1
  # Type Alias: FrameworkTypes
2
2
 
3
- > **FrameworkTypes**: *typeof* [`FrameworkTypes`](../variables/FrameworkTypes.md)\[keyof *typeof* [`FrameworkTypes`](../variables/FrameworkTypes.md)\]
3
+ > **FrameworkTypes** = *typeof* [`FrameworkTypes`](../variables/FrameworkTypes.md)\[keyof *typeof* [`FrameworkTypes`](../variables/FrameworkTypes.md)\]
4
4
 
5
5
  The types of framework data.
@@ -0,0 +1,13 @@
1
+ # Variable: FrameworkContexts
2
+
3
+ > `const` **FrameworkContexts**: `object`
4
+
5
+ The contexts of framework data.
6
+
7
+ ## Type declaration
8
+
9
+ ### ContextRoot
10
+
11
+ > `readonly` **ContextRoot**: `"https://schema.twindev.org/framework/"` = `"https://schema.twindev.org/framework/"`
12
+
13
+ Context Root.
@@ -6,26 +6,20 @@ The types of framework data.
6
6
 
7
7
  ## Type declaration
8
8
 
9
- ### ContextRoot
10
-
11
- > `readonly` **ContextRoot**: `"https://schema.twindev.org/framework/"` = `"https://schema.twindev.org/framework/"`
12
-
13
- Context Root.
14
-
15
9
  ### Urn
16
10
 
17
- > `readonly` **Urn**: `"https://schema.twindev.org/framework/URN"` = `"https://schema.twindev.org/framework/URN"`
11
+ > `readonly` **Urn**: `"URN"` = `"URN"`
18
12
 
19
13
  Represents a urn.
20
14
 
21
15
  ### TimestampMilliseconds
22
16
 
23
- > `readonly` **TimestampMilliseconds**: `"https://schema.twindev.org/framework/TimestampMilliseconds"` = `"https://schema.twindev.org/framework/TimestampMilliseconds"`
17
+ > `readonly` **TimestampMilliseconds**: `"TimestampMilliseconds"` = `"TimestampMilliseconds"`
24
18
 
25
19
  Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
26
20
 
27
21
  ### TimestampSeconds
28
22
 
29
- > `readonly` **TimestampSeconds**: `"https://schema.twindev.org/framework/TimestampSeconds"` = `"https://schema.twindev.org/framework/TimestampSeconds"`
23
+ > `readonly` **TimestampSeconds**: `"TimestampSeconds"` = `"TimestampSeconds"`
30
24
 
31
25
  Represents a timestamp as an integer, seconds since 1 Jan 1970.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/data-framework",
3
- "version": "0.0.1-next.8",
3
+ "version": "0.0.1",
4
4
  "description": "Models which define the structure of framework types",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,23 +14,22 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "next",
18
- "@twin.org/data-core": "0.0.1-next.8",
19
- "@twin.org/data-json-ld": "0.0.1-next.8",
20
- "@twin.org/entity": "next",
21
- "@twin.org/nameof": "next",
22
- "@types/json-schema": "7.0.15"
17
+ "@twin.org/core": "^0.0.1",
18
+ "@twin.org/data-core": "^0.0.1",
19
+ "@twin.org/data-json-ld": "^0.0.1",
20
+ "@twin.org/entity": "^0.0.1",
21
+ "@twin.org/nameof": "^0.0.1"
23
22
  },
24
23
  "main": "./dist/cjs/index.cjs",
25
24
  "module": "./dist/esm/index.mjs",
26
25
  "types": "./dist/types/index.d.ts",
27
26
  "exports": {
28
27
  ".": {
28
+ "types": "./dist/types/index.d.ts",
29
29
  "require": "./dist/cjs/index.cjs",
30
- "import": "./dist/esm/index.mjs",
31
- "types": "./dist/types/index.d.ts"
30
+ "import": "./dist/esm/index.mjs"
32
31
  },
33
- "./locales": "./locales"
32
+ "./locales/*.json": "./locales/*.json"
34
33
  },
35
34
  "files": [
36
35
  "dist/cjs",