@twin.org/data-framework 0.0.1-next.12 → 0.0.1-next.14

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.
@@ -17,15 +17,15 @@ const FrameworkTypes = {
17
17
  /**
18
18
  * Represents a urn.
19
19
  */
20
- Urn: "https://schema.twindev.org/framework/URN",
20
+ Urn: "URN",
21
21
  /**
22
22
  * Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
23
23
  */
24
- TimestampMilliseconds: "https://schema.twindev.org/framework/TimestampMilliseconds",
24
+ TimestampMilliseconds: "TimestampMilliseconds",
25
25
  /**
26
26
  * Represents a timestamp as an integer, seconds since 1 Jan 1970.
27
27
  */
28
- TimestampSeconds: "https://schema.twindev.org/framework/TimestampSeconds"
28
+ TimestampSeconds: "TimestampSeconds"
29
29
  };
30
30
 
31
31
  var type$2 = "integer";
@@ -59,19 +59,19 @@ class FrameworkDataTypes {
59
59
  * Register all the data types.
60
60
  */
61
61
  static registerTypes() {
62
- dataCore.DataTypeHandlerFactory.register(FrameworkTypes.Urn, () => ({
62
+ dataCore.DataTypeHandlerFactory.register(`${FrameworkTypes.ContextRoot}${FrameworkTypes.Urn}`, () => ({
63
63
  type: FrameworkTypes.Urn,
64
64
  defaultValue: "",
65
65
  jsonSchema: async () => URNSchema,
66
66
  validate: async (propertyName, value, failures, container) => core.Urn.validate(propertyName, value, failures)
67
67
  }));
68
- dataCore.DataTypeHandlerFactory.register(FrameworkTypes.TimestampMilliseconds, () => ({
68
+ dataCore.DataTypeHandlerFactory.register(`${FrameworkTypes.ContextRoot}${FrameworkTypes.TimestampMilliseconds}`, () => ({
69
69
  type: FrameworkTypes.TimestampMilliseconds,
70
70
  defaultValue: Date.now(),
71
71
  jsonSchema: async () => TimestampMillisecondsSchema,
72
72
  validate: async (propertyName, value, failures, container) => core.Validation.timestampMilliseconds(propertyName, value, failures)
73
73
  }));
74
- dataCore.DataTypeHandlerFactory.register(FrameworkTypes.TimestampSeconds, () => ({
74
+ dataCore.DataTypeHandlerFactory.register(`${FrameworkTypes.ContextRoot}${FrameworkTypes.TimestampSeconds}`, () => ({
75
75
  type: FrameworkTypes.TimestampSeconds,
76
76
  defaultValue: Math.floor(Date.now() / 1000),
77
77
  jsonSchema: async () => TimestampSecondsSchema,
@@ -15,15 +15,15 @@ const FrameworkTypes = {
15
15
  /**
16
16
  * Represents a urn.
17
17
  */
18
- Urn: "https://schema.twindev.org/framework/URN",
18
+ Urn: "URN",
19
19
  /**
20
20
  * Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
21
21
  */
22
- TimestampMilliseconds: "https://schema.twindev.org/framework/TimestampMilliseconds",
22
+ TimestampMilliseconds: "TimestampMilliseconds",
23
23
  /**
24
24
  * Represents a timestamp as an integer, seconds since 1 Jan 1970.
25
25
  */
26
- TimestampSeconds: "https://schema.twindev.org/framework/TimestampSeconds"
26
+ TimestampSeconds: "TimestampSeconds"
27
27
  };
28
28
 
29
29
  var type$2 = "integer";
@@ -57,19 +57,19 @@ class FrameworkDataTypes {
57
57
  * Register all the data types.
58
58
  */
59
59
  static registerTypes() {
60
- DataTypeHandlerFactory.register(FrameworkTypes.Urn, () => ({
60
+ DataTypeHandlerFactory.register(`${FrameworkTypes.ContextRoot}${FrameworkTypes.Urn}`, () => ({
61
61
  type: FrameworkTypes.Urn,
62
62
  defaultValue: "",
63
63
  jsonSchema: async () => URNSchema,
64
64
  validate: async (propertyName, value, failures, container) => Urn.validate(propertyName, value, failures)
65
65
  }));
66
- DataTypeHandlerFactory.register(FrameworkTypes.TimestampMilliseconds, () => ({
66
+ DataTypeHandlerFactory.register(`${FrameworkTypes.ContextRoot}${FrameworkTypes.TimestampMilliseconds}`, () => ({
67
67
  type: FrameworkTypes.TimestampMilliseconds,
68
68
  defaultValue: Date.now(),
69
69
  jsonSchema: async () => TimestampMillisecondsSchema,
70
70
  validate: async (propertyName, value, failures, container) => Validation.timestampMilliseconds(propertyName, value, failures)
71
71
  }));
72
- DataTypeHandlerFactory.register(FrameworkTypes.TimestampSeconds, () => ({
72
+ DataTypeHandlerFactory.register(`${FrameworkTypes.ContextRoot}${FrameworkTypes.TimestampSeconds}`, () => ({
73
73
  type: FrameworkTypes.TimestampSeconds,
74
74
  defaultValue: Math.floor(Date.now() / 1000),
75
75
  jsonSchema: async () => TimestampSecondsSchema,
@@ -9,15 +9,15 @@ export declare const FrameworkTypes: {
9
9
  /**
10
10
  * Represents a urn.
11
11
  */
12
- readonly Urn: "https://schema.twindev.org/framework/URN";
12
+ readonly Urn: "URN";
13
13
  /**
14
14
  * Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
15
15
  */
16
- readonly TimestampMilliseconds: "https://schema.twindev.org/framework/TimestampMilliseconds";
16
+ readonly TimestampMilliseconds: "TimestampMilliseconds";
17
17
  /**
18
18
  * Represents a timestamp as an integer, seconds since 1 Jan 1970.
19
19
  */
20
- readonly TimestampSeconds: "https://schema.twindev.org/framework/TimestampSeconds";
20
+ readonly TimestampSeconds: "TimestampSeconds";
21
21
  };
22
22
  /**
23
23
  * The types of framework data.
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/data-framework - Changelog
2
2
 
3
- ## v0.0.1-next.12
3
+ ## v0.0.1-next.14
4
4
 
5
5
  - Initial Release
@@ -14,18 +14,18 @@ Context Root.
14
14
 
15
15
  ### Urn
16
16
 
17
- > `readonly` **Urn**: `"https://schema.twindev.org/framework/URN"` = `"https://schema.twindev.org/framework/URN"`
17
+ > `readonly` **Urn**: `"URN"` = `"URN"`
18
18
 
19
19
  Represents a urn.
20
20
 
21
21
  ### TimestampMilliseconds
22
22
 
23
- > `readonly` **TimestampMilliseconds**: `"https://schema.twindev.org/framework/TimestampMilliseconds"` = `"https://schema.twindev.org/framework/TimestampMilliseconds"`
23
+ > `readonly` **TimestampMilliseconds**: `"TimestampMilliseconds"` = `"TimestampMilliseconds"`
24
24
 
25
25
  Represents a timestamp as an integer, milliseconds since 1 Jan 1970.
26
26
 
27
27
  ### TimestampSeconds
28
28
 
29
- > `readonly` **TimestampSeconds**: `"https://schema.twindev.org/framework/TimestampSeconds"` = `"https://schema.twindev.org/framework/TimestampSeconds"`
29
+ > `readonly` **TimestampSeconds**: `"TimestampSeconds"` = `"TimestampSeconds"`
30
30
 
31
31
  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.12",
3
+ "version": "0.0.1-next.14",
4
4
  "description": "Models which define the structure of framework types",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
- "@twin.org/data-core": "0.0.1-next.12",
19
- "@twin.org/data-json-ld": "0.0.1-next.12",
18
+ "@twin.org/data-core": "0.0.1-next.14",
19
+ "@twin.org/data-json-ld": "0.0.1-next.14",
20
20
  "@twin.org/entity": "next",
21
21
  "@twin.org/nameof": "next",
22
22
  "@types/json-schema": "7.0.15"
@@ -30,7 +30,7 @@
30
30
  "import": "./dist/esm/index.mjs",
31
31
  "types": "./dist/types/index.d.ts"
32
32
  },
33
- "./locales": "./locales"
33
+ "./locales/*.json": "./locales/*.json"
34
34
  },
35
35
  "files": [
36
36
  "dist/cjs",