@twin.org/data-framework 0.0.3-next.16 → 0.0.3-next.18
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TWIN Framework Data
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package provides framework data models that define common structures consumed by other packages in the repository. It centralises shared domain shapes so integrations can rely on clearer contracts and maintain semantic consistency as the ecosystem evolves.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/docs/changelog.md
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.3-next.18](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.17...data-framework-v0.0.3-next.18) (2026-03-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **data-framework:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/data-core bumped from 0.0.3-next.17 to 0.0.3-next.18
|
|
16
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.17 to 0.0.3-next.18
|
|
17
|
+
|
|
18
|
+
## [0.0.3-next.17](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.16...data-framework-v0.0.3-next.17) (2026-03-12)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* **data-framework:** Synchronize repo versions
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/data-core bumped from 0.0.3-next.16 to 0.0.3-next.17
|
|
31
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.16 to 0.0.3-next.17
|
|
2
32
|
|
|
3
33
|
## [0.0.3-next.16](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.15...data-framework-v0.0.3-next.16) (2026-03-06)
|
|
4
34
|
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Data Framework Examples
|
|
2
|
+
|
|
3
|
+
These examples show how to register framework data types and validate values against the registered handlers.
|
|
4
|
+
|
|
5
|
+
## FrameworkDataTypes
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { type IValidationFailure } from '@twin.org/core';
|
|
9
|
+
import { DataTypeHelper, ValidationMode } from '@twin.org/data-core';
|
|
10
|
+
import { FrameworkContexts, FrameworkDataTypes, FrameworkTypes } from '@twin.org/data-framework';
|
|
11
|
+
|
|
12
|
+
FrameworkDataTypes.registerTypes();
|
|
13
|
+
|
|
14
|
+
const failures: IValidationFailure[] = [];
|
|
15
|
+
const urnType = `${FrameworkContexts.Namespace}${FrameworkTypes.Urn}`;
|
|
16
|
+
|
|
17
|
+
const isValidUrn = await DataTypeHelper.validate(
|
|
18
|
+
'resourceId',
|
|
19
|
+
urnType,
|
|
20
|
+
'urn:example:12345',
|
|
21
|
+
failures,
|
|
22
|
+
{
|
|
23
|
+
validationMode: ValidationMode.Both,
|
|
24
|
+
failOnMissingType: true
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
console.log('URN validation result:', isValidUrn);
|
|
29
|
+
console.log('Failure count:', failures.length);
|
|
30
|
+
```
|
|
@@ -6,19 +6,19 @@ The contexts of framework data.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
### Namespace
|
|
9
|
+
### Namespace {#namespace}
|
|
10
10
|
|
|
11
11
|
> `readonly` **Namespace**: `"https://schema.twindev.org/framework/"` = `"https://schema.twindev.org/framework/"`
|
|
12
12
|
|
|
13
13
|
The canonical RDF namespace URI for Framework.
|
|
14
14
|
|
|
15
|
-
### Context
|
|
15
|
+
### Context {#context}
|
|
16
16
|
|
|
17
17
|
> `readonly` **Context**: `"https://schema.twindev.org/framework/"` = `"https://schema.twindev.org/framework/"`
|
|
18
18
|
|
|
19
19
|
The value to use in JSON-LD context for Framework.
|
|
20
20
|
|
|
21
|
-
### JsonLdContext
|
|
21
|
+
### JsonLdContext {#jsonldcontext}
|
|
22
22
|
|
|
23
23
|
> `readonly` **JsonLdContext**: `"https://schema.twindev.org/framework/types.jsonld"` = `"https://schema.twindev.org/framework/types.jsonld"`
|
|
24
24
|
|
|
@@ -6,19 +6,19 @@ The types of framework data.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
### Urn
|
|
9
|
+
### Urn {#urn}
|
|
10
10
|
|
|
11
11
|
> `readonly` **Urn**: `"URN"` = `"URN"`
|
|
12
12
|
|
|
13
13
|
Represents a urn.
|
|
14
14
|
|
|
15
|
-
### TimestampMilliseconds
|
|
15
|
+
### TimestampMilliseconds {#timestampmilliseconds}
|
|
16
16
|
|
|
17
17
|
> `readonly` **TimestampMilliseconds**: `"TimestampMilliseconds"` = `"TimestampMilliseconds"`
|
|
18
18
|
|
|
19
19
|
Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
|
|
20
20
|
|
|
21
|
-
### TimestampSeconds
|
|
21
|
+
### TimestampSeconds {#timestampseconds}
|
|
22
22
|
|
|
23
23
|
> `readonly` **TimestampSeconds**: `"TimestampSeconds"` = `"TimestampSeconds"`
|
|
24
24
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/data-framework",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.18",
|
|
4
|
+
"description": "Framework data models that define common structures used by other packages.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/twinfoundation/data.git",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
|
-
"@twin.org/data-core": "0.0.3-next.
|
|
19
|
-
"@twin.org/data-json-ld": "0.0.3-next.
|
|
18
|
+
"@twin.org/data-core": "0.0.3-next.18",
|
|
19
|
+
"@twin.org/data-json-ld": "0.0.3-next.18",
|
|
20
20
|
"@twin.org/entity": "next",
|
|
21
21
|
"@twin.org/nameof": "next"
|
|
22
22
|
},
|