@twin.org/immutable-proof-models 0.0.3-next.7 → 0.0.3-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IImmutableProof.js.map +1 -1
- package/dist/es/models/IImmutableProofComponent.js.map +1 -1
- package/dist/es/models/IImmutableProofReceipt.js +2 -0
- package/dist/es/models/IImmutableProofReceipt.js.map +1 -0
- package/dist/es/models/api/IImmutableProofGetResponse.js.map +1 -1
- package/dist/es/models/immutableProofFailure.js +4 -8
- package/dist/es/models/immutableProofFailure.js.map +1 -1
- package/dist/es/models/immutableProofTypes.js +4 -0
- package/dist/es/models/immutableProofTypes.js.map +1 -1
- package/dist/es/schemas/ImmutableProof.json +16 -37
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/IImmutableProof.d.ts +6 -32
- package/dist/types/models/IImmutableProofComponent.d.ts +2 -2
- package/dist/types/models/IImmutableProofReceipt.d.ts +26 -0
- package/dist/types/models/api/IImmutableProofGetResponse.d.ts +2 -2
- package/dist/types/models/immutableProofFailure.d.ts +4 -8
- package/dist/types/models/immutableProofTypes.d.ts +4 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IImmutableProof.md +10 -46
- package/docs/reference/interfaces/IImmutableProofComponent.md +2 -2
- package/docs/reference/interfaces/IImmutableProofGetResponse.md +1 -1
- package/docs/reference/interfaces/IImmutableProofReceipt.md +37 -0
- package/docs/reference/variables/ImmutableProofFailure.md +6 -12
- package/docs/reference/variables/ImmutableProofTypes.md +6 -0
- package/package.json +1 -1
package/dist/es/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./models/api/IImmutableProofVerifyResponse.js";
|
|
|
9
9
|
export * from "./models/eventBus/IImmutableProofEventBusProofCreated.js";
|
|
10
10
|
export * from "./models/IImmutableProof.js";
|
|
11
11
|
export * from "./models/IImmutableProofComponent.js";
|
|
12
|
+
export * from "./models/IImmutableProofReceipt.js";
|
|
12
13
|
export * from "./models/IImmutableProofVerification.js";
|
|
13
14
|
export * from "./models/immutableProofContexts.js";
|
|
14
15
|
export * from "./models/immutableProofFailure.js";
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AACzE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./dataTypes/immutableProofDataTypes.js\";\nexport * from \"./models/api/IImmutableProofCreateRequest.js\";\nexport * from \"./models/api/IImmutableProofGetRequest.js\";\nexport * from \"./models/api/IImmutableProofGetResponse.js\";\nexport * from \"./models/api/IImmutableProofVerifyRequest.js\";\nexport * from \"./models/api/IImmutableProofVerifyResponse.js\";\nexport * from \"./models/eventBus/IImmutableProofEventBusProofCreated.js\";\nexport * from \"./models/IImmutableProof.js\";\nexport * from \"./models/IImmutableProofComponent.js\";\nexport * from \"./models/IImmutableProofVerification.js\";\nexport * from \"./models/immutableProofContexts.js\";\nexport * from \"./models/immutableProofFailure.js\";\nexport * from \"./models/immutableProofTopics.js\";\nexport * from \"./models/immutableProofTypes.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AACzE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./dataTypes/immutableProofDataTypes.js\";\nexport * from \"./models/api/IImmutableProofCreateRequest.js\";\nexport * from \"./models/api/IImmutableProofGetRequest.js\";\nexport * from \"./models/api/IImmutableProofGetResponse.js\";\nexport * from \"./models/api/IImmutableProofVerifyRequest.js\";\nexport * from \"./models/api/IImmutableProofVerifyResponse.js\";\nexport * from \"./models/eventBus/IImmutableProofEventBusProofCreated.js\";\nexport * from \"./models/IImmutableProof.js\";\nexport * from \"./models/IImmutableProofComponent.js\";\nexport * from \"./models/IImmutableProofReceipt.js\";\nexport * from \"./models/IImmutableProofVerification.js\";\nexport * from \"./models/immutableProofContexts.js\";\nexport * from \"./models/immutableProofFailure.js\";\nexport * from \"./models/immutableProofTopics.js\";\nexport * from \"./models/immutableProofTypes.js\";\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 {
|
|
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":"IImmutableProofComponent.js","sourceRoot":"","sources":["../../../src/models/IImmutableProofComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {
|
|
1
|
+
{"version":3,"file":"IImmutableProofComponent.js","sourceRoot":"","sources":["../../../src/models/IImmutableProofComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { IDidVerifiableCredential } from \"@twin.org/standards-w3c-did\";\nimport type { IImmutableProofVerification } from \"./IImmutableProofVerification.js\";\n\n/**\n * Interface describing an immutable proof contract.\n */\nexport interface IImmutableProofComponent extends IComponent {\n\t/**\n\t * Create a new proof.\n\t * @param document The document to create the proof for.\n\t * @returns The id of the new proof.\n\t */\n\tcreate(document: IJsonLdNodeObject): Promise<string>;\n\n\t/**\n\t * Get a proof.\n\t * @param id The id of the proof to get.\n\t * @returns The proof.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tget(id: string): Promise<IDidVerifiableCredential>;\n\n\t/**\n\t * Verify a proof.\n\t * @param id The id of the proof to verify.\n\t * @returns The result of the verification and any failures.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tverify(id: string): Promise<IImmutableProofVerification>;\n\n\t/**\n\t * Remove the verifiable storage for the proof.\n\t * @param id The id of the proof to remove the storage from.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tremoveVerifiable(id: string): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IImmutableProofGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IImmutableProofGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {
|
|
1
|
+
{"version":3,"file":"IImmutableProofGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IImmutableProofGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDidVerifiableCredential } from \"@twin.org/standards-w3c-did\";\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Response to getting an immutable proof.\n */\nexport interface IImmutableProofGetResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The response body.\n\t */\n\tbody: IDidVerifiableCredential;\n}\n"]}
|
|
@@ -14,16 +14,12 @@ export const ImmutableProofFailure = {
|
|
|
14
14
|
*/
|
|
15
15
|
ProofMissing: "proofMissing",
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Verification failure.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
VerificationFailure: "verificationFailure",
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Revoked.
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Signature mismatch.
|
|
26
|
-
*/
|
|
27
|
-
SignatureMismatch: "signatureMismatch"
|
|
23
|
+
Revoked: "revoked"
|
|
28
24
|
};
|
|
29
25
|
//# sourceMappingURL=immutableProofFailure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"immutableProofFailure.js","sourceRoot":"","sources":["../../../src/models/immutableProofFailure.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"immutableProofFailure.js","sourceRoot":"","sources":["../../../src/models/immutableProofFailure.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,OAAO,EAAE,SAAS;CACT,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The failure reason of the proof.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ImmutableProofFailure = {\n\t/**\n\t * Proof not yet issued.\n\t */\n\tNotIssued: \"notIssued\",\n\n\t/**\n\t * Proof missing.\n\t */\n\tProofMissing: \"proofMissing\",\n\n\t/**\n\t * Verification failure.\n\t */\n\tVerificationFailure: \"verificationFailure\",\n\n\t/**\n\t * Revoked.\n\t */\n\tRevoked: \"revoked\"\n} as const;\n\n/**\n * The failure reason of the proof.\n */\nexport type ImmutableProofFailure =\n\t(typeof ImmutableProofFailure)[keyof typeof ImmutableProofFailure];\n"]}
|
|
@@ -9,6 +9,10 @@ export const ImmutableProofTypes = {
|
|
|
9
9
|
* Represents Immutable Proof.
|
|
10
10
|
*/
|
|
11
11
|
ImmutableProof: "ImmutableProof",
|
|
12
|
+
/**
|
|
13
|
+
* Represents Immutable Proof Receipt.
|
|
14
|
+
*/
|
|
15
|
+
ImmutableProofReceipt: "ImmutableProofReceipt",
|
|
12
16
|
/**
|
|
13
17
|
* Represents Immutable Proof Verification.
|
|
14
18
|
*/
|
|
@@ -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,0BAA0B,EAAE,4BAA4B;CAC/C,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 Verification.\n\t */\n\tImmutableProofVerification: \"ImmutableProofVerification\"\n} as const;\n\n/**\n * The types of immutable proof data.\n */\nexport type ImmutableProofTypes = (typeof ImmutableProofTypes)[keyof typeof ImmutableProofTypes];\n"]}
|
|
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;CAC/C,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} as const;\n\n/**\n * The types of immutable proof data.\n */\nexport type ImmutableProofTypes = (typeof ImmutableProofTypes)[keyof typeof ImmutableProofTypes];\n"]}
|
|
@@ -6,21 +6,19 @@
|
|
|
6
6
|
"properties": {
|
|
7
7
|
"@context": {
|
|
8
8
|
"type": "array",
|
|
9
|
-
"minItems": 2,
|
|
10
|
-
"description": "JSON-LD Context.",
|
|
11
|
-
"prefixItems": [
|
|
12
|
-
{
|
|
13
|
-
"type": "string",
|
|
14
|
-
"const": "https://schema.twindev.org/immutable-proof/"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"type": "string",
|
|
18
|
-
"const": "https://schema.twindev.org/common/"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
9
|
"items": {
|
|
22
|
-
"
|
|
23
|
-
|
|
10
|
+
"allOf": [
|
|
11
|
+
{
|
|
12
|
+
"type": "string",
|
|
13
|
+
"const": "https://schema.twindev.org/immutable-proof/"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "string",
|
|
17
|
+
"const": "https://schema.twindev.org/common/"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"description": "JSON-LD Context."
|
|
24
22
|
},
|
|
25
23
|
"type": {
|
|
26
24
|
"type": "string",
|
|
@@ -29,34 +27,15 @@
|
|
|
29
27
|
},
|
|
30
28
|
"id": {
|
|
31
29
|
"type": "string",
|
|
32
|
-
"description": "The id of the proof."
|
|
30
|
+
"description": "The id of the object associated with the proof."
|
|
33
31
|
},
|
|
34
|
-
"
|
|
32
|
+
"proofIntegrity": {
|
|
35
33
|
"type": "string",
|
|
36
|
-
"description": "The
|
|
37
|
-
},
|
|
38
|
-
"proofObjectHash": {
|
|
39
|
-
"type": "string",
|
|
40
|
-
"description": "The hash of the object associated with the proof. json-ld type:schema:Text"
|
|
41
|
-
},
|
|
42
|
-
"verifiableStorageId": {
|
|
43
|
-
"type": "string",
|
|
44
|
-
"description": "The verifiable storage id for where the proof is stored. json-ld type:schema:identifier"
|
|
45
|
-
},
|
|
46
|
-
"proof": {
|
|
47
|
-
"$ref": "https://schema.twindev.org/w3c-did/DataIntegrityProof",
|
|
48
|
-
"description": "The proof which can be undefined if it has not yet been issued. json-ld id"
|
|
49
|
-
},
|
|
50
|
-
"immutableReceipt": {
|
|
51
|
-
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
52
|
-
"description": "The immutable receipt detail for where the proof is stored. json-ld id"
|
|
34
|
+
"description": "The integrity hash of the object associated with the proof. json-ld namespace:twin-common"
|
|
53
35
|
}
|
|
54
36
|
},
|
|
55
37
|
"required": [
|
|
56
|
-
"
|
|
57
|
-
"type",
|
|
58
|
-
"id",
|
|
59
|
-
"proofObjectHash"
|
|
38
|
+
"proofIntegrity"
|
|
60
39
|
],
|
|
61
40
|
"additionalProperties": false
|
|
62
41
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./models/api/IImmutableProofVerifyResponse.js";
|
|
|
7
7
|
export * from "./models/eventBus/IImmutableProofEventBusProofCreated.js";
|
|
8
8
|
export * from "./models/IImmutableProof.js";
|
|
9
9
|
export * from "./models/IImmutableProofComponent.js";
|
|
10
|
+
export * from "./models/IImmutableProofReceipt.js";
|
|
10
11
|
export * from "./models/IImmutableProofVerification.js";
|
|
11
12
|
export * from "./models/immutableProofContexts.js";
|
|
12
13
|
export * from "./models/immutableProofFailure.js";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
-
import type { IDataIntegrityProof } from "@twin.org/standards-w3c-did";
|
|
3
1
|
import type { ImmutableProofContexts } from "./immutableProofContexts.js";
|
|
4
2
|
import type { ImmutableProofTypes } from "./immutableProofTypes.js";
|
|
5
3
|
/**
|
|
@@ -9,42 +7,18 @@ export interface IImmutableProof {
|
|
|
9
7
|
/**
|
|
10
8
|
* JSON-LD Context.
|
|
11
9
|
*/
|
|
12
|
-
"@context"
|
|
13
|
-
typeof ImmutableProofContexts.Context,
|
|
14
|
-
typeof ImmutableProofContexts.ContextCommon,
|
|
15
|
-
...IJsonLdContextDefinitionElement[]
|
|
16
|
-
];
|
|
10
|
+
"@context"?: [typeof ImmutableProofContexts.Context, typeof ImmutableProofContexts.ContextCommon];
|
|
17
11
|
/**
|
|
18
12
|
* JSON-LD Type.
|
|
19
13
|
*/
|
|
20
|
-
type
|
|
21
|
-
/**
|
|
22
|
-
* The id of the proof.
|
|
23
|
-
*/
|
|
24
|
-
id: string;
|
|
14
|
+
type?: typeof ImmutableProofTypes.ImmutableProof;
|
|
25
15
|
/**
|
|
26
16
|
* The id of the object associated with the proof.
|
|
27
|
-
* json-ld type:schema:identifier
|
|
28
|
-
*/
|
|
29
|
-
proofObjectId?: string;
|
|
30
|
-
/**
|
|
31
|
-
* The hash of the object associated with the proof.
|
|
32
|
-
* json-ld type:schema:Text
|
|
33
|
-
*/
|
|
34
|
-
proofObjectHash: string;
|
|
35
|
-
/**
|
|
36
|
-
* The verifiable storage id for where the proof is stored.
|
|
37
|
-
* json-ld type:schema:identifier
|
|
38
|
-
*/
|
|
39
|
-
verifiableStorageId?: string;
|
|
40
|
-
/**
|
|
41
|
-
* The proof which can be undefined if it has not yet been issued.
|
|
42
|
-
* json-ld id
|
|
43
17
|
*/
|
|
44
|
-
|
|
18
|
+
id?: string;
|
|
45
19
|
/**
|
|
46
|
-
* The
|
|
47
|
-
* json-ld
|
|
20
|
+
* The integrity hash of the object associated with the proof.
|
|
21
|
+
* json-ld namespace:twin-common
|
|
48
22
|
*/
|
|
49
|
-
|
|
23
|
+
proofIntegrity: string;
|
|
50
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IComponent } from "@twin.org/core";
|
|
2
2
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
3
|
-
import type {
|
|
3
|
+
import type { IDidVerifiableCredential } from "@twin.org/standards-w3c-did";
|
|
4
4
|
import type { IImmutableProofVerification } from "./IImmutableProofVerification.js";
|
|
5
5
|
/**
|
|
6
6
|
* Interface describing an immutable proof contract.
|
|
@@ -18,7 +18,7 @@ export interface IImmutableProofComponent extends IComponent {
|
|
|
18
18
|
* @returns The proof.
|
|
19
19
|
* @throws NotFoundError if the proof is not found.
|
|
20
20
|
*/
|
|
21
|
-
get(id: string): Promise<
|
|
21
|
+
get(id: string): Promise<IDidVerifiableCredential>;
|
|
22
22
|
/**
|
|
23
23
|
* Verify a proof.
|
|
24
24
|
* @param id The id of the proof to verify.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { ImmutableProofContexts } from "./immutableProofContexts.js";
|
|
3
|
+
import type { ImmutableProofTypes } from "./immutableProofTypes.js";
|
|
4
|
+
/**
|
|
5
|
+
* Interface describing an immutable proof receipt.
|
|
6
|
+
*/
|
|
7
|
+
export interface IImmutableProofReceipt {
|
|
8
|
+
/**
|
|
9
|
+
* JSON-LD Context.
|
|
10
|
+
*/
|
|
11
|
+
"@context"?: [typeof ImmutableProofContexts.Context, typeof ImmutableProofContexts.ContextCommon];
|
|
12
|
+
/**
|
|
13
|
+
* JSON-LD Type.
|
|
14
|
+
*/
|
|
15
|
+
type: typeof ImmutableProofTypes.ImmutableProofReceipt;
|
|
16
|
+
/**
|
|
17
|
+
* The immutable receipt detail for where the proof is stored.
|
|
18
|
+
* json-ld id
|
|
19
|
+
*/
|
|
20
|
+
immutableReceipt?: IJsonLdNodeObject;
|
|
21
|
+
/**
|
|
22
|
+
* The verifiable storage id for where the proof is stored.
|
|
23
|
+
* json-ld id
|
|
24
|
+
*/
|
|
25
|
+
verifiableStorageId?: string;
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { IDidVerifiableCredential } from "@twin.org/standards-w3c-did";
|
|
1
2
|
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
-
import type { IImmutableProof } from "../IImmutableProof.js";
|
|
3
3
|
/**
|
|
4
4
|
* Response to getting an immutable proof.
|
|
5
5
|
*/
|
|
@@ -13,5 +13,5 @@ export interface IImmutableProofGetResponse {
|
|
|
13
13
|
/**
|
|
14
14
|
* The response body.
|
|
15
15
|
*/
|
|
16
|
-
body:
|
|
16
|
+
body: IDidVerifiableCredential;
|
|
17
17
|
}
|
|
@@ -11,17 +11,13 @@ export declare const ImmutableProofFailure: {
|
|
|
11
11
|
*/
|
|
12
12
|
readonly ProofMissing: "proofMissing";
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Verification failure.
|
|
15
15
|
*/
|
|
16
|
-
readonly
|
|
16
|
+
readonly VerificationFailure: "verificationFailure";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Revoked.
|
|
19
19
|
*/
|
|
20
|
-
readonly
|
|
21
|
-
/**
|
|
22
|
-
* Signature mismatch.
|
|
23
|
-
*/
|
|
24
|
-
readonly SignatureMismatch: "signatureMismatch";
|
|
20
|
+
readonly Revoked: "revoked";
|
|
25
21
|
};
|
|
26
22
|
/**
|
|
27
23
|
* The failure reason of the proof.
|
|
@@ -6,6 +6,10 @@ export declare const ImmutableProofTypes: {
|
|
|
6
6
|
* Represents Immutable Proof.
|
|
7
7
|
*/
|
|
8
8
|
readonly ImmutableProof: "ImmutableProof";
|
|
9
|
+
/**
|
|
10
|
+
* Represents Immutable Proof Receipt.
|
|
11
|
+
*/
|
|
12
|
+
readonly ImmutableProofReceipt: "ImmutableProofReceipt";
|
|
9
13
|
/**
|
|
10
14
|
* Represents Immutable Proof Verification.
|
|
11
15
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/immutable-proof-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.9](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-models-v0.0.3-next.8...immutable-proof-models-v0.0.3-next.9) (2026-02-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **immutable-proof-models:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-models-v0.0.3-next.7...immutable-proof-models-v0.0.3-next.8) (2026-02-10)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* immutable proof as vc ([#31](https://github.com/twinfoundation/immutable-proof/issues/31)) ([79cdb03](https://github.com/twinfoundation/immutable-proof/commit/79cdb03eb86c4f6d2ab1d5bf235f74ff74e8b877))
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.7](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-models-v0.0.3-next.6...immutable-proof-models-v0.0.3-next.7) (2026-02-05)
|
|
4
18
|
|
|
5
19
|
|
package/docs/reference/index.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
- [IImmutableProof](interfaces/IImmutableProof.md)
|
|
10
10
|
- [IImmutableProofComponent](interfaces/IImmutableProofComponent.md)
|
|
11
|
+
- [IImmutableProofReceipt](interfaces/IImmutableProofReceipt.md)
|
|
11
12
|
- [IImmutableProofVerification](interfaces/IImmutableProofVerification.md)
|
|
12
13
|
- [IImmutableProofCreateRequest](interfaces/IImmutableProofCreateRequest.md)
|
|
13
14
|
- [IImmutableProofGetRequest](interfaces/IImmutableProofGetRequest.md)
|
|
@@ -4,69 +4,33 @@ Interface describing an immutable proof state.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### @context
|
|
7
|
+
### @context?
|
|
8
8
|
|
|
9
|
-
> **@context**: \[`"https://schema.twindev.org/immutable-proof/"`, `"https://schema.twindev.org/common/"
|
|
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?
|
|
16
16
|
|
|
17
|
-
> **type**: `"ImmutableProof"`
|
|
17
|
+
> `optional` **type**: `"ImmutableProof"`
|
|
18
18
|
|
|
19
19
|
JSON-LD Type.
|
|
20
20
|
|
|
21
21
|
***
|
|
22
22
|
|
|
23
|
-
### id
|
|
23
|
+
### id?
|
|
24
24
|
|
|
25
|
-
> **id**: `string`
|
|
26
|
-
|
|
27
|
-
The id of the proof.
|
|
28
|
-
|
|
29
|
-
***
|
|
30
|
-
|
|
31
|
-
### proofObjectId?
|
|
32
|
-
|
|
33
|
-
> `optional` **proofObjectId**: `string`
|
|
25
|
+
> `optional` **id**: `string`
|
|
34
26
|
|
|
35
27
|
The id of the object associated with the proof.
|
|
36
|
-
json-ld type:schema:identifier
|
|
37
|
-
|
|
38
|
-
***
|
|
39
|
-
|
|
40
|
-
### proofObjectHash
|
|
41
|
-
|
|
42
|
-
> **proofObjectHash**: `string`
|
|
43
|
-
|
|
44
|
-
The hash of the object associated with the proof.
|
|
45
|
-
json-ld type:schema:Text
|
|
46
|
-
|
|
47
|
-
***
|
|
48
|
-
|
|
49
|
-
### verifiableStorageId?
|
|
50
|
-
|
|
51
|
-
> `optional` **verifiableStorageId**: `string`
|
|
52
|
-
|
|
53
|
-
The verifiable storage id for where the proof is stored.
|
|
54
|
-
json-ld type:schema:identifier
|
|
55
|
-
|
|
56
|
-
***
|
|
57
|
-
|
|
58
|
-
### proof?
|
|
59
|
-
|
|
60
|
-
> `optional` **proof**: `IDataIntegrityProof`
|
|
61
|
-
|
|
62
|
-
The proof which can be undefined if it has not yet been issued.
|
|
63
|
-
json-ld id
|
|
64
28
|
|
|
65
29
|
***
|
|
66
30
|
|
|
67
|
-
###
|
|
31
|
+
### proofIntegrity
|
|
68
32
|
|
|
69
|
-
>
|
|
33
|
+
> **proofIntegrity**: `string`
|
|
70
34
|
|
|
71
|
-
The
|
|
72
|
-
json-ld
|
|
35
|
+
The integrity hash of the object associated with the proof.
|
|
36
|
+
json-ld namespace:twin-common
|
|
@@ -32,7 +32,7 @@ The id of the new proof.
|
|
|
32
32
|
|
|
33
33
|
### get()
|
|
34
34
|
|
|
35
|
-
> **get**(`id`): `Promise
|
|
35
|
+
> **get**(`id`): `Promise`\<`IDidVerifiableCredential`\>
|
|
36
36
|
|
|
37
37
|
Get a proof.
|
|
38
38
|
|
|
@@ -46,7 +46,7 @@ The id of the proof to get.
|
|
|
46
46
|
|
|
47
47
|
#### Returns
|
|
48
48
|
|
|
49
|
-
`Promise
|
|
49
|
+
`Promise`\<`IDidVerifiableCredential`\>
|
|
50
50
|
|
|
51
51
|
The proof.
|
|
52
52
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Interface: IImmutableProofReceipt
|
|
2
|
+
|
|
3
|
+
Interface describing an immutable proof receipt.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### @context?
|
|
8
|
+
|
|
9
|
+
> `optional` **@context**: \[`"https://schema.twindev.org/immutable-proof/"`, `"https://schema.twindev.org/common/"`\]
|
|
10
|
+
|
|
11
|
+
JSON-LD Context.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### type
|
|
16
|
+
|
|
17
|
+
> **type**: `"ImmutableProofReceipt"`
|
|
18
|
+
|
|
19
|
+
JSON-LD Type.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### immutableReceipt?
|
|
24
|
+
|
|
25
|
+
> `optional` **immutableReceipt**: `IJsonLdNodeObject`
|
|
26
|
+
|
|
27
|
+
The immutable receipt detail for where the proof is stored.
|
|
28
|
+
json-ld id
|
|
29
|
+
|
|
30
|
+
***
|
|
31
|
+
|
|
32
|
+
### verifiableStorageId?
|
|
33
|
+
|
|
34
|
+
> `optional` **verifiableStorageId**: `string`
|
|
35
|
+
|
|
36
|
+
The verifiable storage id for where the proof is stored.
|
|
37
|
+
json-ld id
|
|
@@ -18,20 +18,14 @@ Proof not yet issued.
|
|
|
18
18
|
|
|
19
19
|
Proof missing.
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### VerificationFailure
|
|
22
22
|
|
|
23
|
-
> `readonly` **
|
|
23
|
+
> `readonly` **VerificationFailure**: `"verificationFailure"` = `"verificationFailure"`
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Verification failure.
|
|
26
26
|
|
|
27
|
-
###
|
|
27
|
+
### Revoked
|
|
28
28
|
|
|
29
|
-
> `readonly` **
|
|
29
|
+
> `readonly` **Revoked**: `"revoked"` = `"revoked"`
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### SignatureMismatch
|
|
34
|
-
|
|
35
|
-
> `readonly` **SignatureMismatch**: `"signatureMismatch"` = `"signatureMismatch"`
|
|
36
|
-
|
|
37
|
-
Signature mismatch.
|
|
31
|
+
Revoked.
|
|
@@ -12,6 +12,12 @@ The types of immutable proof data.
|
|
|
12
12
|
|
|
13
13
|
Represents Immutable Proof.
|
|
14
14
|
|
|
15
|
+
### ImmutableProofReceipt
|
|
16
|
+
|
|
17
|
+
> `readonly` **ImmutableProofReceipt**: `"ImmutableProofReceipt"` = `"ImmutableProofReceipt"`
|
|
18
|
+
|
|
19
|
+
Represents Immutable Proof Receipt.
|
|
20
|
+
|
|
15
21
|
### ImmutableProofVerification
|
|
16
22
|
|
|
17
23
|
> `readonly` **ImmutableProofVerification**: `"ImmutableProofVerification"` = `"ImmutableProofVerification"`
|
package/package.json
CHANGED