@twin.org/attestation-models 0.0.3-next.1 → 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.
Files changed (27) hide show
  1. package/README.md +1 -1
  2. package/dist/es/dataTypes/attestationDataTypes.js +4 -4
  3. package/dist/es/dataTypes/attestationDataTypes.js.map +1 -1
  4. package/dist/es/models/IAttestationInformation.js.map +1 -1
  5. package/dist/es/models/IAttestationJwtProof.js.map +1 -1
  6. package/dist/es/models/attestationContexts.js +20 -4
  7. package/dist/es/models/attestationContexts.js.map +1 -1
  8. package/dist/es/schemas/AttestationInformation.json +8 -12
  9. package/dist/es/schemas/AttestationJwtProof.json +4 -7
  10. package/dist/types/models/IAttestationInformation.d.ts +11 -3
  11. package/dist/types/models/IAttestationJwtProof.d.ts +2 -1
  12. package/dist/types/models/attestationContexts.d.ts +20 -4
  13. package/docs/changelog.md +101 -37
  14. package/docs/examples.md +12 -1
  15. package/docs/reference/classes/AttestationDataTypes.md +1 -1
  16. package/docs/reference/interfaces/IAttestationComponent.md +4 -4
  17. package/docs/reference/interfaces/IAttestationConnector.md +4 -4
  18. package/docs/reference/interfaces/IAttestationCreateRequest.md +2 -2
  19. package/docs/reference/interfaces/IAttestationDestroyRequest.md +1 -1
  20. package/docs/reference/interfaces/IAttestationGetRequest.md +3 -3
  21. package/docs/reference/interfaces/IAttestationGetResponse.md +3 -3
  22. package/docs/reference/interfaces/IAttestationInformation.md +17 -17
  23. package/docs/reference/interfaces/IAttestationJwtProof.md +3 -3
  24. package/docs/reference/interfaces/IAttestationTransferRequest.md +2 -2
  25. package/docs/reference/variables/AttestationContexts.md +30 -6
  26. package/docs/reference/variables/AttestationTypes.md +2 -2
  27. package/package.json +4 -4
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TWIN Attestation Models
2
2
 
3
- Models which define the structure of the attestation contracts and connectors.
3
+ Shared models and data types for attestation connectors and services.
4
4
 
5
5
  ## Installation
6
6
 
@@ -13,14 +13,14 @@ export class AttestationDataTypes {
13
13
  * Register all the data types.
14
14
  */
15
15
  static registerTypes() {
16
- DataTypeHandlerFactory.register(`${AttestationContexts.ContextRoot}${AttestationTypes.Information}`, () => ({
17
- context: AttestationContexts.ContextRoot,
16
+ DataTypeHandlerFactory.register(`${AttestationContexts.Namespace}${AttestationTypes.Information}`, () => ({
17
+ namespace: AttestationContexts.Namespace,
18
18
  type: AttestationTypes.Information,
19
19
  defaultValue: {},
20
20
  jsonSchema: async () => AttestationInformationSchema
21
21
  }));
22
- DataTypeHandlerFactory.register(`${AttestationContexts.ContextRoot}${AttestationTypes.JwtProof}`, () => ({
23
- context: AttestationContexts.ContextRoot,
22
+ DataTypeHandlerFactory.register(`${AttestationContexts.Namespace}${AttestationTypes.JwtProof}`, () => ({
23
+ namespace: AttestationContexts.Namespace,
24
24
  type: AttestationTypes.JwtProof,
25
25
  defaultValue: {},
26
26
  jsonSchema: async () => AttestationJwtProofSchema
@@ -1 +1 @@
1
- {"version":3,"file":"attestationDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/attestationDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,4BAA4B,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxG,OAAO,yBAAyB,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAElG;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAChC;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,mBAAmB,CAAC,WAAW,GAAG,gBAAgB,CAAC,WAAW,EAAE,EACnE,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,mBAAmB,CAAC,WAAW;YACxC,IAAI,EAAE,gBAAgB,CAAC,WAAW;YAClC,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,4BAA2C;SACnE,CAAC,CACF,CAAC;QACF,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,mBAAmB,CAAC,WAAW,GAAG,gBAAgB,CAAC,QAAQ,EAAE,EAChE,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,mBAAmB,CAAC,WAAW;YACxC,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,yBAAwC;SAChE,CAAC,CACF,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory, type IJsonSchema } from \"@twin.org/data-core\";\nimport { AttestationContexts } from \"../models/attestationContexts.js\";\nimport { AttestationTypes } from \"../models/attestationTypes.js\";\nimport AttestationInformationSchema from \"../schemas/AttestationInformation.json\" with { type: \"json\" };\nimport AttestationJwtProofSchema from \"../schemas/AttestationJwtProof.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for attestation.\n */\nexport class AttestationDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${AttestationContexts.ContextRoot}${AttestationTypes.Information}`,\n\t\t\t() => ({\n\t\t\t\tcontext: AttestationContexts.ContextRoot,\n\t\t\t\ttype: AttestationTypes.Information,\n\t\t\t\tdefaultValue: {},\n\t\t\t\tjsonSchema: async () => AttestationInformationSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${AttestationContexts.ContextRoot}${AttestationTypes.JwtProof}`,\n\t\t\t() => ({\n\t\t\t\tcontext: AttestationContexts.ContextRoot,\n\t\t\t\ttype: AttestationTypes.JwtProof,\n\t\t\t\tdefaultValue: {},\n\t\t\t\tjsonSchema: async () => AttestationJwtProofSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"attestationDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/attestationDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,4BAA4B,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxG,OAAO,yBAAyB,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAElG;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAChC;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,mBAAmB,CAAC,SAAS,GAAG,gBAAgB,CAAC,WAAW,EAAE,EACjE,GAAG,EAAE,CAAC,CAAC;YACN,SAAS,EAAE,mBAAmB,CAAC,SAAS;YACxC,IAAI,EAAE,gBAAgB,CAAC,WAAW;YAClC,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,4BAA4B;SACpD,CAAC,CACF,CAAC;QACF,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,mBAAmB,CAAC,SAAS,GAAG,gBAAgB,CAAC,QAAQ,EAAE,EAC9D,GAAG,EAAE,CAAC,CAAC;YACN,SAAS,EAAE,mBAAmB,CAAC,SAAS;YACxC,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,yBAAyB;SACjD,CAAC,CACF,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory } from \"@twin.org/data-core\";\nimport { AttestationContexts } from \"../models/attestationContexts.js\";\nimport { AttestationTypes } from \"../models/attestationTypes.js\";\nimport AttestationInformationSchema from \"../schemas/AttestationInformation.json\" with { type: \"json\" };\nimport AttestationJwtProofSchema from \"../schemas/AttestationJwtProof.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for attestation.\n */\nexport class AttestationDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${AttestationContexts.Namespace}${AttestationTypes.Information}`,\n\t\t\t() => ({\n\t\t\t\tnamespace: AttestationContexts.Namespace,\n\t\t\t\ttype: AttestationTypes.Information,\n\t\t\t\tdefaultValue: {},\n\t\t\t\tjsonSchema: async () => AttestationInformationSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${AttestationContexts.Namespace}${AttestationTypes.JwtProof}`,\n\t\t\t() => ({\n\t\t\t\tnamespace: AttestationContexts.Namespace,\n\t\t\t\ttype: AttestationTypes.JwtProof,\n\t\t\t\tdefaultValue: {},\n\t\t\t\tjsonSchema: async () => AttestationJwtProofSchema\n\t\t\t})\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IAttestationInformation.js","sourceRoot":"","sources":["../../../src/models/IAttestationInformation.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts } from \"@twin.org/standards-schema-org\";\nimport type { AttestationContexts } from \"./attestationContexts.js\";\nimport type { AttestationTypes } from \"./attestationTypes.js\";\n\n/**\n * Interface describing the collated attestation information.\n */\nexport interface IAttestationInformation {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof AttestationContexts.ContextRoot,\n\t\ttypeof AttestationContexts.ContextRootCommon,\n\t\ttypeof SchemaOrgContexts.ContextRoot,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof AttestationTypes.Information;\n\n\t/**\n\t * The unique identifier of the attestation.\n\t */\n\tid: string;\n\n\t/**\n\t * Created date/time of the attestation in ISO format.\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * Transferred date/time of the attestation in ISO format, can be blank if holder identity is owner.\n\t */\n\tdateTransferred?: string;\n\n\t/**\n\t * The identity of the owner.\n\t */\n\townerIdentity: string;\n\n\t/**\n\t * The identity of the current holder, can be undefined if owner is still the holder.\n\t */\n\tholderIdentity?: string;\n\n\t/**\n\t * The data that was attested.\n\t */\n\tattestationObject: IJsonLdNodeObject;\n\n\t/**\n\t * The proof for the attested data.\n\t */\n\tproof?: IJsonLdNodeObject;\n\n\t/**\n\t * Whether the attestation has been verified.\n\t */\n\tverified?: boolean;\n\n\t/**\n\t * The verification failure message.\n\t */\n\tverificationFailure?: string;\n}\n"]}
1
+ {"version":3,"file":"IAttestationInformation.js","sourceRoot":"","sources":["../../../src/models/IAttestationInformation.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts } from \"@twin.org/standards-schema-org\";\nimport type { AttestationContexts } from \"./attestationContexts.js\";\nimport type { AttestationTypes } from \"./attestationTypes.js\";\n\n/**\n * Interface describing the collated attestation information.\n */\nexport interface IAttestationInformation {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof SchemaOrgContexts.Context,\n\t\ttypeof AttestationContexts.Context,\n\t\ttypeof AttestationContexts.ContextCommon,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof AttestationTypes.Information;\n\n\t/**\n\t * The unique identifier of the attestation.\n\t */\n\tid: string;\n\n\t/**\n\t * Created date/time of the attestation in ISO format.\n\t * @json-ld namespace:schema\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * Transferred date/time of the attestation in ISO format, can be blank if holder identity is owner.\n\t * @json-ld type:schema:Date\n\t */\n\tdateTransferred?: string;\n\n\t/**\n\t * The identity of the owner.\n\t * @json-ld type:schema:identifier\n\t */\n\townerIdentity: string;\n\n\t/**\n\t * The identity of the current holder, can be undefined if owner is still the holder.\n\t * @json-ld type:schema:identifier\n\t */\n\tholderIdentity?: string;\n\n\t/**\n\t * The data that was attested.\n\t * @json-ld namespace:twin-common\n\t */\n\tattestationObject: IJsonLdNodeObject;\n\n\t/**\n\t * The proof for the attested data.\n\t * @json-ld namespace:twin-attestation\n\t */\n\tproof?: IJsonLdNodeObject;\n\n\t/**\n\t * Whether the attestation has been verified.\n\t * @json-ld namespace:twin-common\n\t */\n\tverified?: boolean;\n\n\t/**\n\t * The verification failure message.\n\t * @json-ld type:schema:Text\n\t */\n\tverificationFailure?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IAttestationJwtProof.js","sourceRoot":"","sources":["../../../src/models/IAttestationJwtProof.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { AttestationContexts } from \"./attestationContexts.js\";\nimport type { AttestationTypes } from \"./attestationTypes.js\";\n\n/**\n * Interface describing an attestation proof.\n */\nexport interface IAttestationJwtProof {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\":\n\t\t| typeof AttestationContexts.ContextRoot\n\t\t| [typeof AttestationContexts.ContextRoot, ...IJsonLdContextDefinitionElement[]];\n\n\t/**\n\t * The type of the proof.\n\t */\n\ttype: typeof AttestationTypes.JwtProof;\n\n\t/**\n\t * The value of the proof.\n\t */\n\tvalue: string;\n}\n"]}
1
+ {"version":3,"file":"IAttestationJwtProof.js","sourceRoot":"","sources":["../../../src/models/IAttestationJwtProof.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { AttestationContexts } from \"./attestationContexts.js\";\nimport type { AttestationTypes } from \"./attestationTypes.js\";\n\n/**\n * Interface describing an attestation proof.\n */\nexport interface IAttestationJwtProof {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\":\n\t\t| typeof AttestationContexts.Context\n\t\t| [typeof AttestationContexts.Context, ...IJsonLdContextDefinitionElement[]];\n\n\t/**\n\t * The type of the proof.\n\t */\n\ttype: typeof AttestationTypes.JwtProof;\n\n\t/**\n\t * The value of the proof.\n\t * @json-ld type:schema:Text\n\t */\n\tvalue: string;\n}\n"]}
@@ -6,12 +6,28 @@
6
6
  // eslint-disable-next-line @typescript-eslint/naming-convention
7
7
  export const AttestationContexts = {
8
8
  /**
9
- * The context root for the attestation types.
9
+ * The canonical RDF namespace URI for Attestation.
10
10
  */
11
- ContextRoot: "https://schema.twindev.org/attestation/",
11
+ Namespace: "https://schema.twindev.org/attestation/",
12
12
  /**
13
- * The context root for the common types.
13
+ * The value to use in context for Attestation.
14
14
  */
15
- ContextRootCommon: "https://schema.twindev.org/common/"
15
+ Context: "https://schema.twindev.org/attestation/",
16
+ /**
17
+ * The JSON-LD Context URL for Attestation.
18
+ */
19
+ JsonLdContext: "https://schema.twindev.org/attestation/types.jsonld",
20
+ /**
21
+ * The canonical RDF namespace URI for TWIN Common.
22
+ */
23
+ NamespaceCommon: "https://schema.twindev.org/common/",
24
+ /**
25
+ * The value to use in JSON-LD context for TWIN Common.
26
+ */
27
+ ContextCommon: "https://schema.twindev.org/common/",
28
+ /**
29
+ * The JSON-LD Context URL for TWIN Common.
30
+ */
31
+ JsonLdContextCommon: "https://schema.twindev.org/common/types.jsonld"
16
32
  };
17
33
  //# sourceMappingURL=attestationContexts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attestationContexts.js","sourceRoot":"","sources":["../../../src/models/attestationContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC;;OAEG;IACH,WAAW,EAAE,yCAAyC;IAEtD;;OAEG;IACH,iBAAiB,EAAE,oCAAoC;CAC9C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of attestation data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AttestationContexts = {\n\t/**\n\t * The context root for the attestation types.\n\t */\n\tContextRoot: \"https://schema.twindev.org/attestation/\",\n\n\t/**\n\t * The context root for the common types.\n\t */\n\tContextRootCommon: \"https://schema.twindev.org/common/\"\n} as const;\n\n/**\n * The contexts of attestation data.\n */\nexport type AttestationContexts = (typeof AttestationContexts)[keyof typeof AttestationContexts];\n"]}
1
+ {"version":3,"file":"attestationContexts.js","sourceRoot":"","sources":["../../../src/models/attestationContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC;;OAEG;IACH,SAAS,EAAE,yCAAyC;IAEpD;;OAEG;IACH,OAAO,EAAE,yCAAyC;IAElD;;OAEG;IACH,aAAa,EAAE,qDAAqD;IAEpE;;OAEG;IACH,eAAe,EAAE,oCAAoC;IAErD;;OAEG;IACH,aAAa,EAAE,oCAAoC;IAEnD;;OAEG;IACH,mBAAmB,EAAE,gDAAgD;CAC5D,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of attestation data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AttestationContexts = {\n\t/**\n\t * The canonical RDF namespace URI for Attestation.\n\t */\n\tNamespace: \"https://schema.twindev.org/attestation/\",\n\n\t/**\n\t * The value to use in context for Attestation.\n\t */\n\tContext: \"https://schema.twindev.org/attestation/\",\n\n\t/**\n\t * The JSON-LD Context URL for Attestation.\n\t */\n\tJsonLdContext: \"https://schema.twindev.org/attestation/types.jsonld\",\n\n\t/**\n\t * The canonical RDF namespace URI for TWIN Common.\n\t */\n\tNamespaceCommon: \"https://schema.twindev.org/common/\",\n\n\t/**\n\t * The value to use in JSON-LD context for TWIN Common.\n\t */\n\tContextCommon: \"https://schema.twindev.org/common/\",\n\n\t/**\n\t * The JSON-LD Context URL for TWIN Common.\n\t */\n\tJsonLdContextCommon: \"https://schema.twindev.org/common/types.jsonld\"\n} as const;\n\n/**\n * The contexts of attestation data.\n */\nexport type AttestationContexts = (typeof AttestationContexts)[keyof typeof AttestationContexts];\n"]}
@@ -1,33 +1,30 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schema.twindev.org/attestation/AttestationInformation",
4
+ "title": "AttestationInformation",
4
5
  "description": "Interface describing the collated attestation information.",
5
6
  "type": "object",
6
7
  "properties": {
7
8
  "@context": {
8
9
  "type": "array",
9
- "minItems": 3,
10
- "description": "JSON-LD Context.",
11
10
  "prefixItems": [
12
11
  {
13
- "type": "string",
14
- "const": "https://schema.twindev.org/attestation/"
12
+ "const": "https://schema.org"
15
13
  },
16
14
  {
17
- "type": "string",
18
- "const": "https://schema.twindev.org/common/"
15
+ "const": "https://schema.twindev.org/attestation/"
19
16
  },
20
17
  {
21
- "type": "string",
22
- "const": "https://schema.org"
18
+ "const": "https://schema.twindev.org/common/"
23
19
  }
24
20
  ],
25
21
  "items": {
26
22
  "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
27
- }
23
+ },
24
+ "minItems": 3,
25
+ "description": "JSON-LD Context."
28
26
  },
29
27
  "type": {
30
- "type": "string",
31
28
  "const": "Information",
32
29
  "description": "JSON-LD Type."
33
30
  },
@@ -75,6 +72,5 @@
75
72
  "dateCreated",
76
73
  "ownerIdentity",
77
74
  "attestationObject"
78
- ],
79
- "additionalProperties": false
75
+ ]
80
76
  }
@@ -1,33 +1,31 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schema.twindev.org/attestation/AttestationJwtProof",
4
+ "title": "AttestationJwtProof",
4
5
  "description": "Interface describing an attestation proof.",
5
6
  "type": "object",
6
7
  "properties": {
7
8
  "@context": {
8
9
  "anyOf": [
9
10
  {
10
- "type": "string",
11
11
  "const": "https://schema.twindev.org/attestation/"
12
12
  },
13
13
  {
14
14
  "type": "array",
15
- "minItems": 1,
16
15
  "prefixItems": [
17
16
  {
18
- "type": "string",
19
17
  "const": "https://schema.twindev.org/attestation/"
20
18
  }
21
19
  ],
22
20
  "items": {
23
21
  "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
24
- }
22
+ },
23
+ "minItems": 1
25
24
  }
26
25
  ],
27
26
  "description": "JSON-LD Context."
28
27
  },
29
28
  "type": {
30
- "type": "string",
31
29
  "const": "JwtProof",
32
30
  "description": "The type of the proof."
33
31
  },
@@ -40,6 +38,5 @@
40
38
  "@context",
41
39
  "type",
42
40
  "value"
43
- ],
44
- "additionalProperties": false
41
+ ]
45
42
  }
@@ -10,9 +10,9 @@ export interface IAttestationInformation {
10
10
  * JSON-LD Context.
11
11
  */
12
12
  "@context": [
13
- typeof AttestationContexts.ContextRoot,
14
- typeof AttestationContexts.ContextRootCommon,
15
- typeof SchemaOrgContexts.ContextRoot,
13
+ typeof SchemaOrgContexts.Context,
14
+ typeof AttestationContexts.Context,
15
+ typeof AttestationContexts.ContextCommon,
16
16
  ...IJsonLdContextDefinitionElement[]
17
17
  ];
18
18
  /**
@@ -25,34 +25,42 @@ export interface IAttestationInformation {
25
25
  id: string;
26
26
  /**
27
27
  * Created date/time of the attestation in ISO format.
28
+ * @json-ld namespace:schema
28
29
  */
29
30
  dateCreated: string;
30
31
  /**
31
32
  * Transferred date/time of the attestation in ISO format, can be blank if holder identity is owner.
33
+ * @json-ld type:schema:Date
32
34
  */
33
35
  dateTransferred?: string;
34
36
  /**
35
37
  * The identity of the owner.
38
+ * @json-ld type:schema:identifier
36
39
  */
37
40
  ownerIdentity: string;
38
41
  /**
39
42
  * The identity of the current holder, can be undefined if owner is still the holder.
43
+ * @json-ld type:schema:identifier
40
44
  */
41
45
  holderIdentity?: string;
42
46
  /**
43
47
  * The data that was attested.
48
+ * @json-ld namespace:twin-common
44
49
  */
45
50
  attestationObject: IJsonLdNodeObject;
46
51
  /**
47
52
  * The proof for the attested data.
53
+ * @json-ld namespace:twin-attestation
48
54
  */
49
55
  proof?: IJsonLdNodeObject;
50
56
  /**
51
57
  * Whether the attestation has been verified.
58
+ * @json-ld namespace:twin-common
52
59
  */
53
60
  verified?: boolean;
54
61
  /**
55
62
  * The verification failure message.
63
+ * @json-ld type:schema:Text
56
64
  */
57
65
  verificationFailure?: string;
58
66
  }
@@ -8,13 +8,14 @@ export interface IAttestationJwtProof {
8
8
  /**
9
9
  * JSON-LD Context.
10
10
  */
11
- "@context": typeof AttestationContexts.ContextRoot | [typeof AttestationContexts.ContextRoot, ...IJsonLdContextDefinitionElement[]];
11
+ "@context": typeof AttestationContexts.Context | [typeof AttestationContexts.Context, ...IJsonLdContextDefinitionElement[]];
12
12
  /**
13
13
  * The type of the proof.
14
14
  */
15
15
  type: typeof AttestationTypes.JwtProof;
16
16
  /**
17
17
  * The value of the proof.
18
+ * @json-ld type:schema:Text
18
19
  */
19
20
  value: string;
20
21
  }
@@ -3,13 +3,29 @@
3
3
  */
4
4
  export declare const AttestationContexts: {
5
5
  /**
6
- * The context root for the attestation types.
6
+ * The canonical RDF namespace URI for Attestation.
7
7
  */
8
- readonly ContextRoot: "https://schema.twindev.org/attestation/";
8
+ readonly Namespace: "https://schema.twindev.org/attestation/";
9
9
  /**
10
- * The context root for the common types.
10
+ * The value to use in context for Attestation.
11
11
  */
12
- readonly ContextRootCommon: "https://schema.twindev.org/common/";
12
+ readonly Context: "https://schema.twindev.org/attestation/";
13
+ /**
14
+ * The JSON-LD Context URL for Attestation.
15
+ */
16
+ readonly JsonLdContext: "https://schema.twindev.org/attestation/types.jsonld";
17
+ /**
18
+ * The canonical RDF namespace URI for TWIN Common.
19
+ */
20
+ readonly NamespaceCommon: "https://schema.twindev.org/common/";
21
+ /**
22
+ * The value to use in JSON-LD context for TWIN Common.
23
+ */
24
+ readonly ContextCommon: "https://schema.twindev.org/common/";
25
+ /**
26
+ * The JSON-LD Context URL for TWIN Common.
27
+ */
28
+ readonly JsonLdContextCommon: "https://schema.twindev.org/common/types.jsonld";
13
29
  };
14
30
  /**
15
31
  * The contexts of attestation data.
package/docs/changelog.md CHANGED
@@ -1,99 +1,163 @@
1
- # @twin.org/attestation-models - Changelog
1
+ # Changelog
2
2
 
3
- ## [0.0.3-next.1](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.3-next.0...attestation-models-v0.0.3-next.1) (2025-11-12)
3
+ ## [0.0.3-next.10](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.9...attestation-models-v0.0.3-next.10) (2026-05-20)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **attestation-models:** Synchronize repo versions
9
+
10
+ ## [0.0.3-next.9](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.8...attestation-models-v0.0.3-next.9) (2026-05-12)
11
+
12
+
13
+ ### Features
14
+
15
+ * typescript 6 update ([9484667](https://github.com/iotaledger/twin-attestation/commit/948466713dc980e4b2d89e72ebb927b3fe530280))
16
+
17
+ ## [0.0.3-next.8](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.7...attestation-models-v0.0.3-next.8) (2026-04-27)
18
+
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **attestation-models:** Synchronize repo versions
23
+
24
+ ## [0.0.3-next.7](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.6...attestation-models-v0.0.3-next.7) (2026-02-25)
25
+
26
+
27
+ ### Features
28
+
29
+ * update schemas ([c163f36](https://github.com/iotaledger/twin-attestation/commit/c163f3623d54a0e87a97cf5eab25327b9aeac0fe))
30
+
31
+ ## [0.0.3-next.6](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.5...attestation-models-v0.0.3-next.6) (2026-02-11)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * correct context ordering ([c7cded2](https://github.com/iotaledger/twin-attestation/commit/c7cded248662b8b78ff41b19749bc182ff5105c0))
37
+
38
+ ## [0.0.3-next.5](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.4...attestation-models-v0.0.3-next.5) (2026-02-11)
39
+
40
+
41
+ ### Miscellaneous Chores
42
+
43
+ * **attestation-models:** Synchronize repo versions
44
+
45
+ ## [0.0.3-next.4](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.3...attestation-models-v0.0.3-next.4) (2026-02-11)
46
+
47
+
48
+ ### Features
49
+
50
+ * add ts-to-jsonld-context tool ([df7edd0](https://github.com/iotaledger/twin-attestation/commit/df7edd0d32cabc2b0f9f6dc7b216f569f739324d))
51
+ * remove unused schemas causing conflict ([#27](https://github.com/iotaledger/twin-attestation/issues/27)) ([9723bc3](https://github.com/iotaledger/twin-attestation/commit/9723bc3757f87ce8a943f5f091a92d258f867892))
52
+
53
+ ## [0.0.3-next.3](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.2...attestation-models-v0.0.3-next.3) (2026-01-21)
54
+
55
+
56
+ ### Features
57
+
58
+ * context updates ([#25](https://github.com/iotaledger/twin-attestation/issues/25)) ([1ea71b2](https://github.com/iotaledger/twin-attestation/commit/1ea71b28d874daef4d0bca594fb5dbf5f2a47571))
59
+
60
+ ## [0.0.3-next.2](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.1...attestation-models-v0.0.3-next.2) (2026-01-14)
61
+
62
+
63
+ ### Features
64
+
65
+ * update contexts and namespaces ([#23](https://github.com/iotaledger/twin-attestation/issues/23)) ([7e7ffb4](https://github.com/iotaledger/twin-attestation/commit/7e7ffb4056bfe296dd3cedcaa7a9bfb91fd830d7))
66
+
67
+ ## [0.0.3-next.1](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.3-next.0...attestation-models-v0.0.3-next.1) (2025-11-12)
4
68
 
5
69
 
6
70
  ### Features
7
71
 
8
- * add context id features ([#21](https://github.com/twinfoundation/attestation/issues/21)) ([640deab](https://github.com/twinfoundation/attestation/commit/640deabfc00340e619283f94570c5e1ec45e83af))
9
- * add validate-locales ([a1f9e13](https://github.com/twinfoundation/attestation/commit/a1f9e13875a661f612ce16dd9896e7df20c6a7ff))
10
- * eslint migration to flat config ([7c768ff](https://github.com/twinfoundation/attestation/commit/7c768ffae02456d60fd62ba8b4b488c307ceff32))
11
- * release to production ([aa69a08](https://github.com/twinfoundation/attestation/commit/aa69a08fbd3897c8d72b0d32ec730f104ad31b33))
12
- * release to production ([89ca987](https://github.com/twinfoundation/attestation/commit/89ca987963d9090abcfc1b62bc997e2c521944ec))
13
- * update data type registration with fully qualified names ([5982245](https://github.com/twinfoundation/attestation/commit/59822454a027a9c6dfa72ffa9aabb9622b925929))
14
- * update dependencies ([1d96d2e](https://github.com/twinfoundation/attestation/commit/1d96d2ee6e81a30396980f6f5e16e9658710d32d))
15
- * update framework core ([02326d4](https://github.com/twinfoundation/attestation/commit/02326d41238862c13587c19bb3d04c1cb3b606d8))
16
- * update ts-to-schema generation ([0f23298](https://github.com/twinfoundation/attestation/commit/0f23298f6e8accb19c0faaf74220cce02155b48a))
17
- * use shared store mechanism ([#5](https://github.com/twinfoundation/attestation/issues/5)) ([3768cf7](https://github.com/twinfoundation/attestation/commit/3768cf7214d30a5429b7b08190539b517d7fafa0))
72
+ * add context id features ([#21](https://github.com/iotaledger/twin-attestation/issues/21)) ([640deab](https://github.com/iotaledger/twin-attestation/commit/640deabfc00340e619283f94570c5e1ec45e83af))
73
+ * add validate-locales ([a1f9e13](https://github.com/iotaledger/twin-attestation/commit/a1f9e13875a661f612ce16dd9896e7df20c6a7ff))
74
+ * eslint migration to flat config ([7c768ff](https://github.com/iotaledger/twin-attestation/commit/7c768ffae02456d60fd62ba8b4b488c307ceff32))
75
+ * release to production ([aa69a08](https://github.com/iotaledger/twin-attestation/commit/aa69a08fbd3897c8d72b0d32ec730f104ad31b33))
76
+ * release to production ([89ca987](https://github.com/iotaledger/twin-attestation/commit/89ca987963d9090abcfc1b62bc997e2c521944ec))
77
+ * update data type registration with fully qualified names ([5982245](https://github.com/iotaledger/twin-attestation/commit/59822454a027a9c6dfa72ffa9aabb9622b925929))
78
+ * update dependencies ([1d96d2e](https://github.com/iotaledger/twin-attestation/commit/1d96d2ee6e81a30396980f6f5e16e9658710d32d))
79
+ * update framework core ([02326d4](https://github.com/iotaledger/twin-attestation/commit/02326d41238862c13587c19bb3d04c1cb3b606d8))
80
+ * update ts-to-schema generation ([0f23298](https://github.com/iotaledger/twin-attestation/commit/0f23298f6e8accb19c0faaf74220cce02155b48a))
81
+ * use shared store mechanism ([#5](https://github.com/iotaledger/twin-attestation/issues/5)) ([3768cf7](https://github.com/iotaledger/twin-attestation/commit/3768cf7214d30a5429b7b08190539b517d7fafa0))
18
82
 
19
- ## [0.0.2-next.4](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.2-next.3...attestation-models-v0.0.2-next.4) (2025-10-09)
83
+ ## [0.0.2-next.4](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.2-next.3...attestation-models-v0.0.2-next.4) (2025-10-09)
20
84
 
21
85
 
22
86
  ### Features
23
87
 
24
- * add validate-locales ([a1f9e13](https://github.com/twinfoundation/attestation/commit/a1f9e13875a661f612ce16dd9896e7df20c6a7ff))
88
+ * add validate-locales ([a1f9e13](https://github.com/iotaledger/twin-attestation/commit/a1f9e13875a661f612ce16dd9896e7df20c6a7ff))
25
89
 
26
- ## [0.0.2-next.3](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.2-next.2...attestation-models-v0.0.2-next.3) (2025-09-29)
90
+ ## [0.0.2-next.3](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.2-next.2...attestation-models-v0.0.2-next.3) (2025-09-29)
27
91
 
28
92
 
29
93
  ### Miscellaneous Chores
30
94
 
31
95
  * **attestation-models:** Synchronize repo versions
32
96
 
33
- ## [0.0.2-next.2](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.2-next.1...attestation-models-v0.0.2-next.2) (2025-08-29)
97
+ ## [0.0.2-next.2](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.2-next.1...attestation-models-v0.0.2-next.2) (2025-08-29)
34
98
 
35
99
 
36
100
  ### Features
37
101
 
38
- * eslint migration to flat config ([7c768ff](https://github.com/twinfoundation/attestation/commit/7c768ffae02456d60fd62ba8b4b488c307ceff32))
102
+ * eslint migration to flat config ([7c768ff](https://github.com/iotaledger/twin-attestation/commit/7c768ffae02456d60fd62ba8b4b488c307ceff32))
39
103
 
40
- ## [0.0.2-next.1](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.2-next.0...attestation-models-v0.0.2-next.1) (2025-08-20)
104
+ ## [0.0.2-next.1](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.2-next.0...attestation-models-v0.0.2-next.1) (2025-08-20)
41
105
 
42
106
 
43
107
  ### Features
44
108
 
45
- * release to production ([aa69a08](https://github.com/twinfoundation/attestation/commit/aa69a08fbd3897c8d72b0d32ec730f104ad31b33))
46
- * release to production ([89ca987](https://github.com/twinfoundation/attestation/commit/89ca987963d9090abcfc1b62bc997e2c521944ec))
47
- * update data type registration with fully qualified names ([5982245](https://github.com/twinfoundation/attestation/commit/59822454a027a9c6dfa72ffa9aabb9622b925929))
48
- * update dependencies ([1d96d2e](https://github.com/twinfoundation/attestation/commit/1d96d2ee6e81a30396980f6f5e16e9658710d32d))
49
- * update framework core ([02326d4](https://github.com/twinfoundation/attestation/commit/02326d41238862c13587c19bb3d04c1cb3b606d8))
50
- * update ts-to-schema generation ([0f23298](https://github.com/twinfoundation/attestation/commit/0f23298f6e8accb19c0faaf74220cce02155b48a))
51
- * use shared store mechanism ([#5](https://github.com/twinfoundation/attestation/issues/5)) ([3768cf7](https://github.com/twinfoundation/attestation/commit/3768cf7214d30a5429b7b08190539b517d7fafa0))
109
+ * release to production ([aa69a08](https://github.com/iotaledger/twin-attestation/commit/aa69a08fbd3897c8d72b0d32ec730f104ad31b33))
110
+ * release to production ([89ca987](https://github.com/iotaledger/twin-attestation/commit/89ca987963d9090abcfc1b62bc997e2c521944ec))
111
+ * update data type registration with fully qualified names ([5982245](https://github.com/iotaledger/twin-attestation/commit/59822454a027a9c6dfa72ffa9aabb9622b925929))
112
+ * update dependencies ([1d96d2e](https://github.com/iotaledger/twin-attestation/commit/1d96d2ee6e81a30396980f6f5e16e9658710d32d))
113
+ * update framework core ([02326d4](https://github.com/iotaledger/twin-attestation/commit/02326d41238862c13587c19bb3d04c1cb3b606d8))
114
+ * update ts-to-schema generation ([0f23298](https://github.com/iotaledger/twin-attestation/commit/0f23298f6e8accb19c0faaf74220cce02155b48a))
115
+ * use shared store mechanism ([#5](https://github.com/iotaledger/twin-attestation/issues/5)) ([3768cf7](https://github.com/iotaledger/twin-attestation/commit/3768cf7214d30a5429b7b08190539b517d7fafa0))
52
116
 
53
117
  ## 0.0.1 (2025-07-09)
54
118
 
55
119
 
56
120
  ### Features
57
121
 
58
- * release to production ([aa69a08](https://github.com/twinfoundation/attestation/commit/aa69a08fbd3897c8d72b0d32ec730f104ad31b33))
59
- * release to production ([89ca987](https://github.com/twinfoundation/attestation/commit/89ca987963d9090abcfc1b62bc997e2c521944ec))
122
+ * release to production ([aa69a08](https://github.com/iotaledger/twin-attestation/commit/aa69a08fbd3897c8d72b0d32ec730f104ad31b33))
123
+ * release to production ([89ca987](https://github.com/iotaledger/twin-attestation/commit/89ca987963d9090abcfc1b62bc997e2c521944ec))
60
124
 
61
- ## [0.0.1-next.30](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.1-next.29...attestation-models-v0.0.1-next.30) (2025-06-12)
125
+ ## [0.0.1-next.30](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.1-next.29...attestation-models-v0.0.1-next.30) (2025-06-12)
62
126
 
63
127
 
64
128
  ### Features
65
129
 
66
- * update dependencies ([1d96d2e](https://github.com/twinfoundation/attestation/commit/1d96d2ee6e81a30396980f6f5e16e9658710d32d))
130
+ * update dependencies ([1d96d2e](https://github.com/iotaledger/twin-attestation/commit/1d96d2ee6e81a30396980f6f5e16e9658710d32d))
67
131
 
68
- ## [0.0.1-next.29](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.1-next.28...attestation-models-v0.0.1-next.29) (2025-06-03)
132
+ ## [0.0.1-next.29](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.1-next.28...attestation-models-v0.0.1-next.29) (2025-06-03)
69
133
 
70
134
 
71
135
  ### Features
72
136
 
73
- * update ts-to-schema generation ([0f23298](https://github.com/twinfoundation/attestation/commit/0f23298f6e8accb19c0faaf74220cce02155b48a))
137
+ * update ts-to-schema generation ([0f23298](https://github.com/iotaledger/twin-attestation/commit/0f23298f6e8accb19c0faaf74220cce02155b48a))
74
138
 
75
- ## [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)
139
+ ## [0.0.1-next.28](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.1-next.27...attestation-models-v0.0.1-next.28) (2025-05-28)
76
140
 
77
141
 
78
142
  ### Features
79
143
 
80
- * update data type registration with fully qualified names ([5982245](https://github.com/twinfoundation/attestation/commit/59822454a027a9c6dfa72ffa9aabb9622b925929))
144
+ * update data type registration with fully qualified names ([5982245](https://github.com/iotaledger/twin-attestation/commit/59822454a027a9c6dfa72ffa9aabb9622b925929))
81
145
 
82
- ## [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)
146
+ ## [0.0.1-next.27](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.1-next.26...attestation-models-v0.0.1-next.27) (2025-05-06)
83
147
 
84
148
 
85
149
  ### Miscellaneous Chores
86
150
 
87
151
  * **attestation-models:** Synchronize repo versions
88
152
 
89
- ## [0.0.1-next.26](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.1-next.25...attestation-models-v0.0.1-next.26) (2025-04-17)
153
+ ## [0.0.1-next.26](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.1-next.25...attestation-models-v0.0.1-next.26) (2025-04-17)
90
154
 
91
155
 
92
156
  ### Features
93
157
 
94
- * use shared store mechanism ([#5](https://github.com/twinfoundation/attestation/issues/5)) ([3768cf7](https://github.com/twinfoundation/attestation/commit/3768cf7214d30a5429b7b08190539b517d7fafa0))
158
+ * use shared store mechanism ([#5](https://github.com/iotaledger/twin-attestation/issues/5)) ([3768cf7](https://github.com/iotaledger/twin-attestation/commit/3768cf7214d30a5429b7b08190539b517d7fafa0))
95
159
 
96
- ## [0.0.1-next.25](https://github.com/twinfoundation/attestation/compare/attestation-models-v0.0.1-next.24...attestation-models-v0.0.1-next.25) (2025-03-28)
160
+ ## [0.0.1-next.25](https://github.com/iotaledger/twin-attestation/compare/attestation-models-v0.0.1-next.24...attestation-models-v0.0.1-next.25) (2025-03-28)
97
161
 
98
162
 
99
163
  ### Miscellaneous Chores
package/docs/examples.md CHANGED
@@ -1 +1,12 @@
1
- # @twin.org/attestation-models - Examples
1
+ # Attestation Models Examples
2
+
3
+ Register the data types at startup so schemas and JSON-LD mappings are available before you parse or validate attestation payloads.
4
+
5
+ ## AttestationDataTypes
6
+
7
+ ```typescript
8
+ import { AttestationDataTypes } from '@twin.org/attestation-models';
9
+
10
+ AttestationDataTypes.registerTypes();
11
+ console.log('Attestation data types registered.'); // Attestation data types registered.
12
+ ```
@@ -14,7 +14,7 @@ Handle all the data types for attestation.
14
14
 
15
15
  ## Methods
16
16
 
17
- ### registerTypes()
17
+ ### registerTypes() {#registertypes}
18
18
 
19
19
  > `static` **registerTypes**(): `void`
20
20
 
@@ -8,7 +8,7 @@ Interface describing an attestation contract.
8
8
 
9
9
  ## Methods
10
10
 
11
- ### create()
11
+ ### create() {#create}
12
12
 
13
13
  > **create**(`attestationObject`, `namespace?`): `Promise`\<`string`\>
14
14
 
@@ -36,7 +36,7 @@ The id of the attestation.
36
36
 
37
37
  ***
38
38
 
39
- ### get()
39
+ ### get() {#get}
40
40
 
41
41
  > **get**(`id`): `Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
42
42
 
@@ -58,7 +58,7 @@ The verified attestation details.
58
58
 
59
59
  ***
60
60
 
61
- ### transfer()
61
+ ### transfer() {#transfer}
62
62
 
63
63
  > **transfer**(`attestationId`, `holderIdentity`, `holderAddress`): `Promise`\<`void`\>
64
64
 
@@ -92,7 +92,7 @@ Nothing.
92
92
 
93
93
  ***
94
94
 
95
- ### destroy()
95
+ ### destroy() {#destroy}
96
96
 
97
97
  > **destroy**(`attestationId`): `Promise`\<`void`\>
98
98
 
@@ -8,7 +8,7 @@ Interface describing an attestation connector.
8
8
 
9
9
  ## Methods
10
10
 
11
- ### create()
11
+ ### create() {#create}
12
12
 
13
13
  > **create**(`controller`, `verificationMethodId`, `attestationObject`): `Promise`\<`string`\>
14
14
 
@@ -42,7 +42,7 @@ The collated attestation data.
42
42
 
43
43
  ***
44
44
 
45
- ### get()
45
+ ### get() {#get}
46
46
 
47
47
  > **get**(`id`): `Promise`\<[`IAttestationInformation`](IAttestationInformation.md)\>
48
48
 
@@ -64,7 +64,7 @@ The verified attestation details.
64
64
 
65
65
  ***
66
66
 
67
- ### transfer()
67
+ ### transfer() {#transfer}
68
68
 
69
69
  > **transfer**(`controller`, `attestationId`, `holderIdentity`, `holderAddress`): `Promise`\<`void`\>
70
70
 
@@ -104,7 +104,7 @@ Nothing.
104
104
 
105
105
  ***
106
106
 
107
- ### destroy()
107
+ ### destroy() {#destroy}
108
108
 
109
109
  > **destroy**(`controller`, `attestationId`): `Promise`\<`void`\>
110
110
 
@@ -4,7 +4,7 @@ Attest the data and return the id of the attestation.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### body
7
+ ### body {#body}
8
8
 
9
9
  > **body**: `object`
10
10
 
@@ -18,6 +18,6 @@ The data object to attest.
18
18
 
19
19
  #### namespace?
20
20
 
21
- > `optional` **namespace**: `string`
21
+ > `optional` **namespace?**: `string`
22
22
 
23
23
  The namespace of the connector to use for the attestation, defaults to component configured namespace.
@@ -4,7 +4,7 @@ Destroy the attestation.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### pathParams
7
+ ### pathParams {#pathparams}
8
8
 
9
9
  > **pathParams**: `object`
10
10
 
@@ -4,9 +4,9 @@ Verify that the proof is valid for the attestation.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### headers?
7
+ ### headers? {#headers}
8
8
 
9
- > `optional` **headers**: `object`
9
+ > `optional` **headers?**: `object`
10
10
 
11
11
  The headers which can be used to determine the response data type.
12
12
 
@@ -16,7 +16,7 @@ The headers which can be used to determine the response data type.
16
16
 
17
17
  ***
18
18
 
19
- ### pathParams
19
+ ### pathParams {#pathparams}
20
20
 
21
21
  > **pathParams**: `object`
22
22
 
@@ -4,9 +4,9 @@ The response to verifying the attestation.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### headers?
7
+ ### headers? {#headers}
8
8
 
9
- > `optional` **headers**: `object`
9
+ > `optional` **headers?**: `object`
10
10
 
11
11
  The headers which can be used to determine the response data type.
12
12
 
@@ -16,7 +16,7 @@ The headers which can be used to determine the response data type.
16
16
 
17
17
  ***
18
18
 
19
- ### body
19
+ ### body {#body}
20
20
 
21
21
  > **body**: [`IAttestationInformation`](IAttestationInformation.md)
22
22
 
@@ -4,15 +4,15 @@ Interface describing the collated attestation information.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### @context
7
+ ### @context {#context}
8
8
 
9
- > **@context**: \[`"https://schema.twindev.org/attestation/"`, `"https://schema.twindev.org/common/"`, `"https://schema.org"`, `...IJsonLdContextDefinitionElement[]`\]
9
+ > **@context**: \[`"https://schema.org"`, `"https://schema.twindev.org/attestation/"`, `"https://schema.twindev.org/common/"`, `...IJsonLdContextDefinitionElement[]`\]
10
10
 
11
11
  JSON-LD Context.
12
12
 
13
13
  ***
14
14
 
15
- ### type
15
+ ### type {#type}
16
16
 
17
17
  > **type**: `"Information"`
18
18
 
@@ -20,7 +20,7 @@ JSON-LD Type.
20
20
 
21
21
  ***
22
22
 
23
- ### id
23
+ ### id {#id}
24
24
 
25
25
  > **id**: `string`
26
26
 
@@ -28,7 +28,7 @@ The unique identifier of the attestation.
28
28
 
29
29
  ***
30
30
 
31
- ### dateCreated
31
+ ### dateCreated {#datecreated}
32
32
 
33
33
  > **dateCreated**: `string`
34
34
 
@@ -36,15 +36,15 @@ Created date/time of the attestation in ISO format.
36
36
 
37
37
  ***
38
38
 
39
- ### dateTransferred?
39
+ ### dateTransferred? {#datetransferred}
40
40
 
41
- > `optional` **dateTransferred**: `string`
41
+ > `optional` **dateTransferred?**: `string`
42
42
 
43
43
  Transferred date/time of the attestation in ISO format, can be blank if holder identity is owner.
44
44
 
45
45
  ***
46
46
 
47
- ### ownerIdentity
47
+ ### ownerIdentity {#owneridentity}
48
48
 
49
49
  > **ownerIdentity**: `string`
50
50
 
@@ -52,15 +52,15 @@ The identity of the owner.
52
52
 
53
53
  ***
54
54
 
55
- ### holderIdentity?
55
+ ### holderIdentity? {#holderidentity}
56
56
 
57
- > `optional` **holderIdentity**: `string`
57
+ > `optional` **holderIdentity?**: `string`
58
58
 
59
59
  The identity of the current holder, can be undefined if owner is still the holder.
60
60
 
61
61
  ***
62
62
 
63
- ### attestationObject
63
+ ### attestationObject {#attestationobject}
64
64
 
65
65
  > **attestationObject**: `IJsonLdNodeObject`
66
66
 
@@ -68,24 +68,24 @@ The data that was attested.
68
68
 
69
69
  ***
70
70
 
71
- ### proof?
71
+ ### proof? {#proof}
72
72
 
73
- > `optional` **proof**: `IJsonLdNodeObject`
73
+ > `optional` **proof?**: `IJsonLdNodeObject`
74
74
 
75
75
  The proof for the attested data.
76
76
 
77
77
  ***
78
78
 
79
- ### verified?
79
+ ### verified? {#verified}
80
80
 
81
- > `optional` **verified**: `boolean`
81
+ > `optional` **verified?**: `boolean`
82
82
 
83
83
  Whether the attestation has been verified.
84
84
 
85
85
  ***
86
86
 
87
- ### verificationFailure?
87
+ ### verificationFailure? {#verificationfailure}
88
88
 
89
- > `optional` **verificationFailure**: `string`
89
+ > `optional` **verificationFailure?**: `string`
90
90
 
91
91
  The verification failure message.
@@ -4,7 +4,7 @@ Interface describing an attestation proof.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### @context
7
+ ### @context {#context}
8
8
 
9
9
  > **@context**: `"https://schema.twindev.org/attestation/"` \| \[`"https://schema.twindev.org/attestation/"`, `...IJsonLdContextDefinitionElement[]`\]
10
10
 
@@ -12,7 +12,7 @@ JSON-LD Context.
12
12
 
13
13
  ***
14
14
 
15
- ### type
15
+ ### type {#type}
16
16
 
17
17
  > **type**: `"JwtProof"`
18
18
 
@@ -20,7 +20,7 @@ The type of the proof.
20
20
 
21
21
  ***
22
22
 
23
- ### value
23
+ ### value {#value}
24
24
 
25
25
  > **value**: `string`
26
26
 
@@ -4,7 +4,7 @@ Transfer the attestation to a new holder.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### pathParams
7
+ ### pathParams {#pathparams}
8
8
 
9
9
  > **pathParams**: `object`
10
10
 
@@ -18,7 +18,7 @@ The attestation id to transfer.
18
18
 
19
19
  ***
20
20
 
21
- ### body
21
+ ### body {#body}
22
22
 
23
23
  > **body**: `object`
24
24
 
@@ -6,14 +6,38 @@ The contexts of attestation data.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### ContextRoot
9
+ ### Namespace {#namespace}
10
10
 
11
- > `readonly` **ContextRoot**: `"https://schema.twindev.org/attestation/"` = `"https://schema.twindev.org/attestation/"`
11
+ > `readonly` **Namespace**: `"https://schema.twindev.org/attestation/"` = `"https://schema.twindev.org/attestation/"`
12
12
 
13
- The context root for the attestation types.
13
+ The canonical RDF namespace URI for Attestation.
14
14
 
15
- ### ContextRootCommon
15
+ ### Context {#context}
16
16
 
17
- > `readonly` **ContextRootCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
17
+ > `readonly` **Context**: `"https://schema.twindev.org/attestation/"` = `"https://schema.twindev.org/attestation/"`
18
18
 
19
- The context root for the common types.
19
+ The value to use in context for Attestation.
20
+
21
+ ### JsonLdContext {#jsonldcontext}
22
+
23
+ > `readonly` **JsonLdContext**: `"https://schema.twindev.org/attestation/types.jsonld"` = `"https://schema.twindev.org/attestation/types.jsonld"`
24
+
25
+ The JSON-LD Context URL for Attestation.
26
+
27
+ ### NamespaceCommon {#namespacecommon}
28
+
29
+ > `readonly` **NamespaceCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
30
+
31
+ The canonical RDF namespace URI for TWIN Common.
32
+
33
+ ### ContextCommon {#contextcommon}
34
+
35
+ > `readonly` **ContextCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
36
+
37
+ The value to use in JSON-LD context for TWIN Common.
38
+
39
+ ### JsonLdContextCommon {#jsonldcontextcommon}
40
+
41
+ > `readonly` **JsonLdContextCommon**: `"https://schema.twindev.org/common/types.jsonld"` = `"https://schema.twindev.org/common/types.jsonld"`
42
+
43
+ The JSON-LD Context URL for TWIN Common.
@@ -6,13 +6,13 @@ The types of attestation data.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### Information
9
+ ### Information {#information}
10
10
 
11
11
  > `readonly` **Information**: `"Information"` = `"Information"`
12
12
 
13
13
  Represents attestation information.
14
14
 
15
- ### JwtProof
15
+ ### JwtProof {#jwtproof}
16
16
 
17
17
  > `readonly` **JwtProof**: `"JwtProof"` = `"JwtProof"`
18
18
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/attestation-models",
3
- "version": "0.0.3-next.1",
4
- "description": "Models which define the structure of the attestation connectors and services",
3
+ "version": "0.0.3-next.10",
4
+ "description": "Shared models and data types for attestation connectors and services.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/twinfoundation/attestation.git",
7
+ "url": "git+https://github.com/iotaledger/attestation.git",
8
8
  "directory": "packages/attestation-models"
9
9
  },
10
10
  "author": "martyn.janes@iota.org",
@@ -54,7 +54,7 @@
54
54
  "schemas"
55
55
  ],
56
56
  "bugs": {
57
- "url": "git+https://github.com/twinfoundation/attestation/issues"
57
+ "url": "git+https://github.com/iotaledger/attestation/issues"
58
58
  },
59
59
  "homepage": "https://twindev.org"
60
60
  }