@twin.org/immutable-proof-models 0.0.3-next.10 → 0.0.3-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/es/dataTypes/immutableProofDataTypes.js +23 -7
- package/dist/es/dataTypes/immutableProofDataTypes.js.map +1 -1
- package/dist/es/models/IImmutableProof.js.map +1 -1
- package/dist/es/models/IImmutableProofReceipt.js.map +1 -1
- package/dist/es/models/IImmutableProofVerification.js.map +1 -1
- package/dist/es/models/immutableProofTypes.js +5 -1
- package/dist/es/models/immutableProofTypes.js.map +1 -1
- package/dist/es/schemas/ImmutableProof.json +13 -14
- package/dist/es/schemas/ImmutableProofFailure.json +24 -0
- package/dist/es/schemas/ImmutableProofReceipt.json +39 -0
- package/dist/es/schemas/ImmutableProofVerification.json +30 -0
- package/dist/types/models/IImmutableProof.d.ts +1 -1
- package/dist/types/models/IImmutableProofReceipt.d.ts +2 -2
- package/dist/types/models/IImmutableProofVerification.d.ts +2 -2
- package/dist/types/models/immutableProofTypes.d.ts +4 -0
- package/docs/changelog.md +63 -49
- package/docs/examples.md +72 -1
- package/docs/reference/classes/ImmutableProofDataTypes.md +1 -1
- package/docs/reference/interfaces/IImmutableProof.md +7 -8
- package/docs/reference/interfaces/IImmutableProofComponent.md +4 -4
- package/docs/reference/interfaces/IImmutableProofCreateRequest.md +1 -1
- package/docs/reference/interfaces/IImmutableProofEventBusProofCreated.md +1 -1
- package/docs/reference/interfaces/IImmutableProofGetRequest.md +3 -3
- package/docs/reference/interfaces/IImmutableProofGetResponse.md +3 -3
- package/docs/reference/interfaces/IImmutableProofReceipt.md +7 -9
- package/docs/reference/interfaces/IImmutableProofVerification.md +5 -7
- package/docs/reference/interfaces/IImmutableProofVerifyRequest.md +3 -3
- package/docs/reference/interfaces/IImmutableProofVerifyResponse.md +3 -3
- package/docs/reference/variables/ImmutableProofContexts.md +6 -6
- package/docs/reference/variables/ImmutableProofFailure.md +4 -4
- package/docs/reference/variables/ImmutableProofTopics.md +1 -1
- package/docs/reference/variables/ImmutableProofTypes.md +9 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TWIN Immutable Proof Models
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package defines the shared contracts used by immutable proof components, including request and response models, verification structures, topics, and schema context values. It provides a stable foundation so services, tasks, and clients can exchange data consistently.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import {
|
|
3
|
+
import { DataTypeHelper } from "@twin.org/data-core";
|
|
4
4
|
import { ImmutableProofContexts } from "../models/immutableProofContexts.js";
|
|
5
5
|
import { ImmutableProofTypes } from "../models/immutableProofTypes.js";
|
|
6
6
|
import ImmutableProofSchema from "../schemas/ImmutableProof.json" with { type: "json" };
|
|
7
|
+
import ImmutableProofFailureSchema from "../schemas/ImmutableProofFailure.json" with { type: "json" };
|
|
8
|
+
import ImmutableProofReceiptSchema from "../schemas/ImmutableProofReceipt.json" with { type: "json" };
|
|
9
|
+
import ImmutableProofVerificationSchema from "../schemas/ImmutableProofVerification.json" with { type: "json" };
|
|
7
10
|
/**
|
|
8
11
|
* Handle all the data types for immutable proof.
|
|
9
12
|
*/
|
|
@@ -12,12 +15,25 @@ export class ImmutableProofDataTypes {
|
|
|
12
15
|
* Register all the data types.
|
|
13
16
|
*/
|
|
14
17
|
static registerTypes() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const types = [
|
|
19
|
+
{
|
|
20
|
+
type: ImmutableProofTypes.ImmutableProof,
|
|
21
|
+
schema: ImmutableProofSchema
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: ImmutableProofTypes.ImmutableProofReceipt,
|
|
25
|
+
schema: ImmutableProofReceiptSchema
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: ImmutableProofTypes.ImmutableProofVerification,
|
|
29
|
+
schema: ImmutableProofVerificationSchema
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: ImmutableProofTypes.ImmutableProofFailure,
|
|
33
|
+
schema: ImmutableProofFailureSchema
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
DataTypeHelper.registerTypes(ImmutableProofContexts.Namespace, ImmutableProofContexts.JsonLdContext, types.map(t => ({ type: t.type, schema: t.schema })));
|
|
21
37
|
}
|
|
22
38
|
}
|
|
23
39
|
//# sourceMappingURL=immutableProofDataTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"immutableProofDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/immutableProofDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"immutableProofDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/immutableProofDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,oBAAoB,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxF,OAAO,2BAA2B,MAAM,uCAAuC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtG,OAAO,2BAA2B,MAAM,uCAAuC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtG,OAAO,gCAAgC,MAAM,4CAA4C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEhH;;GAEG;AACH,MAAM,OAAO,uBAAuB;IACnC;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,MAAM,KAAK,GAAG;YACb;gBACC,IAAI,EAAE,mBAAmB,CAAC,cAAc;gBACxC,MAAM,EAAE,oBAAoB;aAC5B;YACD;gBACC,IAAI,EAAE,mBAAmB,CAAC,qBAAqB;gBAC/C,MAAM,EAAE,2BAA2B;aACnC;YACD;gBACC,IAAI,EAAE,mBAAmB,CAAC,0BAA0B;gBACpD,MAAM,EAAE,gCAAgC;aACxC;YACD;gBACC,IAAI,EAAE,mBAAmB,CAAC,qBAAqB;gBAC/C,MAAM,EAAE,2BAA2B;aACnC;SACD,CAAC;QAEF,cAAc,CAAC,aAAa,CAC3B,sBAAsB,CAAC,SAAS,EAChC,sBAAsB,CAAC,aAAa,EACpC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CACpD,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHelper } from \"@twin.org/data-core\";\nimport { ImmutableProofContexts } from \"../models/immutableProofContexts.js\";\nimport { ImmutableProofTypes } from \"../models/immutableProofTypes.js\";\nimport ImmutableProofSchema from \"../schemas/ImmutableProof.json\" with { type: \"json\" };\nimport ImmutableProofFailureSchema from \"../schemas/ImmutableProofFailure.json\" with { type: \"json\" };\nimport ImmutableProofReceiptSchema from \"../schemas/ImmutableProofReceipt.json\" with { type: \"json\" };\nimport ImmutableProofVerificationSchema from \"../schemas/ImmutableProofVerification.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for immutable proof.\n */\nexport class ImmutableProofDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tconst types = [\n\t\t\t{\n\t\t\t\ttype: ImmutableProofTypes.ImmutableProof,\n\t\t\t\tschema: ImmutableProofSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: ImmutableProofTypes.ImmutableProofReceipt,\n\t\t\t\tschema: ImmutableProofReceiptSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: ImmutableProofTypes.ImmutableProofVerification,\n\t\t\t\tschema: ImmutableProofVerificationSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: ImmutableProofTypes.ImmutableProofFailure,\n\t\t\t\tschema: ImmutableProofFailureSchema\n\t\t\t}\n\t\t];\n\n\t\tDataTypeHelper.registerTypes(\n\t\t\tImmutableProofContexts.Namespace,\n\t\t\tImmutableProofContexts.JsonLdContext,\n\t\t\ttypes.map(t => ({ type: t.type, schema: t.schema }))\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IImmutableProof.js","sourceRoot":"","sources":["../../../src/models/IImmutableProof.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ImmutableProofContexts } from \"./immutableProofContexts.js\";\nimport type { ImmutableProofTypes } from \"./immutableProofTypes.js\";\n\n/**\n * Interface describing an immutable proof state.\n */\nexport interface IImmutableProof {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\"?: [typeof ImmutableProofContexts.Context, typeof ImmutableProofContexts.ContextCommon];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype?: typeof ImmutableProofTypes.ImmutableProof;\n\n\t/**\n\t * The id of the object associated with the proof.\n\t */\n\tid?: string;\n\n\t/**\n\t * The integrity hash of the object associated with the proof.\n\t * json-ld namespace:twin-common\n\t */\n\tproofIntegrity: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IImmutableProof.js","sourceRoot":"","sources":["../../../src/models/IImmutableProof.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ImmutableProofContexts } from \"./immutableProofContexts.js\";\nimport type { ImmutableProofTypes } from \"./immutableProofTypes.js\";\n\n/**\n * Interface describing an immutable proof state.\n */\nexport interface IImmutableProof {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\"?: [typeof ImmutableProofContexts.Context, typeof ImmutableProofContexts.ContextCommon];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype?: typeof ImmutableProofTypes.ImmutableProof;\n\n\t/**\n\t * The id of the object associated with the proof.\n\t */\n\tid?: string;\n\n\t/**\n\t * The integrity hash of the object associated with the proof.\n\t * @json-ld namespace:twin-common\n\t */\n\tproofIntegrity: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IImmutableProofReceipt.js","sourceRoot":"","sources":["../../../src/models/IImmutableProofReceipt.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { ImmutableProofContexts } from \"./immutableProofContexts.js\";\nimport type { ImmutableProofTypes } from \"./immutableProofTypes.js\";\n\n/**\n * Interface describing an immutable proof receipt.\n */\nexport interface IImmutableProofReceipt {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\"?: [typeof ImmutableProofContexts.Context, typeof ImmutableProofContexts.ContextCommon];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof ImmutableProofTypes.ImmutableProofReceipt;\n\n\t/**\n\t * The immutable receipt detail for where the proof is stored.\n\t * json-ld id\n\t */\n\timmutableReceipt?: IJsonLdNodeObject;\n\n\t/**\n\t * The verifiable storage id for where the proof is stored.\n\t * json-ld id\n\t */\n\tverifiableStorageId?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IImmutableProofReceipt.js","sourceRoot":"","sources":["../../../src/models/IImmutableProofReceipt.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { ImmutableProofContexts } from \"./immutableProofContexts.js\";\nimport type { ImmutableProofTypes } from \"./immutableProofTypes.js\";\n\n/**\n * Interface describing an immutable proof receipt.\n */\nexport interface IImmutableProofReceipt {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\"?: [typeof ImmutableProofContexts.Context, typeof ImmutableProofContexts.ContextCommon];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof ImmutableProofTypes.ImmutableProofReceipt;\n\n\t/**\n\t * The immutable receipt detail for where the proof is stored.\n\t * @json-ld id\n\t */\n\timmutableReceipt?: IJsonLdNodeObject;\n\n\t/**\n\t * The verifiable storage id for where the proof is stored.\n\t * @json-ld id\n\t */\n\tverifiableStorageId?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IImmutableProofVerification.js","sourceRoot":"","sources":["../../../src/models/IImmutableProofVerification.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ImmutableProofContexts } from \"./immutableProofContexts.js\";\nimport type { ImmutableProofFailure } from \"./immutableProofFailure.js\";\nimport type { ImmutableProofTypes } from \"./immutableProofTypes.js\";\n\n/**\n * Interface describing an immutable proof verification.\n */\nexport interface IImmutableProofVerification {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": typeof ImmutableProofContexts.Context;\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof ImmutableProofTypes.ImmutableProofVerification;\n\n\t/**\n\t * Was the verification successful.\n\t * json-ld namespace:twin-common\n\t */\n\tverified: boolean;\n\n\t/**\n\t * If the verification was unsuccessful the failure reason.\n\t * json-ld type:schema:Text\n\t */\n\tfailure?: ImmutableProofFailure;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IImmutableProofVerification.js","sourceRoot":"","sources":["../../../src/models/IImmutableProofVerification.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ImmutableProofContexts } from \"./immutableProofContexts.js\";\nimport type { ImmutableProofFailure } from \"./immutableProofFailure.js\";\nimport type { ImmutableProofTypes } from \"./immutableProofTypes.js\";\n\n/**\n * Interface describing an immutable proof verification.\n */\nexport interface IImmutableProofVerification {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": typeof ImmutableProofContexts.Context;\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof ImmutableProofTypes.ImmutableProofVerification;\n\n\t/**\n\t * Was the verification successful.\n\t * @json-ld namespace:twin-common\n\t */\n\tverified: boolean;\n\n\t/**\n\t * If the verification was unsuccessful the failure reason.\n\t * @json-ld type:schema:Text\n\t */\n\tfailure?: ImmutableProofFailure;\n}\n"]}
|
|
@@ -16,6 +16,10 @@ export const ImmutableProofTypes = {
|
|
|
16
16
|
/**
|
|
17
17
|
* Represents Immutable Proof Verification.
|
|
18
18
|
*/
|
|
19
|
-
ImmutableProofVerification: "ImmutableProofVerification"
|
|
19
|
+
ImmutableProofVerification: "ImmutableProofVerification",
|
|
20
|
+
/**
|
|
21
|
+
* Represents Immutable Proof Failure.
|
|
22
|
+
*/
|
|
23
|
+
ImmutableProofFailure: "ImmutableProofFailure"
|
|
20
24
|
};
|
|
21
25
|
//# sourceMappingURL=immutableProofTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"immutableProofTypes.js","sourceRoot":"","sources":["../../../src/models/immutableProofTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;OAEG;IACH,qBAAqB,EAAE,uBAAuB;IAE9C;;OAEG;IACH,0BAA0B,EAAE,4BAA4B;
|
|
1
|
+
{"version":3,"file":"immutableProofTypes.js","sourceRoot":"","sources":["../../../src/models/immutableProofTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;OAEG;IACH,qBAAqB,EAAE,uBAAuB;IAE9C;;OAEG;IACH,0BAA0B,EAAE,4BAA4B;IAExD;;OAEG;IACH,qBAAqB,EAAE,uBAAuB;CACrC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of immutable proof data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ImmutableProofTypes = {\n\t/**\n\t * Represents Immutable Proof.\n\t */\n\tImmutableProof: \"ImmutableProof\",\n\n\t/**\n\t * Represents Immutable Proof Receipt.\n\t */\n\tImmutableProofReceipt: \"ImmutableProofReceipt\",\n\n\t/**\n\t * Represents Immutable Proof Verification.\n\t */\n\tImmutableProofVerification: \"ImmutableProofVerification\",\n\n\t/**\n\t * Represents Immutable Proof Failure.\n\t */\n\tImmutableProofFailure: \"ImmutableProofFailure\"\n} as const;\n\n/**\n * The types of immutable proof data.\n */\nexport type ImmutableProofTypes = (typeof ImmutableProofTypes)[keyof typeof ImmutableProofTypes];\n"]}
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schema.twindev.org/immutable-proof/ImmutableProof",
|
|
4
|
+
"title": "ImmutableProof",
|
|
4
5
|
"description": "Interface describing an immutable proof state.",
|
|
5
6
|
"type": "object",
|
|
6
7
|
"properties": {
|
|
7
8
|
"@context": {
|
|
8
9
|
"type": "array",
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
10
|
+
"prefixItems": [
|
|
11
|
+
{
|
|
12
|
+
"const": "https://schema.twindev.org/immutable-proof/"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"const": "https://schema.twindev.org/common/"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"items": false,
|
|
19
|
+
"minItems": 2,
|
|
20
|
+
"maxItems": 2,
|
|
21
21
|
"description": "JSON-LD Context."
|
|
22
22
|
},
|
|
23
23
|
"type": {
|
|
24
|
-
"type": "string",
|
|
25
24
|
"const": "ImmutableProof",
|
|
26
25
|
"description": "JSON-LD Type."
|
|
27
26
|
},
|
|
@@ -31,7 +30,7 @@
|
|
|
31
30
|
},
|
|
32
31
|
"proofIntegrity": {
|
|
33
32
|
"type": "string",
|
|
34
|
-
"description": "The integrity hash of the object associated with the proof.
|
|
33
|
+
"description": "The integrity hash of the object associated with the proof."
|
|
35
34
|
}
|
|
36
35
|
},
|
|
37
36
|
"required": [
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/immutable-proof/ImmutableProofFailure",
|
|
4
|
+
"title": "ImmutableProofFailure",
|
|
5
|
+
"description": "The failure reason of the proof.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"const": "notIssued",
|
|
9
|
+
"description": "Proof not yet issued."
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"const": "proofMissing",
|
|
13
|
+
"description": "Proof missing."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"const": "verificationFailure",
|
|
17
|
+
"description": "Verification failure."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"const": "revoked",
|
|
21
|
+
"description": "Revoked."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/immutable-proof/ImmutableProofReceipt",
|
|
4
|
+
"title": "ImmutableProofReceipt",
|
|
5
|
+
"description": "Interface describing an immutable proof receipt.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"@context": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"prefixItems": [
|
|
11
|
+
{
|
|
12
|
+
"const": "https://schema.twindev.org/immutable-proof/"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"const": "https://schema.twindev.org/common/"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"items": false,
|
|
19
|
+
"minItems": 2,
|
|
20
|
+
"maxItems": 2,
|
|
21
|
+
"description": "JSON-LD Context."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"const": "ImmutableProofReceipt",
|
|
25
|
+
"description": "JSON-LD Type."
|
|
26
|
+
},
|
|
27
|
+
"immutableReceipt": {
|
|
28
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
29
|
+
"description": "The immutable receipt detail for where the proof is stored."
|
|
30
|
+
},
|
|
31
|
+
"verifiableStorageId": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The verifiable storage id for where the proof is stored."
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"type"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/immutable-proof/ImmutableProofVerification",
|
|
4
|
+
"title": "ImmutableProofVerification",
|
|
5
|
+
"description": "Interface describing an immutable proof verification.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"@context": {
|
|
9
|
+
"const": "https://schema.twindev.org/immutable-proof/",
|
|
10
|
+
"description": "JSON-LD Context."
|
|
11
|
+
},
|
|
12
|
+
"type": {
|
|
13
|
+
"const": "ImmutableProofVerification",
|
|
14
|
+
"description": "JSON-LD Type."
|
|
15
|
+
},
|
|
16
|
+
"verified": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"description": "Was the verification successful."
|
|
19
|
+
},
|
|
20
|
+
"failure": {
|
|
21
|
+
"$ref": "https://schema.twindev.org/immutable-proof/ImmutableProofFailure",
|
|
22
|
+
"description": "If the verification was unsuccessful the failure reason."
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": [
|
|
26
|
+
"@context",
|
|
27
|
+
"type",
|
|
28
|
+
"verified"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -15,12 +15,12 @@ export interface IImmutableProofReceipt {
|
|
|
15
15
|
type: typeof ImmutableProofTypes.ImmutableProofReceipt;
|
|
16
16
|
/**
|
|
17
17
|
* The immutable receipt detail for where the proof is stored.
|
|
18
|
-
* json-ld id
|
|
18
|
+
* @json-ld id
|
|
19
19
|
*/
|
|
20
20
|
immutableReceipt?: IJsonLdNodeObject;
|
|
21
21
|
/**
|
|
22
22
|
* The verifiable storage id for where the proof is stored.
|
|
23
|
-
* json-ld id
|
|
23
|
+
* @json-ld id
|
|
24
24
|
*/
|
|
25
25
|
verifiableStorageId?: string;
|
|
26
26
|
}
|
|
@@ -15,12 +15,12 @@ export interface IImmutableProofVerification {
|
|
|
15
15
|
type: typeof ImmutableProofTypes.ImmutableProofVerification;
|
|
16
16
|
/**
|
|
17
17
|
* Was the verification successful.
|
|
18
|
-
* json-ld namespace:twin-common
|
|
18
|
+
* @json-ld namespace:twin-common
|
|
19
19
|
*/
|
|
20
20
|
verified: boolean;
|
|
21
21
|
/**
|
|
22
22
|
* If the verification was unsuccessful the failure reason.
|
|
23
|
-
* json-ld type:schema:Text
|
|
23
|
+
* @json-ld type:schema:Text
|
|
24
24
|
*/
|
|
25
25
|
failure?: ImmutableProofFailure;
|
|
26
26
|
}
|
|
@@ -14,6 +14,10 @@ export declare const ImmutableProofTypes: {
|
|
|
14
14
|
* Represents Immutable Proof Verification.
|
|
15
15
|
*/
|
|
16
16
|
readonly ImmutableProofVerification: "ImmutableProofVerification";
|
|
17
|
+
/**
|
|
18
|
+
* Represents Immutable Proof Failure.
|
|
19
|
+
*/
|
|
20
|
+
readonly ImmutableProofFailure: "ImmutableProofFailure";
|
|
17
21
|
};
|
|
18
22
|
/**
|
|
19
23
|
* The types of immutable proof data.
|
package/docs/changelog.md
CHANGED
|
@@ -1,160 +1,174 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.3-next.
|
|
3
|
+
## [0.0.3-next.12](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.11...immutable-proof-models-v0.0.3-next.12) (2026-05-12)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
### Features
|
|
7
7
|
|
|
8
|
-
* update
|
|
8
|
+
* typescript 6 update ([34d8aea](https://github.com/iotaledger/twin-immutable-proof/commit/34d8aea0ea0c1e1252de1882517abb1683d98313))
|
|
9
9
|
|
|
10
|
-
## [0.0.3-next.
|
|
10
|
+
## [0.0.3-next.11](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.10...immutable-proof-models-v0.0.3-next.11) (2026-03-25)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add missing proof type registration ([1e9f52b](https://github.com/iotaledger/twin-immutable-proof/commit/1e9f52b88ab201e97c9d2aa7611fb8f77a82d614))
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.10](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.9...immutable-proof-models-v0.0.3-next.10) (2026-02-25)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* update schemas ([ab0569a](https://github.com/iotaledger/twin-immutable-proof/commit/ab0569adf3419beefd8aef7793fdbe5b2fe2d93e))
|
|
23
|
+
|
|
24
|
+
## [0.0.3-next.9](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.8...immutable-proof-models-v0.0.3-next.9) (2026-02-13)
|
|
11
25
|
|
|
12
26
|
|
|
13
27
|
### Miscellaneous Chores
|
|
14
28
|
|
|
15
29
|
* **immutable-proof-models:** Synchronize repo versions
|
|
16
30
|
|
|
17
|
-
## [0.0.3-next.8](https://github.com/
|
|
31
|
+
## [0.0.3-next.8](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.7...immutable-proof-models-v0.0.3-next.8) (2026-02-10)
|
|
18
32
|
|
|
19
33
|
|
|
20
34
|
### Features
|
|
21
35
|
|
|
22
|
-
* immutable proof as vc ([#31](https://github.com/
|
|
36
|
+
* immutable proof as vc ([#31](https://github.com/iotaledger/twin-immutable-proof/issues/31)) ([79cdb03](https://github.com/iotaledger/twin-immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
|
|
23
37
|
|
|
24
|
-
## [0.0.3-next.7](https://github.com/
|
|
38
|
+
## [0.0.3-next.7](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.6...immutable-proof-models-v0.0.3-next.7) (2026-02-05)
|
|
25
39
|
|
|
26
40
|
|
|
27
41
|
### Features
|
|
28
42
|
|
|
29
|
-
* add ts-to-jsonld-context tool ([871191b](https://github.com/
|
|
43
|
+
* add ts-to-jsonld-context tool ([871191b](https://github.com/iotaledger/twin-immutable-proof/commit/871191b75cb82c2f6daaab08a71384ba92f02a64))
|
|
30
44
|
|
|
31
|
-
## [0.0.3-next.6](https://github.com/
|
|
45
|
+
## [0.0.3-next.6](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.5...immutable-proof-models-v0.0.3-next.6) (2026-01-21)
|
|
32
46
|
|
|
33
47
|
|
|
34
48
|
### Features
|
|
35
49
|
|
|
36
|
-
* update contexts ([#22](https://github.com/
|
|
50
|
+
* update contexts ([#22](https://github.com/iotaledger/twin-immutable-proof/issues/22)) ([645b880](https://github.com/iotaledger/twin-immutable-proof/commit/645b8803540408c74e3891b2c5ff9aefd5908d9f))
|
|
37
51
|
|
|
38
|
-
## [0.0.3-next.5](https://github.com/
|
|
52
|
+
## [0.0.3-next.5](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.4...immutable-proof-models-v0.0.3-next.5) (2026-01-14)
|
|
39
53
|
|
|
40
54
|
|
|
41
55
|
### Features
|
|
42
56
|
|
|
43
|
-
* update contexts and namespaces ([#20](https://github.com/
|
|
57
|
+
* update contexts and namespaces ([#20](https://github.com/iotaledger/twin-immutable-proof/issues/20)) ([d38aa69](https://github.com/iotaledger/twin-immutable-proof/commit/d38aa696c73e4fcc304f08fb458d5900109abcb4))
|
|
44
58
|
|
|
45
|
-
## [0.0.3-next.4](https://github.com/
|
|
59
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.3...immutable-proof-models-v0.0.3-next.4) (2026-01-07)
|
|
46
60
|
|
|
47
61
|
|
|
48
62
|
### Miscellaneous Chores
|
|
49
63
|
|
|
50
64
|
* **immutable-proof-models:** Synchronize repo versions
|
|
51
65
|
|
|
52
|
-
## [0.0.3-next.3](https://github.com/
|
|
66
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.2...immutable-proof-models-v0.0.3-next.3) (2025-11-28)
|
|
53
67
|
|
|
54
68
|
|
|
55
69
|
### Miscellaneous Chores
|
|
56
70
|
|
|
57
71
|
* **immutable-proof-models:** Synchronize repo versions
|
|
58
72
|
|
|
59
|
-
## [0.0.3-next.2](https://github.com/
|
|
73
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.1...immutable-proof-models-v0.0.3-next.2) (2025-11-28)
|
|
60
74
|
|
|
61
75
|
|
|
62
76
|
### Miscellaneous Chores
|
|
63
77
|
|
|
64
78
|
* **immutable-proof-models:** Synchronize repo versions
|
|
65
79
|
|
|
66
|
-
## [0.0.3-next.1](https://github.com/
|
|
80
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.3-next.0...immutable-proof-models-v0.0.3-next.1) (2025-11-12)
|
|
67
81
|
|
|
68
82
|
|
|
69
83
|
### Features
|
|
70
84
|
|
|
71
|
-
* add context id features ([#14](https://github.com/
|
|
72
|
-
* add validate-locales ([d6a7c07](https://github.com/
|
|
73
|
-
* eslint migration to flat config ([c8536f2](https://github.com/
|
|
74
|
-
* update data types to use fully qualified names ([e94d0f5](https://github.com/
|
|
75
|
-
* update dependencies ([7d6b321](https://github.com/
|
|
76
|
-
* update framework core ([e708d4d](https://github.com/
|
|
77
|
-
* update ts-to-schema generation ([c4fc864](https://github.com/
|
|
78
|
-
* update twindev schemas ([d2bb94b](https://github.com/
|
|
79
|
-
* use shared store mechanism ([#3](https://github.com/
|
|
85
|
+
* add context id features ([#14](https://github.com/iotaledger/twin-immutable-proof/issues/14)) ([ed5a594](https://github.com/iotaledger/twin-immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
|
|
86
|
+
* add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
87
|
+
* eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
|
|
88
|
+
* update data types to use fully qualified names ([e94d0f5](https://github.com/iotaledger/twin-immutable-proof/commit/e94d0f5db93856b5b59cfd34e55252fa13a7f4e0))
|
|
89
|
+
* update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
90
|
+
* update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
|
|
91
|
+
* update ts-to-schema generation ([c4fc864](https://github.com/iotaledger/twin-immutable-proof/commit/c4fc8646e7b8ee040d356f7f0f3b2d6f4ac63e40))
|
|
92
|
+
* update twindev schemas ([d2bb94b](https://github.com/iotaledger/twin-immutable-proof/commit/d2bb94b31e61f899e41dbca1b1aeb2b3bb70b229))
|
|
93
|
+
* use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
80
94
|
|
|
81
95
|
|
|
82
96
|
### Bug Fixes
|
|
83
97
|
|
|
84
|
-
* Missing user and node identity on create ([#1](https://github.com/
|
|
98
|
+
* Missing user and node identity on create ([#1](https://github.com/iotaledger/twin-immutable-proof/issues/1)) ([80ea2f9](https://github.com/iotaledger/twin-immutable-proof/commit/80ea2f901afc7531f4a522227a61e6fa1482484d))
|
|
85
99
|
|
|
86
|
-
## [0.0.2-next.3](https://github.com/
|
|
100
|
+
## [0.0.2-next.3](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.2-next.2...immutable-proof-models-v0.0.2-next.3) (2025-10-09)
|
|
87
101
|
|
|
88
102
|
|
|
89
103
|
### Features
|
|
90
104
|
|
|
91
|
-
* add validate-locales ([d6a7c07](https://github.com/
|
|
105
|
+
* add validate-locales ([d6a7c07](https://github.com/iotaledger/twin-immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
92
106
|
|
|
93
|
-
## [0.0.2-next.2](https://github.com/
|
|
107
|
+
## [0.0.2-next.2](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.2-next.1...immutable-proof-models-v0.0.2-next.2) (2025-08-29)
|
|
94
108
|
|
|
95
109
|
|
|
96
110
|
### Features
|
|
97
111
|
|
|
98
|
-
* eslint migration to flat config ([c8536f2](https://github.com/
|
|
112
|
+
* eslint migration to flat config ([c8536f2](https://github.com/iotaledger/twin-immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
|
|
99
113
|
|
|
100
|
-
## [0.0.2-next.1](https://github.com/
|
|
114
|
+
## [0.0.2-next.1](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.2-next.0...immutable-proof-models-v0.0.2-next.1) (2025-08-20)
|
|
101
115
|
|
|
102
116
|
|
|
103
117
|
### Features
|
|
104
118
|
|
|
105
|
-
* update data types to use fully qualified names ([e94d0f5](https://github.com/
|
|
106
|
-
* update dependencies ([7d6b321](https://github.com/
|
|
107
|
-
* update framework core ([e708d4d](https://github.com/
|
|
108
|
-
* update ts-to-schema generation ([c4fc864](https://github.com/
|
|
109
|
-
* update twindev schemas ([d2bb94b](https://github.com/
|
|
110
|
-
* use shared store mechanism ([#3](https://github.com/
|
|
119
|
+
* update data types to use fully qualified names ([e94d0f5](https://github.com/iotaledger/twin-immutable-proof/commit/e94d0f5db93856b5b59cfd34e55252fa13a7f4e0))
|
|
120
|
+
* update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
121
|
+
* update framework core ([e708d4d](https://github.com/iotaledger/twin-immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
|
|
122
|
+
* update ts-to-schema generation ([c4fc864](https://github.com/iotaledger/twin-immutable-proof/commit/c4fc8646e7b8ee040d356f7f0f3b2d6f4ac63e40))
|
|
123
|
+
* update twindev schemas ([d2bb94b](https://github.com/iotaledger/twin-immutable-proof/commit/d2bb94b31e61f899e41dbca1b1aeb2b3bb70b229))
|
|
124
|
+
* use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
111
125
|
|
|
112
126
|
|
|
113
127
|
### Bug Fixes
|
|
114
128
|
|
|
115
|
-
* Missing user and node identity on create ([#1](https://github.com/
|
|
129
|
+
* Missing user and node identity on create ([#1](https://github.com/iotaledger/twin-immutable-proof/issues/1)) ([80ea2f9](https://github.com/iotaledger/twin-immutable-proof/commit/80ea2f901afc7531f4a522227a61e6fa1482484d))
|
|
116
130
|
|
|
117
131
|
## 0.0.1 (2025-07-09)
|
|
118
132
|
|
|
119
133
|
|
|
120
134
|
### Features
|
|
121
135
|
|
|
122
|
-
* release to production ([cb7ecff](https://github.com/
|
|
136
|
+
* release to production ([cb7ecff](https://github.com/iotaledger/twin-immutable-proof/commit/cb7ecff3e9a1ec8b4391d7efea4a58057b8b66c6))
|
|
123
137
|
|
|
124
|
-
## [0.0.1-next.35](https://github.com/
|
|
138
|
+
## [0.0.1-next.35](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.1-next.34...immutable-proof-models-v0.0.1-next.35) (2025-06-12)
|
|
125
139
|
|
|
126
140
|
|
|
127
141
|
### Features
|
|
128
142
|
|
|
129
|
-
* update dependencies ([7d6b321](https://github.com/
|
|
143
|
+
* update dependencies ([7d6b321](https://github.com/iotaledger/twin-immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
130
144
|
|
|
131
|
-
## [0.0.1-next.34](https://github.com/
|
|
145
|
+
## [0.0.1-next.34](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.1-next.33...immutable-proof-models-v0.0.1-next.34) (2025-06-03)
|
|
132
146
|
|
|
133
147
|
|
|
134
148
|
### Features
|
|
135
149
|
|
|
136
|
-
* update ts-to-schema generation ([c4fc864](https://github.com/
|
|
150
|
+
* update ts-to-schema generation ([c4fc864](https://github.com/iotaledger/twin-immutable-proof/commit/c4fc8646e7b8ee040d356f7f0f3b2d6f4ac63e40))
|
|
137
151
|
|
|
138
|
-
## [0.0.1-next.33](https://github.com/
|
|
152
|
+
## [0.0.1-next.33](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.1-next.32...immutable-proof-models-v0.0.1-next.33) (2025-05-28)
|
|
139
153
|
|
|
140
154
|
|
|
141
155
|
### Features
|
|
142
156
|
|
|
143
|
-
* update data types to use fully qualified names ([e94d0f5](https://github.com/
|
|
157
|
+
* update data types to use fully qualified names ([e94d0f5](https://github.com/iotaledger/twin-immutable-proof/commit/e94d0f5db93856b5b59cfd34e55252fa13a7f4e0))
|
|
144
158
|
|
|
145
|
-
## [0.0.1-next.32](https://github.com/
|
|
159
|
+
## [0.0.1-next.32](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.1-next.31...immutable-proof-models-v0.0.1-next.32) (2025-04-17)
|
|
146
160
|
|
|
147
161
|
|
|
148
162
|
### Features
|
|
149
163
|
|
|
150
|
-
* use shared store mechanism ([#3](https://github.com/
|
|
164
|
+
* use shared store mechanism ([#3](https://github.com/iotaledger/twin-immutable-proof/issues/3)) ([7042a40](https://github.com/iotaledger/twin-immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
151
165
|
|
|
152
|
-
## [0.0.1-next.31](https://github.com/
|
|
166
|
+
## [0.0.1-next.31](https://github.com/iotaledger/twin-immutable-proof/compare/immutable-proof-models-v0.0.1-next.30...immutable-proof-models-v0.0.1-next.31) (2025-03-28)
|
|
153
167
|
|
|
154
168
|
|
|
155
169
|
### Bug Fixes
|
|
156
170
|
|
|
157
|
-
* Missing user and node identity on create ([#1](https://github.com/
|
|
171
|
+
* Missing user and node identity on create ([#1](https://github.com/iotaledger/twin-immutable-proof/issues/1)) ([80ea2f9](https://github.com/iotaledger/twin-immutable-proof/commit/80ea2f901afc7531f4a522227a61e6fa1482484d))
|
|
158
172
|
|
|
159
173
|
## v0.0.1-next.30
|
|
160
174
|
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Immutable Proof Models Examples
|
|
2
|
+
|
|
3
|
+
These snippets show how to register data types and then use the immutable proof model contracts in request and response flows.
|
|
4
|
+
|
|
5
|
+
## ImmutableProofDataTypes
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { DataTypeHandlerFactory } from '@twin.org/data-core';
|
|
9
|
+
import { ImmutableProofDataTypes, ImmutableProofTypes } from '@twin.org/immutable-proof-models';
|
|
10
|
+
|
|
11
|
+
ImmutableProofDataTypes.registerTypes();
|
|
12
|
+
|
|
13
|
+
const handler = DataTypeHandlerFactory.get(
|
|
14
|
+
'https://schema.twindev.org/immutable-proof/ImmutableProof'
|
|
15
|
+
);
|
|
16
|
+
console.log(handler.type === ImmutableProofTypes.ImmutableProof); // true
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Model Contracts
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type {
|
|
23
|
+
IImmutableProofCreateRequest,
|
|
24
|
+
IImmutableProofGetResponse,
|
|
25
|
+
IImmutableProofVerifyResponse
|
|
26
|
+
} from '@twin.org/immutable-proof-models';
|
|
27
|
+
|
|
28
|
+
const createRequest: IImmutableProofCreateRequest = {
|
|
29
|
+
body: {
|
|
30
|
+
document: {
|
|
31
|
+
'@context': 'https://schema.org',
|
|
32
|
+
type: 'Person',
|
|
33
|
+
name: 'Alice Example'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
console.log(createRequest.body.document.type); // Person
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { ImmutableProofFailure, ImmutableProofTypes } from '@twin.org/immutable-proof-models';
|
|
43
|
+
import type {
|
|
44
|
+
IImmutableProofGetResponse,
|
|
45
|
+
IImmutableProofVerifyResponse
|
|
46
|
+
} from '@twin.org/immutable-proof-models';
|
|
47
|
+
|
|
48
|
+
const getResponse: IImmutableProofGetResponse = {
|
|
49
|
+
body: {
|
|
50
|
+
'@context': ['https://www.w3.org/2018/credentials/v1'],
|
|
51
|
+
type: ['VerifiableCredential', ImmutableProofTypes.ImmutableProof],
|
|
52
|
+
issuer: 'did:iota:tst:issuer',
|
|
53
|
+
id: 'immutable-proof:01JABCDEF1234567890',
|
|
54
|
+
credentialSubject: {
|
|
55
|
+
id: 'https://example.org/documents/100',
|
|
56
|
+
proofIntegrity: 'yEr9VvYCGDh2Ww1YwQMehUy4LlW35mLhX8j8R8U6x0g='
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const verifyResponse: IImmutableProofVerifyResponse = {
|
|
62
|
+
body: {
|
|
63
|
+
'@context': 'https://schema.twindev.org/immutable-proof',
|
|
64
|
+
type: ImmutableProofTypes.ImmutableProofVerification,
|
|
65
|
+
verified: false,
|
|
66
|
+
failure: ImmutableProofFailure.ProofMissing
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
console.log(getResponse.body.id); // immutable-proof:01JABCDEF1234567890
|
|
71
|
+
console.log(verifyResponse.body.failure); // proof-missing
|
|
72
|
+
```
|
|
@@ -4,33 +4,32 @@ Interface describing an immutable proof state.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### @context?
|
|
7
|
+
### @context? {#context}
|
|
8
8
|
|
|
9
|
-
> `optional` **@context
|
|
9
|
+
> `optional` **@context?**: \[`"https://schema.twindev.org/immutable-proof/"`, `"https://schema.twindev.org/common/"`\]
|
|
10
10
|
|
|
11
11
|
JSON-LD Context.
|
|
12
12
|
|
|
13
13
|
***
|
|
14
14
|
|
|
15
|
-
### type?
|
|
15
|
+
### type? {#type}
|
|
16
16
|
|
|
17
|
-
> `optional` **type
|
|
17
|
+
> `optional` **type?**: `"ImmutableProof"`
|
|
18
18
|
|
|
19
19
|
JSON-LD Type.
|
|
20
20
|
|
|
21
21
|
***
|
|
22
22
|
|
|
23
|
-
### id?
|
|
23
|
+
### id? {#id}
|
|
24
24
|
|
|
25
|
-
> `optional` **id
|
|
25
|
+
> `optional` **id?**: `string`
|
|
26
26
|
|
|
27
27
|
The id of the object associated with the proof.
|
|
28
28
|
|
|
29
29
|
***
|
|
30
30
|
|
|
31
|
-
### proofIntegrity
|
|
31
|
+
### proofIntegrity {#proofintegrity}
|
|
32
32
|
|
|
33
33
|
> **proofIntegrity**: `string`
|
|
34
34
|
|
|
35
35
|
The integrity hash of the object associated with the proof.
|
|
36
|
-
json-ld namespace:twin-common
|
|
@@ -8,7 +8,7 @@ Interface describing an immutable proof contract.
|
|
|
8
8
|
|
|
9
9
|
## Methods
|
|
10
10
|
|
|
11
|
-
### create()
|
|
11
|
+
### create() {#create}
|
|
12
12
|
|
|
13
13
|
> **create**(`document`): `Promise`\<`string`\>
|
|
14
14
|
|
|
@@ -30,7 +30,7 @@ The id of the new proof.
|
|
|
30
30
|
|
|
31
31
|
***
|
|
32
32
|
|
|
33
|
-
### get()
|
|
33
|
+
### get() {#get}
|
|
34
34
|
|
|
35
35
|
> **get**(`id`): `Promise`\<`IDidVerifiableCredential`\>
|
|
36
36
|
|
|
@@ -56,7 +56,7 @@ NotFoundError if the proof is not found.
|
|
|
56
56
|
|
|
57
57
|
***
|
|
58
58
|
|
|
59
|
-
### verify()
|
|
59
|
+
### verify() {#verify}
|
|
60
60
|
|
|
61
61
|
> **verify**(`id`): `Promise`\<[`IImmutableProofVerification`](IImmutableProofVerification.md)\>
|
|
62
62
|
|
|
@@ -82,7 +82,7 @@ NotFoundError if the proof is not found.
|
|
|
82
82
|
|
|
83
83
|
***
|
|
84
84
|
|
|
85
|
-
### removeVerifiable()
|
|
85
|
+
### removeVerifiable() {#removeverifiable}
|
|
86
86
|
|
|
87
87
|
> **removeVerifiable**(`id`): `Promise`\<`void`\>
|
|
88
88
|
|
|
@@ -4,9 +4,9 @@ Get a proof.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### headers?
|
|
7
|
+
### headers? {#headers}
|
|
8
8
|
|
|
9
|
-
> `optional` **headers
|
|
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 @@ Response to getting an immutable proof.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### headers?
|
|
7
|
+
### headers? {#headers}
|
|
8
8
|
|
|
9
|
-
> `optional` **headers
|
|
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**: `IDidVerifiableCredential`
|
|
22
22
|
|
|
@@ -4,15 +4,15 @@ Interface describing an immutable proof receipt.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### @context?
|
|
7
|
+
### @context? {#context}
|
|
8
8
|
|
|
9
|
-
> `optional` **@context
|
|
9
|
+
> `optional` **@context?**: \[`"https://schema.twindev.org/immutable-proof/"`, `"https://schema.twindev.org/common/"`\]
|
|
10
10
|
|
|
11
11
|
JSON-LD Context.
|
|
12
12
|
|
|
13
13
|
***
|
|
14
14
|
|
|
15
|
-
### type
|
|
15
|
+
### type {#type}
|
|
16
16
|
|
|
17
17
|
> **type**: `"ImmutableProofReceipt"`
|
|
18
18
|
|
|
@@ -20,18 +20,16 @@ JSON-LD Type.
|
|
|
20
20
|
|
|
21
21
|
***
|
|
22
22
|
|
|
23
|
-
### immutableReceipt?
|
|
23
|
+
### immutableReceipt? {#immutablereceipt}
|
|
24
24
|
|
|
25
|
-
> `optional` **immutableReceipt
|
|
25
|
+
> `optional` **immutableReceipt?**: `IJsonLdNodeObject`
|
|
26
26
|
|
|
27
27
|
The immutable receipt detail for where the proof is stored.
|
|
28
|
-
json-ld id
|
|
29
28
|
|
|
30
29
|
***
|
|
31
30
|
|
|
32
|
-
### verifiableStorageId?
|
|
31
|
+
### verifiableStorageId? {#verifiablestorageid}
|
|
33
32
|
|
|
34
|
-
> `optional` **verifiableStorageId
|
|
33
|
+
> `optional` **verifiableStorageId?**: `string`
|
|
35
34
|
|
|
36
35
|
The verifiable storage id for where the proof is stored.
|
|
37
|
-
json-ld id
|
|
@@ -4,7 +4,7 @@ Interface describing an immutable proof verification.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### @context
|
|
7
|
+
### @context {#context}
|
|
8
8
|
|
|
9
9
|
> **@context**: `"https://schema.twindev.org/immutable-proof/"`
|
|
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**: `"ImmutableProofVerification"`
|
|
18
18
|
|
|
@@ -20,18 +20,16 @@ JSON-LD Type.
|
|
|
20
20
|
|
|
21
21
|
***
|
|
22
22
|
|
|
23
|
-
### verified
|
|
23
|
+
### verified {#verified}
|
|
24
24
|
|
|
25
25
|
> **verified**: `boolean`
|
|
26
26
|
|
|
27
27
|
Was the verification successful.
|
|
28
|
-
json-ld namespace:twin-common
|
|
29
28
|
|
|
30
29
|
***
|
|
31
30
|
|
|
32
|
-
### failure?
|
|
31
|
+
### failure? {#failure}
|
|
33
32
|
|
|
34
|
-
> `optional` **failure
|
|
33
|
+
> `optional` **failure?**: [`ImmutableProofFailure`](../type-aliases/ImmutableProofFailure.md)
|
|
35
34
|
|
|
36
35
|
If the verification was unsuccessful the failure reason.
|
|
37
|
-
json-ld type:schema:Text
|
|
@@ -4,9 +4,9 @@ Verify a proof.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### headers?
|
|
7
|
+
### headers? {#headers}
|
|
8
8
|
|
|
9
|
-
> `optional` **headers
|
|
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 @@ Response to verifying an immutable proof.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### headers?
|
|
7
|
+
### headers? {#headers}
|
|
8
8
|
|
|
9
|
-
> `optional` **headers
|
|
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**: [`IImmutableProofVerification`](IImmutableProofVerification.md)
|
|
22
22
|
|
|
@@ -6,37 +6,37 @@ The contexts of immutable proof data.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
### Namespace
|
|
9
|
+
### Namespace {#namespace}
|
|
10
10
|
|
|
11
11
|
> `readonly` **Namespace**: `"https://schema.twindev.org/immutable-proof/"` = `"https://schema.twindev.org/immutable-proof/"`
|
|
12
12
|
|
|
13
13
|
The canonical RDF namespace URI for Immutable Proof.
|
|
14
14
|
|
|
15
|
-
### Context
|
|
15
|
+
### Context {#context}
|
|
16
16
|
|
|
17
17
|
> `readonly` **Context**: `"https://schema.twindev.org/immutable-proof/"` = `"https://schema.twindev.org/immutable-proof/"`
|
|
18
18
|
|
|
19
19
|
The value to use in context for Immutable Proof.
|
|
20
20
|
|
|
21
|
-
### JsonLdContext
|
|
21
|
+
### JsonLdContext {#jsonldcontext}
|
|
22
22
|
|
|
23
23
|
> `readonly` **JsonLdContext**: `"https://schema.twindev.org/immutable-proof/types.jsonld"` = `"https://schema.twindev.org/immutable-proof/types.jsonld"`
|
|
24
24
|
|
|
25
25
|
The JSON-LD Context URL for Immutable Proof.
|
|
26
26
|
|
|
27
|
-
### NamespaceCommon
|
|
27
|
+
### NamespaceCommon {#namespacecommon}
|
|
28
28
|
|
|
29
29
|
> `readonly` **NamespaceCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
|
|
30
30
|
|
|
31
31
|
The canonical RDF namespace URI for TWIN Common.
|
|
32
32
|
|
|
33
|
-
### ContextCommon
|
|
33
|
+
### ContextCommon {#contextcommon}
|
|
34
34
|
|
|
35
35
|
> `readonly` **ContextCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
|
|
36
36
|
|
|
37
37
|
The value to use in JSON-LD context for TWIN Common.
|
|
38
38
|
|
|
39
|
-
### JsonLdContextCommon
|
|
39
|
+
### JsonLdContextCommon {#jsonldcontextcommon}
|
|
40
40
|
|
|
41
41
|
> `readonly` **JsonLdContextCommon**: `"https://schema.twindev.org/common/types.jsonld"` = `"https://schema.twindev.org/common/types.jsonld"`
|
|
42
42
|
|
|
@@ -6,25 +6,25 @@ The failure reason of the proof.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
### NotIssued
|
|
9
|
+
### NotIssued {#notissued}
|
|
10
10
|
|
|
11
11
|
> `readonly` **NotIssued**: `"notIssued"` = `"notIssued"`
|
|
12
12
|
|
|
13
13
|
Proof not yet issued.
|
|
14
14
|
|
|
15
|
-
### ProofMissing
|
|
15
|
+
### ProofMissing {#proofmissing}
|
|
16
16
|
|
|
17
17
|
> `readonly` **ProofMissing**: `"proofMissing"` = `"proofMissing"`
|
|
18
18
|
|
|
19
19
|
Proof missing.
|
|
20
20
|
|
|
21
|
-
### VerificationFailure
|
|
21
|
+
### VerificationFailure {#verificationfailure}
|
|
22
22
|
|
|
23
23
|
> `readonly` **VerificationFailure**: `"verificationFailure"` = `"verificationFailure"`
|
|
24
24
|
|
|
25
25
|
Verification failure.
|
|
26
26
|
|
|
27
|
-
### Revoked
|
|
27
|
+
### Revoked {#revoked}
|
|
28
28
|
|
|
29
29
|
> `readonly` **Revoked**: `"revoked"` = `"revoked"`
|
|
30
30
|
|
|
@@ -6,20 +6,26 @@ The types of immutable proof data.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
### ImmutableProof
|
|
9
|
+
### ImmutableProof {#immutableproof}
|
|
10
10
|
|
|
11
11
|
> `readonly` **ImmutableProof**: `"ImmutableProof"` = `"ImmutableProof"`
|
|
12
12
|
|
|
13
13
|
Represents Immutable Proof.
|
|
14
14
|
|
|
15
|
-
### ImmutableProofReceipt
|
|
15
|
+
### ImmutableProofReceipt {#immutableproofreceipt}
|
|
16
16
|
|
|
17
17
|
> `readonly` **ImmutableProofReceipt**: `"ImmutableProofReceipt"` = `"ImmutableProofReceipt"`
|
|
18
18
|
|
|
19
19
|
Represents Immutable Proof Receipt.
|
|
20
20
|
|
|
21
|
-
### ImmutableProofVerification
|
|
21
|
+
### ImmutableProofVerification {#immutableproofverification}
|
|
22
22
|
|
|
23
23
|
> `readonly` **ImmutableProofVerification**: `"ImmutableProofVerification"` = `"ImmutableProofVerification"`
|
|
24
24
|
|
|
25
25
|
Represents Immutable Proof Verification.
|
|
26
|
+
|
|
27
|
+
### ImmutableProofFailure {#immutableprooffailure}
|
|
28
|
+
|
|
29
|
+
> `readonly` **ImmutableProofFailure**: `"ImmutableProofFailure"` = `"ImmutableProofFailure"`
|
|
30
|
+
|
|
31
|
+
Represents Immutable Proof Failure.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-models",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.12",
|
|
4
|
+
"description": "Shared model contracts, schema types, and context constants for immutable proof workflows",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/immutable-proof.git",
|
|
8
8
|
"directory": "packages/immutable-proof-models"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"schemas"
|
|
51
51
|
],
|
|
52
52
|
"bugs": {
|
|
53
|
-
"url": "git+https://github.com/
|
|
53
|
+
"url": "git+https://github.com/iotaledger/immutable-proof/issues"
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://twindev.org"
|
|
56
56
|
}
|