@twin.org/data-framework 0.0.2-next.4 → 0.0.3-next.10
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/dist/es/dataTypes/frameworkDataTypes.js +44 -0
- package/dist/es/dataTypes/frameworkDataTypes.js.map +1 -0
- package/dist/es/index.js +6 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/frameworkContexts.js +21 -0
- package/dist/es/models/frameworkContexts.js.map +1 -0
- package/dist/es/models/frameworkTypes.js +21 -0
- package/dist/es/models/frameworkTypes.js.map +1 -0
- package/dist/es/schemas/TimestampMilliseconds.json +4 -0
- package/dist/es/schemas/TimestampSeconds.json +4 -0
- package/dist/es/schemas/URN.json +4 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/models/frameworkContexts.d.ts +10 -2
- package/docs/changelog.md +158 -0
- package/docs/reference/variables/FrameworkContexts.md +15 -3
- package/package.json +7 -9
- package/dist/cjs/index.cjs +0 -97
- package/dist/esm/index.mjs +0 -93
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { Urn, Validation } from "@twin.org/core";
|
|
4
|
+
import { DataTypeHandlerFactory } from "@twin.org/data-core";
|
|
5
|
+
import { FrameworkContexts } from "../models/frameworkContexts.js";
|
|
6
|
+
import { FrameworkTypes } from "../models/frameworkTypes.js";
|
|
7
|
+
import TimestampMillisecondsSchema from "../schemas/TimestampMilliseconds.json" with { type: "json" };
|
|
8
|
+
import TimestampSecondsSchema from "../schemas/TimestampSeconds.json" with { type: "json" };
|
|
9
|
+
import URNSchema from "../schemas/URN.json" with { type: "json" };
|
|
10
|
+
/**
|
|
11
|
+
* Handle all the framework data types.
|
|
12
|
+
*/
|
|
13
|
+
export class FrameworkDataTypes {
|
|
14
|
+
/**
|
|
15
|
+
* Register all the data types.
|
|
16
|
+
*/
|
|
17
|
+
static registerTypes() {
|
|
18
|
+
DataTypeHandlerFactory.register(`${FrameworkContexts.Namespace}${FrameworkTypes.Urn}`, () => ({
|
|
19
|
+
namespace: FrameworkContexts.Namespace,
|
|
20
|
+
jsonLdContext: FrameworkContexts.JsonLdContext,
|
|
21
|
+
type: FrameworkTypes.Urn,
|
|
22
|
+
defaultValue: "",
|
|
23
|
+
jsonSchema: async () => URNSchema,
|
|
24
|
+
validate: async (propertyName, value, failures, container) => Urn.validate(propertyName, value, failures)
|
|
25
|
+
}));
|
|
26
|
+
DataTypeHandlerFactory.register(`${FrameworkContexts.Namespace}${FrameworkTypes.TimestampMilliseconds}`, () => ({
|
|
27
|
+
namespace: FrameworkContexts.Namespace,
|
|
28
|
+
jsonLdContext: FrameworkContexts.JsonLdContext,
|
|
29
|
+
type: FrameworkTypes.TimestampMilliseconds,
|
|
30
|
+
defaultValue: Date.now(),
|
|
31
|
+
jsonSchema: async () => TimestampMillisecondsSchema,
|
|
32
|
+
validate: async (propertyName, value, failures, container) => Validation.timestampMilliseconds(propertyName, value, failures)
|
|
33
|
+
}));
|
|
34
|
+
DataTypeHandlerFactory.register(`${FrameworkContexts.Namespace}${FrameworkTypes.TimestampSeconds}`, () => ({
|
|
35
|
+
namespace: FrameworkContexts.Namespace,
|
|
36
|
+
jsonLdContext: FrameworkContexts.JsonLdContext,
|
|
37
|
+
type: FrameworkTypes.TimestampSeconds,
|
|
38
|
+
defaultValue: Math.floor(Date.now() / 1000),
|
|
39
|
+
jsonSchema: async () => TimestampSecondsSchema,
|
|
40
|
+
validate: async (propertyName, value, failures, container) => Validation.timestampSeconds(propertyName, value, failures)
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=frameworkDataTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameworkDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/frameworkDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,2BAA2B,MAAM,uCAAuC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtG,OAAO,sBAAsB,MAAM,kCAAkC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5F,OAAO,SAAS,MAAM,qBAAqB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAElE;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC9B;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,sBAAsB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,SAAS,GAAG,cAAc,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7F,SAAS,EAAE,iBAAiB,CAAC,SAAS;YACtC,aAAa,EAAE,iBAAiB,CAAC,aAAa;YAC9C,IAAI,EAAE,cAAc,CAAC,GAAG;YACxB,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,SAAwB;YAChD,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,CAC5D,GAAG,CAAC,QAAQ,CAAC,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC;SAC5C,CAAC,CAAC,CAAC;QAEJ,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,iBAAiB,CAAC,SAAS,GAAG,cAAc,CAAC,qBAAqB,EAAE,EACvE,GAAG,EAAE,CAAC,CAAC;YACN,SAAS,EAAE,iBAAiB,CAAC,SAAS;YACtC,aAAa,EAAE,iBAAiB,CAAC,aAAa;YAC9C,IAAI,EAAE,cAAc,CAAC,qBAAqB;YAC1C,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE;YACxB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,2BAA0C;YAClE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,CAC5D,UAAU,CAAC,qBAAqB,CAAC,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC;SAChE,CAAC,CACF,CAAC;QAEF,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,iBAAiB,CAAC,SAAS,GAAG,cAAc,CAAC,gBAAgB,EAAE,EAClE,GAAG,EAAE,CAAC,CAAC;YACN,SAAS,EAAE,iBAAiB,CAAC,SAAS;YACtC,aAAa,EAAE,iBAAiB,CAAC,aAAa;YAC9C,IAAI,EAAE,cAAc,CAAC,gBAAgB;YACrC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;YAC3C,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,sBAAqC;YAC7D,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,CAC5D,UAAU,CAAC,gBAAgB,CAAC,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC;SAC3D,CAAC,CACF,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Urn, Validation } from \"@twin.org/core\";\nimport { DataTypeHandlerFactory, type IJsonSchema } from \"@twin.org/data-core\";\nimport { FrameworkContexts } from \"../models/frameworkContexts.js\";\nimport { FrameworkTypes } from \"../models/frameworkTypes.js\";\nimport TimestampMillisecondsSchema from \"../schemas/TimestampMilliseconds.json\" with { type: \"json\" };\nimport TimestampSecondsSchema from \"../schemas/TimestampSeconds.json\" with { type: \"json\" };\nimport URNSchema from \"../schemas/URN.json\" with { type: \"json\" };\n\n/**\n * Handle all the framework data types.\n */\nexport class FrameworkDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tDataTypeHandlerFactory.register(`${FrameworkContexts.Namespace}${FrameworkTypes.Urn}`, () => ({\n\t\t\tnamespace: FrameworkContexts.Namespace,\n\t\t\tjsonLdContext: FrameworkContexts.JsonLdContext,\n\t\t\ttype: FrameworkTypes.Urn,\n\t\t\tdefaultValue: \"\",\n\t\t\tjsonSchema: async () => URNSchema as IJsonSchema,\n\t\t\tvalidate: async (propertyName, value, failures, container) =>\n\t\t\t\tUrn.validate(propertyName, value, failures)\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${FrameworkContexts.Namespace}${FrameworkTypes.TimestampMilliseconds}`,\n\t\t\t() => ({\n\t\t\t\tnamespace: FrameworkContexts.Namespace,\n\t\t\t\tjsonLdContext: FrameworkContexts.JsonLdContext,\n\t\t\t\ttype: FrameworkTypes.TimestampMilliseconds,\n\t\t\t\tdefaultValue: Date.now(),\n\t\t\t\tjsonSchema: async () => TimestampMillisecondsSchema as IJsonSchema,\n\t\t\t\tvalidate: async (propertyName, value, failures, container) =>\n\t\t\t\t\tValidation.timestampMilliseconds(propertyName, value, failures)\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${FrameworkContexts.Namespace}${FrameworkTypes.TimestampSeconds}`,\n\t\t\t() => ({\n\t\t\t\tnamespace: FrameworkContexts.Namespace,\n\t\t\t\tjsonLdContext: FrameworkContexts.JsonLdContext,\n\t\t\t\ttype: FrameworkTypes.TimestampSeconds,\n\t\t\t\tdefaultValue: Math.floor(Date.now() / 1000),\n\t\t\t\tjsonSchema: async () => TimestampSecondsSchema as IJsonSchema,\n\t\t\t\tvalidate: async (propertyName, value, failures, container) =>\n\t\t\t\t\tValidation.timestampSeconds(propertyName, value, failures)\n\t\t\t})\n\t\t);\n\t}\n}\n"]}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./dataTypes/frameworkDataTypes.js\";\nexport * from \"./models/frameworkContexts.js\";\nexport * from \"./models/frameworkTypes.js\";\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The contexts of framework data.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const FrameworkContexts = {
|
|
8
|
+
/**
|
|
9
|
+
* The canonical RDF namespace URI for Framework.
|
|
10
|
+
*/
|
|
11
|
+
Namespace: "https://schema.twindev.org/framework/",
|
|
12
|
+
/**
|
|
13
|
+
* The value to use in JSON-LD context for Framework.
|
|
14
|
+
*/
|
|
15
|
+
Context: "https://schema.twindev.org/framework/",
|
|
16
|
+
/**
|
|
17
|
+
* The JSON-LD Context URL for Framework.
|
|
18
|
+
*/
|
|
19
|
+
JsonLdContext: "https://schema.twindev.org/framework/types.jsonld"
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=frameworkContexts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameworkContexts.js","sourceRoot":"","sources":["../../../src/models/frameworkContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,SAAS,EAAE,uCAAuC;IAElD;;OAEG;IACH,OAAO,EAAE,uCAAuC;IAEhD;;OAEG;IACH,aAAa,EAAE,mDAAmD;CACzD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of framework data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const FrameworkContexts = {\n\t/**\n\t * The canonical RDF namespace URI for Framework.\n\t */\n\tNamespace: \"https://schema.twindev.org/framework/\",\n\n\t/**\n\t * The value to use in JSON-LD context for Framework.\n\t */\n\tContext: \"https://schema.twindev.org/framework/\",\n\n\t/**\n\t * The JSON-LD Context URL for Framework.\n\t */\n\tJsonLdContext: \"https://schema.twindev.org/framework/types.jsonld\"\n} as const;\n\n/**\n * The contexts of framework data.\n */\nexport type FrameworkContexts = (typeof FrameworkContexts)[keyof typeof FrameworkContexts];\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The types of framework data.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const FrameworkTypes = {
|
|
8
|
+
/**
|
|
9
|
+
* Represents a urn.
|
|
10
|
+
*/
|
|
11
|
+
Urn: "URN",
|
|
12
|
+
/**
|
|
13
|
+
* Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
|
|
14
|
+
*/
|
|
15
|
+
TimestampMilliseconds: "TimestampMilliseconds",
|
|
16
|
+
/**
|
|
17
|
+
* Represents a timestamp as an integer, seconds since 1 Jan 1970.
|
|
18
|
+
*/
|
|
19
|
+
TimestampSeconds: "TimestampSeconds"
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=frameworkTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameworkTypes.js","sourceRoot":"","sources":["../../../src/models/frameworkTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B;;OAEG;IACH,GAAG,EAAE,KAAK;IAEV;;OAEG;IACH,qBAAqB,EAAE,uBAAuB;IAE9C;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;CAC3B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of framework data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const FrameworkTypes = {\n\t/**\n\t * Represents a urn.\n\t */\n\tUrn: \"URN\",\n\n\t/**\n\t * Represents a timestamp as an integer, milliseconds since 1 Jan 1970.\n\t */\n\tTimestampMilliseconds: \"TimestampMilliseconds\",\n\n\t/**\n\t * Represents a timestamp as an integer, seconds since 1 Jan 1970.\n\t */\n\tTimestampSeconds: \"TimestampSeconds\"\n} as const;\n\n/**\n * The types of framework data.\n */\nexport type FrameworkTypes = (typeof FrameworkTypes)[keyof typeof FrameworkTypes];\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./dataTypes/frameworkDataTypes";
|
|
2
|
-
export * from "./models/frameworkContexts";
|
|
3
|
-
export * from "./models/frameworkTypes";
|
|
1
|
+
export * from "./dataTypes/frameworkDataTypes.js";
|
|
2
|
+
export * from "./models/frameworkContexts.js";
|
|
3
|
+
export * from "./models/frameworkTypes.js";
|
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const FrameworkContexts: {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* The canonical RDF namespace URI for Framework.
|
|
7
7
|
*/
|
|
8
|
-
readonly
|
|
8
|
+
readonly Namespace: "https://schema.twindev.org/framework/";
|
|
9
|
+
/**
|
|
10
|
+
* The value to use in JSON-LD context for Framework.
|
|
11
|
+
*/
|
|
12
|
+
readonly Context: "https://schema.twindev.org/framework/";
|
|
13
|
+
/**
|
|
14
|
+
* The JSON-LD Context URL for Framework.
|
|
15
|
+
*/
|
|
16
|
+
readonly JsonLdContext: "https://schema.twindev.org/framework/types.jsonld";
|
|
9
17
|
};
|
|
10
18
|
/**
|
|
11
19
|
* The contexts of framework data.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,163 @@
|
|
|
1
1
|
# @twin.org/data-framework - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.10](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.9...data-framework-v0.0.3-next.10) (2026-02-24)
|
|
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.9 to 0.0.3-next.10
|
|
16
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
17
|
+
|
|
18
|
+
## [0.0.3-next.9](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.8...data-framework-v0.0.3-next.9) (2026-02-23)
|
|
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.8 to 0.0.3-next.9
|
|
31
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.8 to 0.0.3-next.9
|
|
32
|
+
|
|
33
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.7...data-framework-v0.0.3-next.8) (2026-02-02)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Miscellaneous Chores
|
|
37
|
+
|
|
38
|
+
* **data-framework:** Synchronize repo versions
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Dependencies
|
|
42
|
+
|
|
43
|
+
* The following workspace dependencies were updated
|
|
44
|
+
* dependencies
|
|
45
|
+
* @twin.org/data-core bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
46
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
47
|
+
|
|
48
|
+
## [0.0.3-next.7](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.6...data-framework-v0.0.3-next.7) (2026-01-21)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Features
|
|
52
|
+
|
|
53
|
+
* update context naming ([#37](https://github.com/twinfoundation/data/issues/37)) ([9d99360](https://github.com/twinfoundation/data/commit/9d993605aa51f27a09722729057c6ee921617c2d))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Dependencies
|
|
57
|
+
|
|
58
|
+
* The following workspace dependencies were updated
|
|
59
|
+
* dependencies
|
|
60
|
+
* @twin.org/data-core bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
61
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
62
|
+
|
|
63
|
+
## [0.0.3-next.6](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.5...data-framework-v0.0.3-next.6) (2026-01-14)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Miscellaneous Chores
|
|
67
|
+
|
|
68
|
+
* **data-framework:** Synchronize repo versions
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Dependencies
|
|
72
|
+
|
|
73
|
+
* The following workspace dependencies were updated
|
|
74
|
+
* dependencies
|
|
75
|
+
* @twin.org/data-core bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
76
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
77
|
+
|
|
78
|
+
## [0.0.3-next.5](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.4...data-framework-v0.0.3-next.5) (2026-01-14)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Features
|
|
82
|
+
|
|
83
|
+
* improve data type registration ([#34](https://github.com/twinfoundation/data/issues/34)) ([855d110](https://github.com/twinfoundation/data/commit/855d11046a4d85317b77a5c4e0f4a7b1b6d1a767))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Dependencies
|
|
87
|
+
|
|
88
|
+
* The following workspace dependencies were updated
|
|
89
|
+
* dependencies
|
|
90
|
+
* @twin.org/data-core bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
91
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
92
|
+
|
|
93
|
+
## [0.0.3-next.4](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.3...data-framework-v0.0.3-next.4) (2026-01-06)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Miscellaneous Chores
|
|
97
|
+
|
|
98
|
+
* **data-framework:** Synchronize repo versions
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Dependencies
|
|
102
|
+
|
|
103
|
+
* The following workspace dependencies were updated
|
|
104
|
+
* dependencies
|
|
105
|
+
* @twin.org/data-core bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
106
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
107
|
+
|
|
108
|
+
## [0.0.3-next.3](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.2...data-framework-v0.0.3-next.3) (2026-01-05)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### Miscellaneous Chores
|
|
112
|
+
|
|
113
|
+
* **data-framework:** Synchronize repo versions
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Dependencies
|
|
117
|
+
|
|
118
|
+
* The following workspace dependencies were updated
|
|
119
|
+
* dependencies
|
|
120
|
+
* @twin.org/data-core bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
121
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
122
|
+
|
|
123
|
+
## [0.0.3-next.2](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.1...data-framework-v0.0.3-next.2) (2025-11-24)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Miscellaneous Chores
|
|
127
|
+
|
|
128
|
+
* **data-framework:** Synchronize repo versions
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
### Dependencies
|
|
132
|
+
|
|
133
|
+
* The following workspace dependencies were updated
|
|
134
|
+
* dependencies
|
|
135
|
+
* @twin.org/data-core bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
136
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
137
|
+
|
|
138
|
+
## [0.0.3-next.1](https://github.com/twinfoundation/data/compare/data-framework-v0.0.3-next.0...data-framework-v0.0.3-next.1) (2025-11-10)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### Features
|
|
142
|
+
|
|
143
|
+
* add context id features ([#25](https://github.com/twinfoundation/data/issues/25)) ([6592f2e](https://github.com/twinfoundation/data/commit/6592f2e4e59021cc42a079a4f46242758a54313d))
|
|
144
|
+
* add document cache access methods ([dbf1e36](https://github.com/twinfoundation/data/commit/dbf1e36d176c5f428f8c52628fb5a1ff7a6a174a))
|
|
145
|
+
* add validate-locales ([cf9b761](https://github.com/twinfoundation/data/commit/cf9b76160820fe0b13b4fe56ed241c1d5511b7c1))
|
|
146
|
+
* eslint migration to flat config ([b0db6e6](https://github.com/twinfoundation/data/commit/b0db6e69a90046fc60d29e4273fcdfee13c16088))
|
|
147
|
+
* expand Json LD Keyword ([70632d1](https://github.com/twinfoundation/data/commit/70632d1e11ad85cf3c57e118476b125a673f1681))
|
|
148
|
+
* update framework core ([c077b8c](https://github.com/twinfoundation/data/commit/c077b8c07e7ee66b5482254eab6f2a52cd911270))
|
|
149
|
+
* use fully qualified names for data type lookups ([b7b5c74](https://github.com/twinfoundation/data/commit/b7b5c746b0180a87baa976f6a7a76cedd53d8ff7))
|
|
150
|
+
* use shared store mechanism ([#3](https://github.com/twinfoundation/data/issues/3)) ([33eb221](https://github.com/twinfoundation/data/commit/33eb221ccec2b4a79549c06e9a04225009b93a46))
|
|
151
|
+
* use updated Is.function ([46a4715](https://github.com/twinfoundation/data/commit/46a4715f995aea34f2011138662fe003c9727d07))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Dependencies
|
|
155
|
+
|
|
156
|
+
* The following workspace dependencies were updated
|
|
157
|
+
* dependencies
|
|
158
|
+
* @twin.org/data-core bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
159
|
+
* @twin.org/data-json-ld bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
160
|
+
|
|
3
161
|
## [0.0.2-next.4](https://github.com/twinfoundation/data/compare/data-framework-v0.0.2-next.3...data-framework-v0.0.2-next.4) (2025-10-09)
|
|
4
162
|
|
|
5
163
|
|
|
@@ -6,8 +6,20 @@ The contexts of framework data.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Namespace
|
|
10
10
|
|
|
11
|
-
> `readonly` **
|
|
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
|
+
|
|
15
|
+
### Context
|
|
16
|
+
|
|
17
|
+
> `readonly` **Context**: `"https://schema.twindev.org/framework/"` = `"https://schema.twindev.org/framework/"`
|
|
18
|
+
|
|
19
|
+
The value to use in JSON-LD context for Framework.
|
|
20
|
+
|
|
21
|
+
### JsonLdContext
|
|
22
|
+
|
|
23
|
+
> `readonly` **JsonLdContext**: `"https://schema.twindev.org/framework/types.jsonld"` = `"https://schema.twindev.org/framework/types.jsonld"`
|
|
24
|
+
|
|
25
|
+
The JSON-LD Context URL for Framework.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/data-framework",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-next.10",
|
|
4
4
|
"description": "Models which define the structure of framework types",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,25 +15,23 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
|
-
"@twin.org/data-core": "0.0.
|
|
19
|
-
"@twin.org/data-json-ld": "0.0.
|
|
18
|
+
"@twin.org/data-core": "0.0.3-next.10",
|
|
19
|
+
"@twin.org/data-json-ld": "0.0.3-next.10",
|
|
20
20
|
"@twin.org/entity": "next",
|
|
21
21
|
"@twin.org/nameof": "next"
|
|
22
22
|
},
|
|
23
|
-
"main": "./dist/
|
|
24
|
-
"module": "./dist/esm/index.mjs",
|
|
23
|
+
"main": "./dist/es/index.js",
|
|
25
24
|
"types": "./dist/types/index.d.ts",
|
|
26
25
|
"exports": {
|
|
27
26
|
".": {
|
|
28
27
|
"types": "./dist/types/index.d.ts",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
28
|
+
"import": "./dist/es/index.js",
|
|
29
|
+
"default": "./dist/es/index.js"
|
|
31
30
|
},
|
|
32
31
|
"./locales/*.json": "./locales/*.json"
|
|
33
32
|
},
|
|
34
33
|
"files": [
|
|
35
|
-
"dist/
|
|
36
|
-
"dist/esm",
|
|
34
|
+
"dist/es",
|
|
37
35
|
"dist/types",
|
|
38
36
|
"locales",
|
|
39
37
|
"docs"
|
package/dist/cjs/index.cjs
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var core = require('@twin.org/core');
|
|
4
|
-
var dataCore = require('@twin.org/data-core');
|
|
5
|
-
|
|
6
|
-
// Copyright 2024 IOTA Stiftung.
|
|
7
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
8
|
-
/**
|
|
9
|
-
* The contexts of framework data.
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
|
-
const FrameworkContexts = {
|
|
13
|
-
/**
|
|
14
|
-
* Context Root.
|
|
15
|
-
*/
|
|
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 = {
|
|
26
|
-
/**
|
|
27
|
-
* Represents a urn.
|
|
28
|
-
*/
|
|
29
|
-
Urn: "URN",
|
|
30
|
-
/**
|
|
31
|
-
* Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
|
|
32
|
-
*/
|
|
33
|
-
TimestampMilliseconds: "TimestampMilliseconds",
|
|
34
|
-
/**
|
|
35
|
-
* Represents a timestamp as an integer, seconds since 1 Jan 1970.
|
|
36
|
-
*/
|
|
37
|
-
TimestampSeconds: "TimestampSeconds"
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var type$2 = "integer";
|
|
41
|
-
var minimum$1 = 0;
|
|
42
|
-
var TimestampMillisecondsSchema = {
|
|
43
|
-
type: type$2,
|
|
44
|
-
minimum: minimum$1
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
var type$1 = "integer";
|
|
48
|
-
var minimum = 0;
|
|
49
|
-
var TimestampSecondsSchema = {
|
|
50
|
-
type: type$1,
|
|
51
|
-
minimum: minimum
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var type = "string";
|
|
55
|
-
var format = "uri";
|
|
56
|
-
var URNSchema = {
|
|
57
|
-
type: type,
|
|
58
|
-
format: format
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// Copyright 2024 IOTA Stiftung.
|
|
62
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
63
|
-
/**
|
|
64
|
-
* Handle all the framework data types.
|
|
65
|
-
*/
|
|
66
|
-
class FrameworkDataTypes {
|
|
67
|
-
/**
|
|
68
|
-
* Register all the data types.
|
|
69
|
-
*/
|
|
70
|
-
static registerTypes() {
|
|
71
|
-
dataCore.DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.Urn}`, () => ({
|
|
72
|
-
context: FrameworkContexts.ContextRoot,
|
|
73
|
-
type: FrameworkTypes.Urn,
|
|
74
|
-
defaultValue: "",
|
|
75
|
-
jsonSchema: async () => URNSchema,
|
|
76
|
-
validate: async (propertyName, value, failures, container) => core.Urn.validate(propertyName, value, failures)
|
|
77
|
-
}));
|
|
78
|
-
dataCore.DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.TimestampMilliseconds}`, () => ({
|
|
79
|
-
context: FrameworkContexts.ContextRoot,
|
|
80
|
-
type: FrameworkTypes.TimestampMilliseconds,
|
|
81
|
-
defaultValue: Date.now(),
|
|
82
|
-
jsonSchema: async () => TimestampMillisecondsSchema,
|
|
83
|
-
validate: async (propertyName, value, failures, container) => core.Validation.timestampMilliseconds(propertyName, value, failures)
|
|
84
|
-
}));
|
|
85
|
-
dataCore.DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.TimestampSeconds}`, () => ({
|
|
86
|
-
context: FrameworkContexts.ContextRoot,
|
|
87
|
-
type: FrameworkTypes.TimestampSeconds,
|
|
88
|
-
defaultValue: Math.floor(Date.now() / 1000),
|
|
89
|
-
jsonSchema: async () => TimestampSecondsSchema,
|
|
90
|
-
validate: async (propertyName, value, failures, container) => core.Validation.timestampSeconds(propertyName, value, failures)
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
exports.FrameworkContexts = FrameworkContexts;
|
|
96
|
-
exports.FrameworkDataTypes = FrameworkDataTypes;
|
|
97
|
-
exports.FrameworkTypes = FrameworkTypes;
|
package/dist/esm/index.mjs
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Urn, Validation } from '@twin.org/core';
|
|
2
|
-
import { DataTypeHandlerFactory } from '@twin.org/data-core';
|
|
3
|
-
|
|
4
|
-
// Copyright 2024 IOTA Stiftung.
|
|
5
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
6
|
-
/**
|
|
7
|
-
* The contexts of framework data.
|
|
8
|
-
*/
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10
|
-
const FrameworkContexts = {
|
|
11
|
-
/**
|
|
12
|
-
* Context Root.
|
|
13
|
-
*/
|
|
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 = {
|
|
24
|
-
/**
|
|
25
|
-
* Represents a urn.
|
|
26
|
-
*/
|
|
27
|
-
Urn: "URN",
|
|
28
|
-
/**
|
|
29
|
-
* Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
|
|
30
|
-
*/
|
|
31
|
-
TimestampMilliseconds: "TimestampMilliseconds",
|
|
32
|
-
/**
|
|
33
|
-
* Represents a timestamp as an integer, seconds since 1 Jan 1970.
|
|
34
|
-
*/
|
|
35
|
-
TimestampSeconds: "TimestampSeconds"
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
var type$2 = "integer";
|
|
39
|
-
var minimum$1 = 0;
|
|
40
|
-
var TimestampMillisecondsSchema = {
|
|
41
|
-
type: type$2,
|
|
42
|
-
minimum: minimum$1
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var type$1 = "integer";
|
|
46
|
-
var minimum = 0;
|
|
47
|
-
var TimestampSecondsSchema = {
|
|
48
|
-
type: type$1,
|
|
49
|
-
minimum: minimum
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var type = "string";
|
|
53
|
-
var format = "uri";
|
|
54
|
-
var URNSchema = {
|
|
55
|
-
type: type,
|
|
56
|
-
format: format
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// Copyright 2024 IOTA Stiftung.
|
|
60
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
61
|
-
/**
|
|
62
|
-
* Handle all the framework data types.
|
|
63
|
-
*/
|
|
64
|
-
class FrameworkDataTypes {
|
|
65
|
-
/**
|
|
66
|
-
* Register all the data types.
|
|
67
|
-
*/
|
|
68
|
-
static registerTypes() {
|
|
69
|
-
DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.Urn}`, () => ({
|
|
70
|
-
context: FrameworkContexts.ContextRoot,
|
|
71
|
-
type: FrameworkTypes.Urn,
|
|
72
|
-
defaultValue: "",
|
|
73
|
-
jsonSchema: async () => URNSchema,
|
|
74
|
-
validate: async (propertyName, value, failures, container) => Urn.validate(propertyName, value, failures)
|
|
75
|
-
}));
|
|
76
|
-
DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.TimestampMilliseconds}`, () => ({
|
|
77
|
-
context: FrameworkContexts.ContextRoot,
|
|
78
|
-
type: FrameworkTypes.TimestampMilliseconds,
|
|
79
|
-
defaultValue: Date.now(),
|
|
80
|
-
jsonSchema: async () => TimestampMillisecondsSchema,
|
|
81
|
-
validate: async (propertyName, value, failures, container) => Validation.timestampMilliseconds(propertyName, value, failures)
|
|
82
|
-
}));
|
|
83
|
-
DataTypeHandlerFactory.register(`${FrameworkContexts.ContextRoot}${FrameworkTypes.TimestampSeconds}`, () => ({
|
|
84
|
-
context: FrameworkContexts.ContextRoot,
|
|
85
|
-
type: FrameworkTypes.TimestampSeconds,
|
|
86
|
-
defaultValue: Math.floor(Date.now() / 1000),
|
|
87
|
-
jsonSchema: async () => TimestampSecondsSchema,
|
|
88
|
-
validate: async (propertyName, value, failures, container) => Validation.timestampSeconds(propertyName, value, failures)
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export { FrameworkContexts, FrameworkDataTypes, FrameworkTypes };
|