@twin.org/immutable-proof-models 0.0.1-next.25 → 0.0.1-next.27

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.
@@ -9,14 +9,6 @@ var dataCore = require('@twin.org/data-core');
9
9
  */
10
10
  // eslint-disable-next-line @typescript-eslint/naming-convention
11
11
  const ImmutableProofTypes = {
12
- /**
13
- * The context root for the immutable proof types.
14
- */
15
- ContextRoot: "https://schema.twindev.org/immutable-proof/",
16
- /**
17
- * The context root for the common types.
18
- */
19
- ContextRootCommon: "https://schema.twindev.org/common/",
20
12
  /**
21
13
  * Represents Immutable Proof.
22
14
  */
@@ -56,6 +48,10 @@ var properties = {
56
48
  type: "string",
57
49
  description: "The id of the proof."
58
50
  },
51
+ nodeIdentity: {
52
+ type: "string",
53
+ description: "The id of the node who created the proof."
54
+ },
59
55
  userIdentity: {
60
56
  type: "string",
61
57
  description: "The id of the user who created the proof."
@@ -69,7 +65,7 @@ var properties = {
69
65
  description: "The hash of the object associated with the proof."
70
66
  },
71
67
  proof: {
72
- $ref: "https://schema.twindev.org/did/DidProof",
68
+ $ref: "https://schema.twindev.org/did/DataIntegrityProof",
73
69
  description: "The proof which can be undefined if it has not yet been issued."
74
70
  },
75
71
  immutableReceipt: {
@@ -81,6 +77,7 @@ var required = [
81
77
  "@context",
82
78
  "type",
83
79
  "id",
80
+ "nodeIdentity",
84
81
  "userIdentity",
85
82
  "proofObjectHash"
86
83
  ];
@@ -112,6 +109,23 @@ class ImmutableProofDataTypes {
112
109
  }
113
110
  }
114
111
 
112
+ // Copyright 2024 IOTA Stiftung.
113
+ // SPDX-License-Identifier: Apache-2.0.
114
+ /**
115
+ * The contexts of immutable proof data.
116
+ */
117
+ // eslint-disable-next-line @typescript-eslint/naming-convention
118
+ const ImmutableProofContexts = {
119
+ /**
120
+ * The context root for the immutable proof types.
121
+ */
122
+ ContextRoot: "https://schema.twindev.org/immutable-proof/",
123
+ /**
124
+ * The context root for the common types.
125
+ */
126
+ ContextRootCommon: "https://schema.twindev.org/common/"
127
+ };
128
+
115
129
  // Copyright 2024 IOTA Stiftung.
116
130
  // SPDX-License-Identifier: Apache-2.0.
117
131
  /**
@@ -120,7 +134,7 @@ class ImmutableProofDataTypes {
120
134
  // eslint-disable-next-line @typescript-eslint/naming-convention
121
135
  const ImmutableProofFailure = {
122
136
  /**
123
- * Proof not yes issued.
137
+ * Proof not yet issued.
124
138
  */
125
139
  NotIssued: "notIssued",
126
140
  /**
@@ -154,6 +168,7 @@ const ImmutableProofTopics = {
154
168
  ProofCreated: "immutable-proof:proof-created"
155
169
  };
156
170
 
171
+ exports.ImmutableProofContexts = ImmutableProofContexts;
157
172
  exports.ImmutableProofDataTypes = ImmutableProofDataTypes;
158
173
  exports.ImmutableProofFailure = ImmutableProofFailure;
159
174
  exports.ImmutableProofTopics = ImmutableProofTopics;
@@ -7,14 +7,6 @@ import { DataTypeHandlerFactory } from '@twin.org/data-core';
7
7
  */
8
8
  // eslint-disable-next-line @typescript-eslint/naming-convention
9
9
  const ImmutableProofTypes = {
10
- /**
11
- * The context root for the immutable proof types.
12
- */
13
- ContextRoot: "https://schema.twindev.org/immutable-proof/",
14
- /**
15
- * The context root for the common types.
16
- */
17
- ContextRootCommon: "https://schema.twindev.org/common/",
18
10
  /**
19
11
  * Represents Immutable Proof.
20
12
  */
@@ -54,6 +46,10 @@ var properties = {
54
46
  type: "string",
55
47
  description: "The id of the proof."
56
48
  },
49
+ nodeIdentity: {
50
+ type: "string",
51
+ description: "The id of the node who created the proof."
52
+ },
57
53
  userIdentity: {
58
54
  type: "string",
59
55
  description: "The id of the user who created the proof."
@@ -67,7 +63,7 @@ var properties = {
67
63
  description: "The hash of the object associated with the proof."
68
64
  },
69
65
  proof: {
70
- $ref: "https://schema.twindev.org/did/DidProof",
66
+ $ref: "https://schema.twindev.org/did/DataIntegrityProof",
71
67
  description: "The proof which can be undefined if it has not yet been issued."
72
68
  },
73
69
  immutableReceipt: {
@@ -79,6 +75,7 @@ var required = [
79
75
  "@context",
80
76
  "type",
81
77
  "id",
78
+ "nodeIdentity",
82
79
  "userIdentity",
83
80
  "proofObjectHash"
84
81
  ];
@@ -110,6 +107,23 @@ class ImmutableProofDataTypes {
110
107
  }
111
108
  }
112
109
 
110
+ // Copyright 2024 IOTA Stiftung.
111
+ // SPDX-License-Identifier: Apache-2.0.
112
+ /**
113
+ * The contexts of immutable proof data.
114
+ */
115
+ // eslint-disable-next-line @typescript-eslint/naming-convention
116
+ const ImmutableProofContexts = {
117
+ /**
118
+ * The context root for the immutable proof types.
119
+ */
120
+ ContextRoot: "https://schema.twindev.org/immutable-proof/",
121
+ /**
122
+ * The context root for the common types.
123
+ */
124
+ ContextRootCommon: "https://schema.twindev.org/common/"
125
+ };
126
+
113
127
  // Copyright 2024 IOTA Stiftung.
114
128
  // SPDX-License-Identifier: Apache-2.0.
115
129
  /**
@@ -118,7 +132,7 @@ class ImmutableProofDataTypes {
118
132
  // eslint-disable-next-line @typescript-eslint/naming-convention
119
133
  const ImmutableProofFailure = {
120
134
  /**
121
- * Proof not yes issued.
135
+ * Proof not yet issued.
122
136
  */
123
137
  NotIssued: "notIssued",
124
138
  /**
@@ -152,4 +166,4 @@ const ImmutableProofTopics = {
152
166
  ProofCreated: "immutable-proof:proof-created"
153
167
  };
154
168
 
155
- export { ImmutableProofDataTypes, ImmutableProofFailure, ImmutableProofTopics, ImmutableProofTypes };
169
+ export { ImmutableProofContexts, ImmutableProofDataTypes, ImmutableProofFailure, ImmutableProofTopics, ImmutableProofTypes };
@@ -8,6 +8,7 @@ export * from "./models/eventBus/IImmutableProofEventBusProofCreated";
8
8
  export * from "./models/IImmutableProof";
9
9
  export * from "./models/IImmutableProofComponent";
10
10
  export * from "./models/IImmutableProofVerification";
11
+ export * from "./models/immutableProofContexts";
11
12
  export * from "./models/immutableProofFailure";
12
13
  export * from "./models/immutableProofTopics";
13
14
  export * from "./models/immutableProofTypes";
@@ -1,5 +1,6 @@
1
1
  import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
- import type { IDidProof } from "@twin.org/standards-w3c-did";
2
+ import type { IDataIntegrityProof } from "@twin.org/standards-w3c-did";
3
+ import type { ImmutableProofContexts } from "./immutableProofContexts";
3
4
  import type { ImmutableProofTypes } from "./immutableProofTypes";
4
5
  /**
5
6
  * Interface describing an immutable proof state.
@@ -9,8 +10,8 @@ export interface IImmutableProof {
9
10
  * JSON-LD Context.
10
11
  */
11
12
  "@context": [
12
- typeof ImmutableProofTypes.ContextRoot,
13
- typeof ImmutableProofTypes.ContextRootCommon,
13
+ typeof ImmutableProofContexts.ContextRoot,
14
+ typeof ImmutableProofContexts.ContextRootCommon,
14
15
  ...IJsonLdContextDefinitionElement[]
15
16
  ];
16
17
  /**
@@ -21,6 +22,10 @@ export interface IImmutableProof {
21
22
  * The id of the proof.
22
23
  */
23
24
  id: string;
25
+ /**
26
+ * The id of the node who created the proof.
27
+ */
28
+ nodeIdentity: string;
24
29
  /**
25
30
  * The id of the user who created the proof.
26
31
  */
@@ -36,7 +41,7 @@ export interface IImmutableProof {
36
41
  /**
37
42
  * The proof which can be undefined if it has not yet been issued.
38
43
  */
39
- proof?: IDidProof;
44
+ proof?: IDataIntegrityProof;
40
45
  /**
41
46
  * The immutable receipt detail for where the proof is stored.
42
47
  */
@@ -7,22 +7,22 @@ import type { IImmutableProofVerification } from "./IImmutableProofVerification"
7
7
  */
8
8
  export interface IImmutableProofComponent extends IComponent {
9
9
  /**
10
- * Create a new authentication proof.
11
- * @param proofObject The object for the proof as JSON-LD.
10
+ * Create a new proof.
11
+ * @param document The document to create the proof for.
12
12
  * @param userIdentity The identity to create the immutable proof operation with.
13
13
  * @param nodeIdentity The node identity to use for vault operations.
14
- * @returns The id of the new authentication proof.
14
+ * @returns The id of the new proof.
15
15
  */
16
- create(proofObject: IJsonLdNodeObject, userIdentity?: string, nodeIdentity?: string): Promise<string>;
16
+ create(document: IJsonLdNodeObject, userIdentity?: string, nodeIdentity?: string): Promise<string>;
17
17
  /**
18
- * Get an authentication proof.
18
+ * Get a proof.
19
19
  * @param id The id of the proof to get.
20
20
  * @returns The proof.
21
21
  * @throws NotFoundError if the proof is not found.
22
22
  */
23
23
  get(id: string): Promise<IImmutableProof>;
24
24
  /**
25
- * Verify an authentication proof.
25
+ * Verify a proof.
26
26
  * @param id The id of the proof to verify.
27
27
  * @returns The result of the verification and any failures.
28
28
  * @throws NotFoundError if the proof is not found.
@@ -1,3 +1,4 @@
1
+ import type { ImmutableProofContexts } from "./immutableProofContexts";
1
2
  import type { ImmutableProofFailure } from "./immutableProofFailure";
2
3
  import type { ImmutableProofTypes } from "./immutableProofTypes";
3
4
  /**
@@ -7,7 +8,7 @@ export interface IImmutableProofVerification {
7
8
  /**
8
9
  * JSON-LD Context.
9
10
  */
10
- "@context": typeof ImmutableProofTypes.ContextRoot;
11
+ "@context": typeof ImmutableProofContexts.ContextRoot;
11
12
  /**
12
13
  * JSON-LD Type.
13
14
  */
@@ -8,8 +8,8 @@ export interface IImmutableProofCreateRequest {
8
8
  */
9
9
  body: {
10
10
  /**
11
- * The proof object to create the proof for.
11
+ * The document to create the proof for.
12
12
  */
13
- proofObject: IJsonLdNodeObject;
13
+ document: IJsonLdNodeObject;
14
14
  };
15
15
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The contexts of immutable proof data.
3
+ */
4
+ export declare const ImmutableProofContexts: {
5
+ /**
6
+ * The context root for the immutable proof types.
7
+ */
8
+ readonly ContextRoot: "https://schema.twindev.org/immutable-proof/";
9
+ /**
10
+ * The context root for the common types.
11
+ */
12
+ readonly ContextRootCommon: "https://schema.twindev.org/common/";
13
+ };
14
+ /**
15
+ * The contexts of immutable proof data.
16
+ */
17
+ export type ImmutableProofContexts = (typeof ImmutableProofContexts)[keyof typeof ImmutableProofContexts];
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export declare const ImmutableProofFailure: {
5
5
  /**
6
- * Proof not yes issued.
6
+ * Proof not yet issued.
7
7
  */
8
8
  readonly NotIssued: "notIssued";
9
9
  /**
@@ -2,14 +2,6 @@
2
2
  * The types of immutable proof data.
3
3
  */
4
4
  export declare const ImmutableProofTypes: {
5
- /**
6
- * The context root for the immutable proof types.
7
- */
8
- readonly ContextRoot: "https://schema.twindev.org/immutable-proof/";
9
- /**
10
- * The context root for the common types.
11
- */
12
- readonly ContextRootCommon: "https://schema.twindev.org/common/";
13
5
  /**
14
6
  * Represents Immutable Proof.
15
7
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/immutable-proof-models - Changelog
2
2
 
3
- ## v0.0.1-next.25
3
+ ## v0.0.1-next.27
4
4
 
5
5
  - Initial Release
@@ -18,12 +18,14 @@
18
18
 
19
19
  ## Type Aliases
20
20
 
21
+ - [ImmutableProofContexts](type-aliases/ImmutableProofContexts.md)
21
22
  - [ImmutableProofFailure](type-aliases/ImmutableProofFailure.md)
22
23
  - [ImmutableProofTopics](type-aliases/ImmutableProofTopics.md)
23
24
  - [ImmutableProofTypes](type-aliases/ImmutableProofTypes.md)
24
25
 
25
26
  ## Variables
26
27
 
28
+ - [ImmutableProofContexts](variables/ImmutableProofContexts.md)
27
29
  - [ImmutableProofFailure](variables/ImmutableProofFailure.md)
28
30
  - [ImmutableProofTopics](variables/ImmutableProofTopics.md)
29
31
  - [ImmutableProofTypes](variables/ImmutableProofTypes.md)
@@ -28,6 +28,14 @@ The id of the proof.
28
28
 
29
29
  ***
30
30
 
31
+ ### nodeIdentity
32
+
33
+ > **nodeIdentity**: `string`
34
+
35
+ The id of the node who created the proof.
36
+
37
+ ***
38
+
31
39
  ### userIdentity
32
40
 
33
41
  > **userIdentity**: `string`
@@ -54,7 +62,7 @@ The hash of the object associated with the proof.
54
62
 
55
63
  ### proof?
56
64
 
57
- > `optional` **proof**: `IDidProof`
65
+ > `optional` **proof**: `IDataIntegrityProof`
58
66
 
59
67
  The proof which can be undefined if it has not yet been issued.
60
68
 
@@ -10,17 +10,17 @@ Interface describing an immutable proof contract.
10
10
 
11
11
  ### create()
12
12
 
13
- > **create**(`proofObject`, `userIdentity`?, `nodeIdentity`?): `Promise`\<`string`\>
13
+ > **create**(`document`, `userIdentity`?, `nodeIdentity`?): `Promise`\<`string`\>
14
14
 
15
- Create a new authentication proof.
15
+ Create a new proof.
16
16
 
17
17
  #### Parameters
18
18
 
19
- ##### proofObject
19
+ ##### document
20
20
 
21
21
  `IJsonLdNodeObject`
22
22
 
23
- The object for the proof as JSON-LD.
23
+ The document to create the proof for.
24
24
 
25
25
  ##### userIdentity?
26
26
 
@@ -38,7 +38,7 @@ The node identity to use for vault operations.
38
38
 
39
39
  `Promise`\<`string`\>
40
40
 
41
- The id of the new authentication proof.
41
+ The id of the new proof.
42
42
 
43
43
  ***
44
44
 
@@ -46,7 +46,7 @@ The id of the new authentication proof.
46
46
 
47
47
  > **get**(`id`): `Promise`\<[`IImmutableProof`](IImmutableProof.md)\>
48
48
 
49
- Get an authentication proof.
49
+ Get a proof.
50
50
 
51
51
  #### Parameters
52
52
 
@@ -72,7 +72,7 @@ NotFoundError if the proof is not found.
72
72
 
73
73
  > **verify**(`id`): `Promise`\<[`IImmutableProofVerification`](IImmutableProofVerification.md)\>
74
74
 
75
- Verify an authentication proof.
75
+ Verify a proof.
76
76
 
77
77
  #### Parameters
78
78
 
@@ -10,8 +10,8 @@ Create a proof.
10
10
 
11
11
  The parameters from the body.
12
12
 
13
- #### proofObject
13
+ #### document
14
14
 
15
- > **proofObject**: `IJsonLdNodeObject`
15
+ > **document**: `IJsonLdNodeObject`
16
16
 
17
- The proof object to create the proof for.
17
+ The document to create the proof for.
@@ -0,0 +1,5 @@
1
+ # Type Alias: ImmutableProofContexts
2
+
3
+ > **ImmutableProofContexts**: *typeof* [`ImmutableProofContexts`](../variables/ImmutableProofContexts.md)\[keyof *typeof* [`ImmutableProofContexts`](../variables/ImmutableProofContexts.md)\]
4
+
5
+ The contexts of immutable proof data.
@@ -0,0 +1,19 @@
1
+ # Variable: ImmutableProofContexts
2
+
3
+ > `const` **ImmutableProofContexts**: `object`
4
+
5
+ The contexts of immutable proof data.
6
+
7
+ ## Type declaration
8
+
9
+ ### ContextRoot
10
+
11
+ > `readonly` **ContextRoot**: `"https://schema.twindev.org/immutable-proof/"` = `"https://schema.twindev.org/immutable-proof/"`
12
+
13
+ The context root for the immutable proof types.
14
+
15
+ ### ContextRootCommon
16
+
17
+ > `readonly` **ContextRootCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
18
+
19
+ The context root for the common types.
@@ -10,7 +10,7 @@ The failure reason of the proof.
10
10
 
11
11
  > `readonly` **NotIssued**: `"notIssued"` = `"notIssued"`
12
12
 
13
- Proof not yes issued.
13
+ Proof not yet issued.
14
14
 
15
15
  ### ProofMissing
16
16
 
@@ -6,18 +6,6 @@ The types of immutable proof data.
6
6
 
7
7
  ## Type declaration
8
8
 
9
- ### ContextRoot
10
-
11
- > `readonly` **ContextRoot**: `"https://schema.twindev.org/immutable-proof/"` = `"https://schema.twindev.org/immutable-proof/"`
12
-
13
- The context root for the immutable proof types.
14
-
15
- ### ContextRootCommon
16
-
17
- > `readonly` **ContextRootCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
18
-
19
- The context root for the common types.
20
-
21
9
  ### ImmutableProof
22
10
 
23
11
  > `readonly` **ImmutableProof**: `"ImmutableProof"` = `"ImmutableProof"`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/immutable-proof-models",
3
- "version": "0.0.1-next.25",
3
+ "version": "0.0.1-next.27",
4
4
  "description": "Models which define the structure of the immutable proof connectors and services",
5
5
  "repository": {
6
6
  "type": "git",