@twin.org/immutable-proof-service 0.0.3-next.1 → 0.0.3-next.11

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.
@@ -63,7 +63,7 @@
63
63
  "schema": {
64
64
  "type": "string"
65
65
  },
66
- "description": "e.g. test:1234567890"
66
+ "description": "e.g. test%3A1234567890"
67
67
  }
68
68
  }
69
69
  },
@@ -165,7 +165,7 @@
165
165
  "type": "string"
166
166
  },
167
167
  "style": "simple",
168
- "example": "ais:1234567890"
168
+ "example": "immutable-proof:1234567890"
169
169
  },
170
170
  {
171
171
  "name": "accept",
@@ -189,26 +189,37 @@
189
189
  "content": {
190
190
  "application/json": {
191
191
  "schema": {
192
- "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProof"
192
+ "$ref": "https://schema.twindev.org/w3c-did/DidVerifiableCredential"
193
193
  },
194
194
  "examples": {
195
195
  "immutableProofGetResponseExample": {
196
196
  "value": {
197
197
  "@context": [
198
+ "https://www.w3.org/2018/credentials/v1",
198
199
  "https://schema.twindev.org/immutable-proof/",
199
200
  "https://schema.twindev.org/common/"
200
201
  ],
201
- "type": "ImmutableProof",
202
- "id": "ais:1234567890",
203
- "proofObjectId": "test:1234567890",
204
- "proofObjectHash": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y=",
202
+ "type": [
203
+ "VerifiableCredential",
204
+ "ImmutableProof"
205
+ ],
206
+ "id": "immutable-proof:1234567890",
207
+ "credentialSubject": {
208
+ "id": "ais:1234567890",
209
+ "proofIntegrity": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y="
210
+ },
205
211
  "proof": {
206
- "@context": "https://www.w3.org/ns/credentials/v2",
207
212
  "type": "DataIntegrityProof",
208
213
  "cryptosuite": "eddsa-jcs-2022",
209
214
  "created": "2024-08-22T11:56:56.272Z",
210
215
  "proofPurpose": "assertionMethod",
211
- "proofValue": "7DdiPPYtxLjCD3wA1po2rv..."
216
+ "proofValue": "7DdiPPYtxLjCD3wA1po2rv...",
217
+ "verificationMethod": "did:iota:testnet:0xcb07cabaa2f23b7e53d8cdc4228efb351ebb270554d13bc382e4f94ca8d3136b#immutable-proof-assertion",
218
+ "verifiableStorageId": "verifiable-storage:1234567890",
219
+ "immutableReceipt": {
220
+ "id": "immutable-receipt:1234567890",
221
+ "type": "ImmutableReceipt"
222
+ }
212
223
  }
213
224
  }
214
225
  }
@@ -216,26 +227,37 @@
216
227
  },
217
228
  "application/ld+json": {
218
229
  "schema": {
219
- "$ref": "https://schema.twindev.org/immutable-proof/ImmutableProof"
230
+ "$ref": "https://schema.twindev.org/w3c-did/DidVerifiableCredential"
220
231
  },
221
232
  "examples": {
222
233
  "immutableProofJsonLdGetResponseExample": {
223
234
  "value": {
224
235
  "@context": [
236
+ "https://www.w3.org/2018/credentials/v1",
225
237
  "https://schema.twindev.org/immutable-proof/",
226
238
  "https://schema.twindev.org/common/"
227
239
  ],
228
- "type": "ImmutableProof",
229
- "id": "ais:1234567890",
230
- "proofObjectId": "test:1234567890",
231
- "proofObjectHash": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y=",
240
+ "type": [
241
+ "VerifiableCredential",
242
+ "ImmutableProof"
243
+ ],
244
+ "id": "immutable-proof:1234567890",
245
+ "credentialSubject": {
246
+ "id": "ais:1234567890",
247
+ "proofIntegrity": "EAOKyDN0mYQbBh91eMdVeroxQx1H4GfnRbmt6n/2L/Y="
248
+ },
232
249
  "proof": {
233
- "@context": "https://www.w3.org/ns/credentials/v2",
234
250
  "type": "DataIntegrityProof",
235
251
  "cryptosuite": "eddsa-jcs-2022",
236
252
  "created": "2024-08-22T11:56:56.272Z",
237
253
  "proofPurpose": "assertionMethod",
238
- "proofValue": "7DdiPPYtxLjCD3wA1po2rv..."
254
+ "proofValue": "7DdiPPYtxLjCD3wA1po2rv...",
255
+ "verificationMethod": "did:iota:testnet:0xcb07cabaa2f23b7e53d8cdc4228efb351ebb270554d13bc382e4f94ca8d3136b#immutable-proof-assertion",
256
+ "verifiableStorageId": "verifiable-storage:1234567890",
257
+ "immutableReceipt": {
258
+ "id": "immutable-receipt:1234567890",
259
+ "type": "ImmutableReceipt"
260
+ }
239
261
  }
240
262
  }
241
263
  }
@@ -349,7 +371,7 @@
349
371
  "type": "string"
350
372
  },
351
373
  "style": "simple",
352
- "example": "ais:1234567890"
374
+ "example": "immutable-proof:1234567890"
353
375
  },
354
376
  {
355
377
  "name": "accept",
@@ -387,7 +409,7 @@
387
409
  "@context": "https://schema.twindev.org/immutable-proof/",
388
410
  "type": "ImmutableProofVerification",
389
411
  "verified": false,
390
- "failure": "proofTypeMismatch"
412
+ "failure": "verificationFailure"
391
413
  }
392
414
  }
393
415
  }
@@ -478,132 +500,8 @@
478
500
  },
479
501
  "components": {
480
502
  "schemas": {
481
- "DataIntegrityProof": {
482
- "type": "object",
483
- "properties": {
484
- "@context": {
485
- "anyOf": [
486
- {
487
- "type": "string",
488
- "const": "https://www.w3.org/ns/credentials/v2"
489
- },
490
- {
491
- "type": "array",
492
- "minItems": 1,
493
- "prefixItems": [
494
- {
495
- "type": "string",
496
- "const": "https://www.w3.org/ns/credentials/v2"
497
- }
498
- ],
499
- "items": {
500
- "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
501
- }
502
- }
503
- ],
504
- "description": "JSON-LD Context."
505
- },
506
- "type": {
507
- "type": "string",
508
- "const": "DataIntegrityProof",
509
- "description": "JSON-LD Type."
510
- },
511
- "cryptosuite": {
512
- "anyOf": [
513
- {
514
- "$ref": "#/components/schemas/DidCryptoSuites"
515
- },
516
- {
517
- "type": "string"
518
- }
519
- ],
520
- "description": "An identifier for the cryptographic suite that can be used to verify the proof."
521
- },
522
- "id": {
523
- "type": "string",
524
- "description": "The id of the proof."
525
- },
526
- "proofPurpose": {
527
- "type": "string",
528
- "description": "The reason the proof was created."
529
- },
530
- "proofValue": {
531
- "type": "string",
532
- "description": "Contains the base-encoded binary data necessary to verify the digital proof using the verificationMethod specified."
533
- },
534
- "verificationMethod": {
535
- "type": "string",
536
- "description": "The verification method of the proof."
537
- },
538
- "created": {
539
- "type": "string",
540
- "description": "The iso date of when the proof was created."
541
- },
542
- "expires": {
543
- "type": "string",
544
- "description": "The iso date of when the proof expires."
545
- },
546
- "domain": {
547
- "anyOf": [
548
- {
549
- "type": "string"
550
- },
551
- {
552
- "type": "array",
553
- "items": {
554
- "type": "string"
555
- }
556
- }
557
- ],
558
- "description": "One or more security domains in which the proof is meant to be used."
559
- },
560
- "challenge": {
561
- "anyOf": [
562
- {
563
- "type": "string"
564
- },
565
- {
566
- "type": "array",
567
- "items": {
568
- "type": "string"
569
- }
570
- }
571
- ],
572
- "description": "Provided to mitigate replay attacks on domains."
573
- },
574
- "previousProof": {
575
- "type": "string",
576
- "description": "Identifies another data integrity proof that MUST verify before the current proof is processed"
577
- },
578
- "nonce": {
579
- "type": "string",
580
- "description": "Use of this field is to increase privacy by decreasing linkability that is the result of deterministically generated signatures."
581
- }
582
- },
583
- "required": [
584
- "type",
585
- "cryptosuite",
586
- "proofPurpose"
587
- ],
588
- "additionalProperties": false,
589
- "description": "Interface describing a did proof. https://www.w3.org/TR/vc-data-integrity/"
590
- },
591
- "DidCryptoSuites": {
592
- "anyOf": [
593
- {
594
- "type": "string",
595
- "const": "eddsa-jcs-2022",
596
- "description": "The type for EdDSA crypto suite for JSON Canonicalization Scheme [RFC8785]. https://www.w3.org/TR/vc-di-eddsa/#eddsa-jcs-2022"
597
- },
598
- {
599
- "type": "string",
600
- "const": "eddsa-rdfc-2022",
601
- "description": "The type for EdDSA crypto suite for RDF Dataset Canonicalization. https://www.w3.org/TR/vc-di-eddsa/#eddsa-rdfc-2022"
602
- }
603
- ],
604
- "description": "The types for DID Proof crypto suites."
605
- },
606
503
  "Error": {
504
+ "description": "Model to describe serialized error.",
607
505
  "type": "object",
608
506
  "properties": {
609
507
  "name": {
@@ -634,9 +532,7 @@
634
532
  "required": [
635
533
  "name",
636
534
  "message"
637
- ],
638
- "additionalProperties": false,
639
- "description": "Model to describe serialized error."
535
+ ]
640
536
  },
641
537
  "ImmutableProofCreateRequest": {
642
538
  "type": "object",
@@ -648,45 +544,20 @@
648
544
  "required": [
649
545
  "document"
650
546
  ],
651
- "additionalProperties": false,
652
547
  "description": "The parameters from the body."
653
548
  },
654
549
  "NotFoundResponse": {
655
550
  "type": "object",
656
- "additionalProperties": false,
657
551
  "properties": {
658
552
  "notFoundId": {
659
553
  "type": "string",
660
554
  "description": "The id if the item that was not found."
661
- },
662
- "name": {
663
- "type": "string",
664
- "description": "The name for the error."
665
- },
666
- "message": {
667
- "type": "string",
668
- "description": "The message for the error."
669
- },
670
- "source": {
671
- "type": "string",
672
- "description": "The source of the error."
673
- },
674
- "properties": {
675
- "type": "object",
676
- "additionalProperties": {},
677
- "description": "Any additional information for the error."
678
- },
679
- "stack": {
680
- "type": "string",
681
- "description": "The stack trace for the error."
682
- },
683
- "cause": {
684
- "$ref": "#/components/schemas/Error"
685
555
  }
686
556
  },
687
- "required": [
688
- "message",
689
- "name"
557
+ "allOf": [
558
+ {
559
+ "$ref": "#/components/schemas/Error"
560
+ }
690
561
  ],
691
562
  "description": "The body which contains the error."
692
563
  }
@@ -14,7 +14,7 @@ Class describing the immutable proof.
14
14
 
15
15
  ## Properties
16
16
 
17
- ### id
17
+ ### id {#id}
18
18
 
19
19
  > **id**: `string`
20
20
 
@@ -22,7 +22,15 @@ The id of the proof.
22
22
 
23
23
  ***
24
24
 
25
- ### dateCreated
25
+ ### organizationId {#organizationid}
26
+
27
+ > **organizationId**: `string`
28
+
29
+ The organization id.
30
+
31
+ ***
32
+
33
+ ### dateCreated {#datecreated}
26
34
 
27
35
  > **dateCreated**: `string`
28
36
 
@@ -30,24 +38,32 @@ The date/time of when the proof was created.
30
38
 
31
39
  ***
32
40
 
33
- ### proofObjectId?
41
+ ### proofObjectId? {#proofobjectid}
34
42
 
35
- > `optional` **proofObjectId**: `string`
43
+ > `optional` **proofObjectId?**: `string`
36
44
 
37
45
  The associated id for the item.
38
46
 
39
47
  ***
40
48
 
41
- ### proofObjectHash
49
+ ### proofObjectIntegrity {#proofobjectintegrity}
42
50
 
43
- > **proofObjectHash**: `string`
51
+ > **proofObjectIntegrity**: `string`
44
52
 
45
- The associated hash for the item.
53
+ The associated integrity for the item.
46
54
 
47
55
  ***
48
56
 
49
- ### verifiableStorageId?
57
+ ### verifiableStorageId? {#verifiablestorageid}
50
58
 
51
- > `optional` **verifiableStorageId**: `string`
59
+ > `optional` **verifiableStorageId?**: `string`
52
60
 
53
61
  The verifiable storage id.
62
+
63
+ ***
64
+
65
+ ### vcContext? {#vccontext}
66
+
67
+ > `optional` **vcContext?**: `"https://www.w3.org/2018/credentials/v1"` \| `"https://www.w3.org/ns/credentials/v2"`
68
+
69
+ The verifiable credential context.
@@ -28,7 +28,7 @@ The dependencies for the immutable proof connector.
28
28
 
29
29
  ## Properties
30
30
 
31
- ### CLASS\_NAME
31
+ ### CLASS\_NAME {#class_name}
32
32
 
33
33
  > `readonly` `static` **CLASS\_NAME**: `string`
34
34
 
@@ -36,7 +36,7 @@ Runtime name for the class.
36
36
 
37
37
  ## Methods
38
38
 
39
- ### className()
39
+ ### className() {#classname}
40
40
 
41
41
  > **className**(): `string`
42
42
 
@@ -54,7 +54,7 @@ The class name of the component.
54
54
 
55
55
  ***
56
56
 
57
- ### start()
57
+ ### start() {#start}
58
58
 
59
59
  > **start**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
60
60
 
@@ -80,7 +80,7 @@ Nothing.
80
80
 
81
81
  ***
82
82
 
83
- ### create()
83
+ ### create() {#create}
84
84
 
85
85
  > **create**(`document`): `Promise`\<`string`\>
86
86
 
@@ -106,9 +106,9 @@ The id of the new proof.
106
106
 
107
107
  ***
108
108
 
109
- ### get()
109
+ ### get() {#get}
110
110
 
111
- > **get**(`id`): `Promise`\<`IImmutableProof`\>
111
+ > **get**(`id`): `Promise`\<`IDidVerifiableCredential`\>
112
112
 
113
113
  Get a proof.
114
114
 
@@ -122,7 +122,7 @@ The id of the proof to get.
122
122
 
123
123
  #### Returns
124
124
 
125
- `Promise`\<`IImmutableProof`\>
125
+ `Promise`\<`IDidVerifiableCredential`\>
126
126
 
127
127
  The proof.
128
128
 
@@ -136,7 +136,7 @@ NotFoundError if the proof is not found.
136
136
 
137
137
  ***
138
138
 
139
- ### verify()
139
+ ### verify() {#verify}
140
140
 
141
141
  > **verify**(`id`): `Promise`\<`IImmutableProofVerification`\>
142
142
 
@@ -166,7 +166,7 @@ NotFoundError if the proof is not found.
166
166
 
167
167
  ***
168
168
 
169
- ### removeVerifiable()
169
+ ### removeVerifiable() {#removeverifiable}
170
170
 
171
171
  > **removeVerifiable**(`id`): `Promise`\<`void`\>
172
172
 
@@ -4,9 +4,9 @@ Configuration for the immutable proof service.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### verificationMethodId?
7
+ ### verificationMethodId? {#verificationmethodid}
8
8
 
9
- > `optional` **verificationMethodId**: `string`
9
+ > `optional` **verificationMethodId?**: `string`
10
10
 
11
11
  The verification method id to use for the proof.
12
12
 
@@ -4,9 +4,9 @@ Options for the immutable proof service constructor.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### immutableProofEntityStorageType?
7
+ ### immutableProofEntityStorageType? {#immutableproofentitystoragetype}
8
8
 
9
- > `optional` **immutableProofEntityStorageType**: `string`
9
+ > `optional` **immutableProofEntityStorageType?**: `string`
10
10
 
11
11
  The entity storage for proofs.
12
12
 
@@ -18,9 +18,9 @@ immutable-proof
18
18
 
19
19
  ***
20
20
 
21
- ### verifiableStorageType?
21
+ ### verifiableStorageType? {#verifiablestoragetype}
22
22
 
23
- > `optional` **verifiableStorageType**: `string`
23
+ > `optional` **verifiableStorageType?**: `string`
24
24
 
25
25
  The verifiable storage.
26
26
 
@@ -32,9 +32,23 @@ verifiable-storage
32
32
 
33
33
  ***
34
34
 
35
- ### identityConnectorType?
35
+ ### loggingComponentType? {#loggingcomponenttype}
36
36
 
37
- > `optional` **identityConnectorType**: `string`
37
+ > `optional` **loggingComponentType?**: `string`
38
+
39
+ The logging component type.
40
+
41
+ #### Default
42
+
43
+ ```ts
44
+ logging
45
+ ```
46
+
47
+ ***
48
+
49
+ ### identityConnectorType? {#identityconnectortype}
50
+
51
+ > `optional` **identityConnectorType?**: `string`
38
52
 
39
53
  The identity connector type.
40
54
 
@@ -46,11 +60,11 @@ identity
46
60
 
47
61
  ***
48
62
 
49
- ### backgroundTaskConnectorType?
63
+ ### backgroundTaskComponentType? {#backgroundtaskcomponenttype}
50
64
 
51
- > `optional` **backgroundTaskConnectorType**: `string`
65
+ > `optional` **backgroundTaskComponentType?**: `string`
52
66
 
53
- The background task connector type.
67
+ The background task component type.
54
68
 
55
69
  #### Default
56
70
 
@@ -60,16 +74,16 @@ background-task
60
74
 
61
75
  ***
62
76
 
63
- ### eventBusComponentType?
77
+ ### eventBusComponentType? {#eventbuscomponenttype}
64
78
 
65
- > `optional` **eventBusComponentType**: `string`
79
+ > `optional` **eventBusComponentType?**: `string`
66
80
 
67
81
  The event bus component type, defaults to no event bus.
68
82
 
69
83
  ***
70
84
 
71
- ### config?
85
+ ### config? {#config}
72
86
 
73
- > `optional` **config**: [`IImmutableProofServiceConfig`](IImmutableProofServiceConfig.md)
87
+ > `optional` **config?**: [`IImmutableProofServiceConfig`](IImmutableProofServiceConfig.md)
74
88
 
75
89
  The configuration for the connector.
package/locales/en.json CHANGED
@@ -6,7 +6,13 @@
6
6
  "getFailed": "Getting the proof failed",
7
7
  "verifyFailed": "Verifying the proof failed",
8
8
  "removeVerifiableFailed": "Removing verifiable entry from the Immutable Proof failed",
9
- "proofNotFound": "The proof with the Id \"{notFoundId}\" was not found"
9
+ "proofNotFound": "The proof with the Id \"{notFoundId}\" was not found",
10
+ "createProofFailed": "Creating the immutable proof failed"
11
+ }
12
+ },
13
+ "info": {
14
+ "immutableProofService": {
15
+ "createdProof": "The immutable proof with Id \"{proofId}\" has been created successfully"
10
16
  }
11
17
  }
12
18
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@twin.org/immutable-proof-service",
3
- "version": "0.0.3-next.1",
4
- "description": "Immutable proof contract implementation and REST endpoint definitions",
3
+ "version": "0.0.3-next.11",
4
+ "description": "Core proof lifecycle service with route helpers for create, get, and verify operations",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/twinfoundation/immutable-proof.git",
@@ -24,8 +24,9 @@
24
24
  "@twin.org/entity-storage-models": "next",
25
25
  "@twin.org/event-bus-models": "next",
26
26
  "@twin.org/identity-models": "next",
27
- "@twin.org/immutable-proof-models": "0.0.3-next.1",
28
- "@twin.org/immutable-proof-task": "0.0.3-next.1",
27
+ "@twin.org/immutable-proof-models": "0.0.3-next.11",
28
+ "@twin.org/immutable-proof-task": "0.0.3-next.11",
29
+ "@twin.org/logging-models": "next",
29
30
  "@twin.org/nameof": "next",
30
31
  "@twin.org/standards-w3c-did": "next",
31
32
  "@twin.org/vault-models": "next",