@twin.org/attestation-models 0.0.1-next.27 → 0.0.1-next.28

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.
@@ -3,6 +3,23 @@
3
3
  var dataCore = require('@twin.org/data-core');
4
4
  var core = require('@twin.org/core');
5
5
 
6
+ // Copyright 2024 IOTA Stiftung.
7
+ // SPDX-License-Identifier: Apache-2.0.
8
+ /**
9
+ * The contexts of attestation data.
10
+ */
11
+ // eslint-disable-next-line @typescript-eslint/naming-convention
12
+ const AttestationContexts = {
13
+ /**
14
+ * The context root for the attestation types.
15
+ */
16
+ ContextRoot: "https://schema.twindev.org/attestation/",
17
+ /**
18
+ * The context root for the common types.
19
+ */
20
+ ContextRootCommon: "https://schema.twindev.org/common/"
21
+ };
22
+
6
23
  // Copyright 2024 IOTA Stiftung.
7
24
  // SPDX-License-Identifier: Apache-2.0.
8
25
  /**
@@ -163,12 +180,14 @@ class AttestationDataTypes {
163
180
  * Register all the data types.
164
181
  */
165
182
  static registerTypes() {
166
- dataCore.DataTypeHandlerFactory.register(AttestationTypes.Information, () => ({
183
+ dataCore.DataTypeHandlerFactory.register(`${AttestationContexts.ContextRoot}${AttestationTypes.Information}`, () => ({
184
+ context: AttestationContexts.ContextRoot,
167
185
  type: AttestationTypes.Information,
168
186
  defaultValue: {},
169
187
  jsonSchema: async () => AttestationInformationSchema
170
188
  }));
171
- dataCore.DataTypeHandlerFactory.register(AttestationTypes.JwtProof, () => ({
189
+ dataCore.DataTypeHandlerFactory.register(`${AttestationContexts.ContextRoot}${AttestationTypes.JwtProof}`, () => ({
190
+ context: AttestationContexts.ContextRoot,
172
191
  type: AttestationTypes.JwtProof,
173
192
  defaultValue: {},
174
193
  jsonSchema: async () => AttestationJwtProofSchema
@@ -184,23 +203,6 @@ class AttestationDataTypes {
184
203
  // eslint-disable-next-line @typescript-eslint/naming-convention
185
204
  const AttestationConnectorFactory = core.Factory.createFactory("attestation");
186
205
 
187
- // Copyright 2024 IOTA Stiftung.
188
- // SPDX-License-Identifier: Apache-2.0.
189
- /**
190
- * The contexts of attestation data.
191
- */
192
- // eslint-disable-next-line @typescript-eslint/naming-convention
193
- const AttestationContexts = {
194
- /**
195
- * The context root for the attestation types.
196
- */
197
- ContextRoot: "https://schema.twindev.org/attestation/",
198
- /**
199
- * The context root for the common types.
200
- */
201
- ContextRootCommon: "https://schema.twindev.org/common/"
202
- };
203
-
204
206
  exports.AttestationConnectorFactory = AttestationConnectorFactory;
205
207
  exports.AttestationContexts = AttestationContexts;
206
208
  exports.AttestationDataTypes = AttestationDataTypes;
@@ -1,6 +1,23 @@
1
1
  import { DataTypeHandlerFactory } from '@twin.org/data-core';
2
2
  import { Factory } from '@twin.org/core';
3
3
 
4
+ // Copyright 2024 IOTA Stiftung.
5
+ // SPDX-License-Identifier: Apache-2.0.
6
+ /**
7
+ * The contexts of attestation data.
8
+ */
9
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10
+ const AttestationContexts = {
11
+ /**
12
+ * The context root for the attestation types.
13
+ */
14
+ ContextRoot: "https://schema.twindev.org/attestation/",
15
+ /**
16
+ * The context root for the common types.
17
+ */
18
+ ContextRootCommon: "https://schema.twindev.org/common/"
19
+ };
20
+
4
21
  // Copyright 2024 IOTA Stiftung.
5
22
  // SPDX-License-Identifier: Apache-2.0.
6
23
  /**
@@ -161,12 +178,14 @@ class AttestationDataTypes {
161
178
  * Register all the data types.
162
179
  */
163
180
  static registerTypes() {
164
- DataTypeHandlerFactory.register(AttestationTypes.Information, () => ({
181
+ DataTypeHandlerFactory.register(`${AttestationContexts.ContextRoot}${AttestationTypes.Information}`, () => ({
182
+ context: AttestationContexts.ContextRoot,
165
183
  type: AttestationTypes.Information,
166
184
  defaultValue: {},
167
185
  jsonSchema: async () => AttestationInformationSchema
168
186
  }));
169
- DataTypeHandlerFactory.register(AttestationTypes.JwtProof, () => ({
187
+ DataTypeHandlerFactory.register(`${AttestationContexts.ContextRoot}${AttestationTypes.JwtProof}`, () => ({
188
+ context: AttestationContexts.ContextRoot,
170
189
  type: AttestationTypes.JwtProof,
171
190
  defaultValue: {},
172
191
  jsonSchema: async () => AttestationJwtProofSchema
@@ -182,21 +201,4 @@ class AttestationDataTypes {
182
201
  // eslint-disable-next-line @typescript-eslint/naming-convention
183
202
  const AttestationConnectorFactory = Factory.createFactory("attestation");
184
203
 
185
- // Copyright 2024 IOTA Stiftung.
186
- // SPDX-License-Identifier: Apache-2.0.
187
- /**
188
- * The contexts of attestation data.
189
- */
190
- // eslint-disable-next-line @typescript-eslint/naming-convention
191
- const AttestationContexts = {
192
- /**
193
- * The context root for the attestation types.
194
- */
195
- ContextRoot: "https://schema.twindev.org/attestation/",
196
- /**
197
- * The context root for the common types.
198
- */
199
- ContextRootCommon: "https://schema.twindev.org/common/"
200
- };
201
-
202
204
  export { AttestationConnectorFactory, AttestationContexts, AttestationDataTypes, AttestationTypes };
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @twin.org/attestation-models - Changelog
2
2
 
3
+ ## [0.0.1-next.28](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.1-next.27...attestation-models-v0.0.1-next.28) (2025-05-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * update data type registration with fully qualified names ([5982245](https://github.com/twinfoundation/attestation/commit/59822454a027a9c6dfa72ffa9aabb9622b925929))
9
+
3
10
  ## [0.0.1-next.27](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.1-next.26...attestation-models-v0.0.1-next.27) (2025-05-06)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/attestation-models",
3
- "version": "0.0.1-next.27",
3
+ "version": "0.0.1-next.28",
4
4
  "description": "Models which define the structure of the attestation connectors and services",
5
5
  "repository": {
6
6
  "type": "git",