@3sixty/immutable-proof-models 0.0.0-stage → 0.20.0-next.0

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 (108) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +24 -2
  3. package/dist/es/compiled/validators.js +294 -0
  4. package/dist/es/compiled/validators.js.map +1 -0
  5. package/dist/es/dataTypes/immutableProofDataTypes.js +55 -0
  6. package/dist/es/dataTypes/immutableProofDataTypes.js.map +1 -0
  7. package/dist/es/index.js +24 -0
  8. package/dist/es/index.js.map +1 -0
  9. package/dist/es/models/IImmutableProof.js +2 -0
  10. package/dist/es/models/IImmutableProof.js.map +1 -0
  11. package/dist/es/models/IImmutableProofComponent.js +2 -0
  12. package/dist/es/models/IImmutableProofComponent.js.map +1 -0
  13. package/dist/es/models/IImmutableProofCredential.js +2 -0
  14. package/dist/es/models/IImmutableProofCredential.js.map +1 -0
  15. package/dist/es/models/IImmutableProofDataIntegrity.js +4 -0
  16. package/dist/es/models/IImmutableProofDataIntegrity.js.map +1 -0
  17. package/dist/es/models/IImmutableProofVerification.js +2 -0
  18. package/dist/es/models/IImmutableProofVerification.js.map +1 -0
  19. package/dist/es/models/api/IImmutableProofCreateRequest.js +2 -0
  20. package/dist/es/models/api/IImmutableProofCreateRequest.js.map +1 -0
  21. package/dist/es/models/api/IImmutableProofGetRequest.js +2 -0
  22. package/dist/es/models/api/IImmutableProofGetRequest.js.map +1 -0
  23. package/dist/es/models/api/IImmutableProofGetResponse.js +2 -0
  24. package/dist/es/models/api/IImmutableProofGetResponse.js.map +1 -0
  25. package/dist/es/models/api/IImmutableProofRemoveNotarizationRequest.js +4 -0
  26. package/dist/es/models/api/IImmutableProofRemoveNotarizationRequest.js.map +1 -0
  27. package/dist/es/models/api/IImmutableProofRemoveRequest.js +4 -0
  28. package/dist/es/models/api/IImmutableProofRemoveRequest.js.map +1 -0
  29. package/dist/es/models/api/IImmutableProofVerifyRequest.js +2 -0
  30. package/dist/es/models/api/IImmutableProofVerifyRequest.js.map +1 -0
  31. package/dist/es/models/api/IImmutableProofVerifyResponse.js +2 -0
  32. package/dist/es/models/api/IImmutableProofVerifyResponse.js.map +1 -0
  33. package/dist/es/models/eventBus/IImmutableProofEventBusProofCreated.js +4 -0
  34. package/dist/es/models/eventBus/IImmutableProofEventBusProofCreated.js.map +1 -0
  35. package/dist/es/models/immutableProofContexts.js +33 -0
  36. package/dist/es/models/immutableProofContexts.js.map +1 -0
  37. package/dist/es/models/immutableProofFailure.js +25 -0
  38. package/dist/es/models/immutableProofFailure.js.map +1 -0
  39. package/dist/es/models/immutableProofMetricIds.js +33 -0
  40. package/dist/es/models/immutableProofMetricIds.js.map +1 -0
  41. package/dist/es/models/immutableProofMetrics.js +42 -0
  42. package/dist/es/models/immutableProofMetrics.js.map +1 -0
  43. package/dist/es/models/immutableProofTopics.js +13 -0
  44. package/dist/es/models/immutableProofTopics.js.map +1 -0
  45. package/dist/es/models/immutableProofTypes.js +21 -0
  46. package/dist/es/models/immutableProofTypes.js.map +1 -0
  47. package/dist/es/schemas/ImmutableProof.json +39 -0
  48. package/dist/es/schemas/ImmutableProofCredential.json +25 -0
  49. package/dist/es/schemas/ImmutableProofDataIntegrity.json +13 -0
  50. package/dist/es/schemas/ImmutableProofFailure.json +24 -0
  51. package/dist/es/schemas/ImmutableProofVerification.json +30 -0
  52. package/dist/types/compiled/validators.d.ts +21 -0
  53. package/dist/types/dataTypes/immutableProofDataTypes.d.ts +9 -0
  54. package/dist/types/index.d.ts +21 -0
  55. package/dist/types/models/IImmutableProof.d.ts +24 -0
  56. package/dist/types/models/IImmutableProofComponent.d.ts +47 -0
  57. package/dist/types/models/IImmutableProofCredential.d.ts +11 -0
  58. package/dist/types/models/IImmutableProofDataIntegrity.d.ts +10 -0
  59. package/dist/types/models/IImmutableProofVerification.d.ts +26 -0
  60. package/dist/types/models/api/IImmutableProofCreateRequest.d.ts +25 -0
  61. package/dist/types/models/api/IImmutableProofGetRequest.d.ts +21 -0
  62. package/dist/types/models/api/IImmutableProofGetResponse.d.ts +17 -0
  63. package/dist/types/models/api/IImmutableProofRemoveNotarizationRequest.d.ts +14 -0
  64. package/dist/types/models/api/IImmutableProofRemoveRequest.d.ts +14 -0
  65. package/dist/types/models/api/IImmutableProofVerifyRequest.d.ts +21 -0
  66. package/dist/types/models/api/IImmutableProofVerifyResponse.d.ts +17 -0
  67. package/dist/types/models/eventBus/IImmutableProofEventBusProofCreated.d.ts +9 -0
  68. package/dist/types/models/immutableProofContexts.d.ts +33 -0
  69. package/dist/types/models/immutableProofFailure.d.ts +25 -0
  70. package/dist/types/models/immutableProofMetricIds.d.ts +33 -0
  71. package/dist/types/models/immutableProofMetrics.d.ts +5 -0
  72. package/dist/types/models/immutableProofTopics.d.ts +13 -0
  73. package/dist/types/models/immutableProofTypes.d.ts +21 -0
  74. package/docs/changelog.md +0 -0
  75. package/docs/examples.md +72 -0
  76. package/docs/reference/classes/ImmutableProofDataTypes.md +25 -0
  77. package/docs/reference/index.md +43 -0
  78. package/docs/reference/interfaces/IImmutableProof.md +35 -0
  79. package/docs/reference/interfaces/IImmutableProofComponent.md +143 -0
  80. package/docs/reference/interfaces/IImmutableProofCreateRequest.md +30 -0
  81. package/docs/reference/interfaces/IImmutableProofCredential.md +15 -0
  82. package/docs/reference/interfaces/IImmutableProofDataIntegrity.md +11 -0
  83. package/docs/reference/interfaces/IImmutableProofEventBusProofCreated.md +11 -0
  84. package/docs/reference/interfaces/IImmutableProofGetRequest.md +29 -0
  85. package/docs/reference/interfaces/IImmutableProofGetResponse.md +23 -0
  86. package/docs/reference/interfaces/IImmutableProofRemoveNotarizationRequest.md +17 -0
  87. package/docs/reference/interfaces/IImmutableProofRemoveRequest.md +17 -0
  88. package/docs/reference/interfaces/IImmutableProofVerification.md +35 -0
  89. package/docs/reference/interfaces/IImmutableProofVerifyRequest.md +29 -0
  90. package/docs/reference/interfaces/IImmutableProofVerifyResponse.md +23 -0
  91. package/docs/reference/type-aliases/ImmutableProofContexts.md +5 -0
  92. package/docs/reference/type-aliases/ImmutableProofFailure.md +5 -0
  93. package/docs/reference/type-aliases/ImmutableProofMetricIds.md +5 -0
  94. package/docs/reference/type-aliases/ImmutableProofTopics.md +5 -0
  95. package/docs/reference/type-aliases/ImmutableProofTypes.md +5 -0
  96. package/docs/reference/variables/CompiledImmutableProof.md +5 -0
  97. package/docs/reference/variables/CompiledImmutableProofCredential.md +5 -0
  98. package/docs/reference/variables/CompiledImmutableProofDataIntegrity.md +5 -0
  99. package/docs/reference/variables/CompiledImmutableProofFailure.md +5 -0
  100. package/docs/reference/variables/CompiledImmutableProofVerification.md +5 -0
  101. package/docs/reference/variables/ImmutableProofContexts.md +43 -0
  102. package/docs/reference/variables/ImmutableProofFailure.md +31 -0
  103. package/docs/reference/variables/ImmutableProofMetricIds.md +43 -0
  104. package/docs/reference/variables/ImmutableProofMetrics.md +5 -0
  105. package/docs/reference/variables/ImmutableProofTopics.md +13 -0
  106. package/docs/reference/variables/ImmutableProofTypes.md +25 -0
  107. package/locales/en.json +3 -0
  108. package/package.json +56 -5
@@ -0,0 +1,47 @@
1
+ import type { IComponent } from "@3sixty/core";
2
+ import type { IJsonLdNodeObject } from "@3sixty/data-json-ld";
3
+ import type { IImmutableProofCredential } from "./IImmutableProofCredential.js";
4
+ import type { IImmutableProofVerification } from "./IImmutableProofVerification.js";
5
+ /**
6
+ * Interface describing an immutable proof contract.
7
+ */
8
+ export interface IImmutableProofComponent extends IComponent {
9
+ /**
10
+ * Create a new proof.
11
+ * @param document The document to create the proof for.
12
+ * @param options Optional settings for the proof.
13
+ * @param options.deleteLock An ISO 8601 date-time string specifying when the notarization lock expires; if omitted no lock is applied.
14
+ * @returns The id of the new proof.
15
+ */
16
+ create(document: IJsonLdNodeObject, options?: {
17
+ deleteLock?: string;
18
+ }): Promise<string>;
19
+ /**
20
+ * Get a proof.
21
+ * @param id The id of the proof to get.
22
+ * @returns The proof.
23
+ * @throws NotFoundError if the proof is not found.
24
+ */
25
+ get(id: string): Promise<IImmutableProofCredential>;
26
+ /**
27
+ * Verify a proof.
28
+ * @param id The id of the proof to verify.
29
+ * @returns The result of the verification and any failures.
30
+ * @throws NotFoundError if the proof is not found.
31
+ */
32
+ verify(id: string): Promise<IImmutableProofVerification>;
33
+ /**
34
+ * Remove the proof and its notarization.
35
+ * @param id The id of the proof to remove.
36
+ * @returns A promise that resolves when the proof and its notarization have been removed.
37
+ * @throws NotFoundError if the proof is not found.
38
+ */
39
+ remove(id: string): Promise<void>;
40
+ /**
41
+ * Remove only the notarization for the proof, keeping the proof entity.
42
+ * @param id The id of the proof to remove the notarization from.
43
+ * @returns A promise that resolves when the notarization has been removed.
44
+ * @throws NotFoundError if the proof is not found.
45
+ */
46
+ removeNotarization(id: string): Promise<void>;
47
+ }
@@ -0,0 +1,11 @@
1
+ import type { IDidVerifiableCredential, IProof } from "@3sixty/standards-w3c-did";
2
+ import type { IImmutableProofDataIntegrity } from "./IImmutableProofDataIntegrity.js";
3
+ /**
4
+ * Interface describing an immutable proof credential.
5
+ */
6
+ export interface IImmutableProofCredential extends Omit<IDidVerifiableCredential, "proof"> {
7
+ /**
8
+ * The proof of the verifiable credential, which includes the data integrity information.
9
+ */
10
+ proof?: IProof & IImmutableProofDataIntegrity;
11
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Interface describing additional data integrity fields attached.
3
+ */
4
+ export interface IImmutableProofDataIntegrity {
5
+ /**
6
+ * The notarization id.
7
+ * @json-ld id
8
+ */
9
+ notarizationId?: string;
10
+ }
@@ -0,0 +1,26 @@
1
+ import type { ImmutableProofContexts } from "./immutableProofContexts.js";
2
+ import type { ImmutableProofFailure } from "./immutableProofFailure.js";
3
+ import type { ImmutableProofTypes } from "./immutableProofTypes.js";
4
+ /**
5
+ * Interface describing an immutable proof verification.
6
+ */
7
+ export interface IImmutableProofVerification {
8
+ /**
9
+ * JSON-LD Context.
10
+ */
11
+ "@context": typeof ImmutableProofContexts.Context;
12
+ /**
13
+ * JSON-LD Type.
14
+ */
15
+ type: typeof ImmutableProofTypes.ImmutableProofVerification;
16
+ /**
17
+ * Was the verification successful.
18
+ * @json-ld namespace:twin-common
19
+ */
20
+ verified: boolean;
21
+ /**
22
+ * If the verification was unsuccessful the failure reason.
23
+ * @json-ld type:schema:Text
24
+ */
25
+ failure?: ImmutableProofFailure;
26
+ }
@@ -0,0 +1,25 @@
1
+ import type { IJsonLdNodeObject } from "@3sixty/data-json-ld";
2
+ /**
3
+ * Create a proof.
4
+ */
5
+ export interface IImmutableProofCreateRequest {
6
+ /**
7
+ * The parameters from the body.
8
+ */
9
+ body: {
10
+ /**
11
+ * The document to create the proof for.
12
+ */
13
+ document: IJsonLdNodeObject;
14
+ /**
15
+ * Optional settings for the proof.
16
+ */
17
+ options?: {
18
+ /**
19
+ * An ISO 8601 date-time string specifying when the notarization lock expires.
20
+ * If omitted, no deletion lock is applied.
21
+ */
22
+ deleteLock?: string;
23
+ };
24
+ };
25
+ }
@@ -0,0 +1,21 @@
1
+ import type { HeaderTypes, MimeTypes } from "@3sixty/web";
2
+ /**
3
+ * Get a proof.
4
+ */
5
+ export interface IImmutableProofGetRequest {
6
+ /**
7
+ * The headers which can be used to determine the response data type.
8
+ */
9
+ headers?: {
10
+ [HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
11
+ };
12
+ /**
13
+ * The parameters from the path.
14
+ */
15
+ pathParams: {
16
+ /**
17
+ * The id of the immutable proof to get.
18
+ */
19
+ id: string;
20
+ };
21
+ }
@@ -0,0 +1,17 @@
1
+ import type { HeaderTypes, MimeTypes } from "@3sixty/web";
2
+ import type { IImmutableProofCredential } from "../IImmutableProofCredential.js";
3
+ /**
4
+ * Response to getting an immutable proof.
5
+ */
6
+ export interface IImmutableProofGetResponse {
7
+ /**
8
+ * The headers which can be used to determine the response data type.
9
+ */
10
+ headers?: {
11
+ [HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
12
+ };
13
+ /**
14
+ * The response body.
15
+ */
16
+ body: IImmutableProofCredential;
17
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Remove the notarization for a proof.
3
+ */
4
+ export interface IImmutableProofRemoveNotarizationRequest {
5
+ /**
6
+ * The parameters from the path.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the immutable proof to remove the notarization from.
11
+ */
12
+ id: string;
13
+ };
14
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Remove a proof.
3
+ */
4
+ export interface IImmutableProofRemoveRequest {
5
+ /**
6
+ * The parameters from the path.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the immutable proof to remove.
11
+ */
12
+ id: string;
13
+ };
14
+ }
@@ -0,0 +1,21 @@
1
+ import type { HeaderTypes, MimeTypes } from "@3sixty/web";
2
+ /**
3
+ * Verify a proof.
4
+ */
5
+ export interface IImmutableProofVerifyRequest {
6
+ /**
7
+ * The headers which can be used to determine the response data type.
8
+ */
9
+ headers?: {
10
+ [HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
11
+ };
12
+ /**
13
+ * The parameters from the path.
14
+ */
15
+ pathParams: {
16
+ /**
17
+ * The id of the immutable proof to verify.
18
+ */
19
+ id: string;
20
+ };
21
+ }
@@ -0,0 +1,17 @@
1
+ import type { HeaderTypes, MimeTypes } from "@3sixty/web";
2
+ import type { IImmutableProofVerification } from "../IImmutableProofVerification.js";
3
+ /**
4
+ * Response to verifying an immutable proof.
5
+ */
6
+ export interface IImmutableProofVerifyResponse {
7
+ /**
8
+ * The headers which can be used to determine the response data type.
9
+ */
10
+ headers?: {
11
+ [HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
12
+ };
13
+ /**
14
+ * The response body.
15
+ */
16
+ body: IImmutableProofVerification;
17
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Event bus payload for proof created.
3
+ */
4
+ export interface IImmutableProofEventBusProofCreated {
5
+ /**
6
+ * The id of the proof created.
7
+ */
8
+ id: string;
9
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The contexts of immutable proof data.
3
+ */
4
+ export declare const ImmutableProofContexts: {
5
+ /**
6
+ * The canonical RDF namespace URI for Immutable Proof.
7
+ */
8
+ readonly Namespace: "https://schema.3sixty.global/immutable-proof/";
9
+ /**
10
+ * The value to use in context for Immutable Proof.
11
+ */
12
+ readonly Context: "https://schema.3sixty.global/immutable-proof/";
13
+ /**
14
+ * The JSON-LD Context URL for Immutable Proof.
15
+ */
16
+ readonly JsonLdContext: "https://schema.3sixty.global/immutable-proof/types.jsonld";
17
+ /**
18
+ * The canonical RDF namespace URI for TWIN Common.
19
+ */
20
+ readonly NamespaceCommon: "https://schema.3sixty.global/common/";
21
+ /**
22
+ * The value to use in JSON-LD context for TWIN Common.
23
+ */
24
+ readonly ContextCommon: "https://schema.3sixty.global/common/";
25
+ /**
26
+ * The JSON-LD Context URL for TWIN Common.
27
+ */
28
+ readonly JsonLdContextCommon: "https://schema.3sixty.global/common/types.jsonld";
29
+ };
30
+ /**
31
+ * The contexts of immutable proof data.
32
+ */
33
+ export type ImmutableProofContexts = (typeof ImmutableProofContexts)[keyof typeof ImmutableProofContexts];
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The failure reason of the proof.
3
+ */
4
+ export declare const ImmutableProofFailure: {
5
+ /**
6
+ * Proof not yet issued.
7
+ */
8
+ readonly NotIssued: "notIssued";
9
+ /**
10
+ * Proof missing.
11
+ */
12
+ readonly ProofMissing: "proofMissing";
13
+ /**
14
+ * Verification failure.
15
+ */
16
+ readonly VerificationFailure: "verificationFailure";
17
+ /**
18
+ * Revoked.
19
+ */
20
+ readonly Revoked: "revoked";
21
+ };
22
+ /**
23
+ * The failure reason of the proof.
24
+ */
25
+ export type ImmutableProofFailure = (typeof ImmutableProofFailure)[keyof typeof ImmutableProofFailure];
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Metric IDs for the immutable proof service.
3
+ */
4
+ export declare const ImmutableProofMetricIds: {
5
+ /**
6
+ * Number of proofs created.
7
+ */
8
+ readonly ProofsCreated: "ip_proofs_created";
9
+ /**
10
+ * Number of proof verifications succeeded.
11
+ */
12
+ readonly VerificationsSucceeded: "ip_verifications_succeeded";
13
+ /**
14
+ * Number of proof verifications failed.
15
+ */
16
+ readonly VerificationsFailed: "ip_verifications_failed";
17
+ /**
18
+ * Number of proofs removed.
19
+ */
20
+ readonly ProofsRemoved: "ip_proofs_removed";
21
+ /**
22
+ * Number of notarizations removed.
23
+ */
24
+ readonly NotarizationsRemoved: "ip_notarizations_removed";
25
+ /**
26
+ * Time in milliseconds from a proof being requested to its notarization completing.
27
+ */
28
+ readonly ProofCompletionLag: "ip_proof_completion_lag";
29
+ };
30
+ /**
31
+ * Union type of all immutable proof service metric ID string values.
32
+ */
33
+ export type ImmutableProofMetricIds = (typeof ImmutableProofMetricIds)[keyof typeof ImmutableProofMetricIds];
@@ -0,0 +1,5 @@
1
+ import { type ITelemetryMetric } from "@3sixty/telemetry-models";
2
+ /**
3
+ * Metrics registered by the immutable proof service.
4
+ */
5
+ export declare const ImmutableProofMetrics: ITelemetryMetric[];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The topics for immutable proof event bus notifications.
3
+ */
4
+ export declare const ImmutableProofTopics: {
5
+ /**
6
+ * A proof was created.
7
+ */
8
+ readonly ProofCreated: "immutable-proof:proof-created";
9
+ };
10
+ /**
11
+ * The topics for immutable proof event bus notifications.
12
+ */
13
+ export type ImmutableProofTopics = (typeof ImmutableProofTopics)[keyof typeof ImmutableProofTopics];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The types of immutable proof data.
3
+ */
4
+ export declare const ImmutableProofTypes: {
5
+ /**
6
+ * Represents Immutable Proof.
7
+ */
8
+ readonly ImmutableProof: "ImmutableProof";
9
+ /**
10
+ * Represents Immutable Proof Verification.
11
+ */
12
+ readonly ImmutableProofVerification: "ImmutableProofVerification";
13
+ /**
14
+ * Represents Immutable Proof Failure.
15
+ */
16
+ readonly ImmutableProofFailure: "ImmutableProofFailure";
17
+ };
18
+ /**
19
+ * The types of immutable proof data.
20
+ */
21
+ export type ImmutableProofTypes = (typeof ImmutableProofTypes)[keyof typeof ImmutableProofTypes];
File without changes
@@ -0,0 +1,72 @@
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 '@3sixty/data-core';
9
+ import { ImmutableProofDataTypes, ImmutableProofTypes } from '@3sixty/immutable-proof-models';
10
+
11
+ ImmutableProofDataTypes.registerTypes();
12
+
13
+ const handler = DataTypeHandlerFactory.get(
14
+ 'https://schema.3sixty.global/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 '@3sixty/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 '@3sixty/immutable-proof-models';
43
+ import type {
44
+ IImmutableProofGetResponse,
45
+ IImmutableProofVerifyResponse
46
+ } from '@3sixty/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.3sixty.global/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
+ ```
@@ -0,0 +1,25 @@
1
+ # Class: ImmutableProofDataTypes
2
+
3
+ Handle all the data types for immutable proof.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new ImmutableProofDataTypes**(): `ImmutableProofDataTypes`
10
+
11
+ #### Returns
12
+
13
+ `ImmutableProofDataTypes`
14
+
15
+ ## Methods
16
+
17
+ ### registerTypes() {#registertypes}
18
+
19
+ > `static` **registerTypes**(): `void`
20
+
21
+ Register all the data types.
22
+
23
+ #### Returns
24
+
25
+ `void`
@@ -0,0 +1,43 @@
1
+ # @3sixty/immutable-proof-models
2
+
3
+ ## Classes
4
+
5
+ - [ImmutableProofDataTypes](classes/ImmutableProofDataTypes.md)
6
+
7
+ ## Interfaces
8
+
9
+ - [IImmutableProof](interfaces/IImmutableProof.md)
10
+ - [IImmutableProofComponent](interfaces/IImmutableProofComponent.md)
11
+ - [IImmutableProofCredential](interfaces/IImmutableProofCredential.md)
12
+ - [IImmutableProofDataIntegrity](interfaces/IImmutableProofDataIntegrity.md)
13
+ - [IImmutableProofVerification](interfaces/IImmutableProofVerification.md)
14
+ - [IImmutableProofCreateRequest](interfaces/IImmutableProofCreateRequest.md)
15
+ - [IImmutableProofGetRequest](interfaces/IImmutableProofGetRequest.md)
16
+ - [IImmutableProofGetResponse](interfaces/IImmutableProofGetResponse.md)
17
+ - [IImmutableProofRemoveNotarizationRequest](interfaces/IImmutableProofRemoveNotarizationRequest.md)
18
+ - [IImmutableProofRemoveRequest](interfaces/IImmutableProofRemoveRequest.md)
19
+ - [IImmutableProofVerifyRequest](interfaces/IImmutableProofVerifyRequest.md)
20
+ - [IImmutableProofVerifyResponse](interfaces/IImmutableProofVerifyResponse.md)
21
+ - [IImmutableProofEventBusProofCreated](interfaces/IImmutableProofEventBusProofCreated.md)
22
+
23
+ ## Type Aliases
24
+
25
+ - [ImmutableProofContexts](type-aliases/ImmutableProofContexts.md)
26
+ - [ImmutableProofFailure](type-aliases/ImmutableProofFailure.md)
27
+ - [ImmutableProofMetricIds](type-aliases/ImmutableProofMetricIds.md)
28
+ - [ImmutableProofTopics](type-aliases/ImmutableProofTopics.md)
29
+ - [ImmutableProofTypes](type-aliases/ImmutableProofTypes.md)
30
+
31
+ ## Variables
32
+
33
+ - [CompiledImmutableProof](variables/CompiledImmutableProof.md)
34
+ - [CompiledImmutableProofCredential](variables/CompiledImmutableProofCredential.md)
35
+ - [CompiledImmutableProofDataIntegrity](variables/CompiledImmutableProofDataIntegrity.md)
36
+ - [CompiledImmutableProofVerification](variables/CompiledImmutableProofVerification.md)
37
+ - [CompiledImmutableProofFailure](variables/CompiledImmutableProofFailure.md)
38
+ - [ImmutableProofContexts](variables/ImmutableProofContexts.md)
39
+ - [ImmutableProofFailure](variables/ImmutableProofFailure.md)
40
+ - [ImmutableProofMetricIds](variables/ImmutableProofMetricIds.md)
41
+ - [ImmutableProofMetrics](variables/ImmutableProofMetrics.md)
42
+ - [ImmutableProofTopics](variables/ImmutableProofTopics.md)
43
+ - [ImmutableProofTypes](variables/ImmutableProofTypes.md)
@@ -0,0 +1,35 @@
1
+ # Interface: IImmutableProof
2
+
3
+ Interface describing an immutable proof state.
4
+
5
+ ## Properties
6
+
7
+ ### @context? {#context}
8
+
9
+ > `optional` **@context?**: \[`"https://schema.3sixty.global/immutable-proof/"`, `"https://schema.3sixty.global/common/"`\]
10
+
11
+ JSON-LD Context.
12
+
13
+ ***
14
+
15
+ ### type? {#type}
16
+
17
+ > `optional` **type?**: `"ImmutableProof"`
18
+
19
+ JSON-LD Type.
20
+
21
+ ***
22
+
23
+ ### id? {#id}
24
+
25
+ > `optional` **id?**: `string`
26
+
27
+ The id of the object associated with the proof.
28
+
29
+ ***
30
+
31
+ ### proofIntegrity {#proofintegrity}
32
+
33
+ > **proofIntegrity**: `string`
34
+
35
+ The integrity hash of the object associated with the proof.