@twin.org/immutable-proof-service 0.0.1-next.20 → 0.0.1-next.21
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/cjs/index.cjs +11 -4
- package/dist/esm/index.mjs +11 -4
- package/docs/changelog.md +1 -1
- package/docs/open-api/spec.json +8 -2
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -175,7 +175,10 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
175
175
|
id: "immutableProofGetResponseExample",
|
|
176
176
|
response: {
|
|
177
177
|
body: {
|
|
178
|
-
"@context":
|
|
178
|
+
"@context": [
|
|
179
|
+
immutableProofModels.ImmutableProofTypes.ContextRoot,
|
|
180
|
+
immutableProofModels.ImmutableProofTypes.ContextRootCommon
|
|
181
|
+
],
|
|
179
182
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProof,
|
|
180
183
|
id: "ais:1234567890",
|
|
181
184
|
userIdentity: "user-1",
|
|
@@ -205,7 +208,10 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
205
208
|
[web.HeaderTypes.ContentType]: web.MimeTypes.JsonLd
|
|
206
209
|
},
|
|
207
210
|
body: {
|
|
208
|
-
"@context":
|
|
211
|
+
"@context": [
|
|
212
|
+
immutableProofModels.ImmutableProofTypes.ContextRoot,
|
|
213
|
+
immutableProofModels.ImmutableProofTypes.ContextRootCommon
|
|
214
|
+
],
|
|
209
215
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProof,
|
|
210
216
|
id: "ais:1234567890",
|
|
211
217
|
userIdentity: "user-1",
|
|
@@ -587,7 +593,7 @@ class ImmutableProofService {
|
|
|
587
593
|
*/
|
|
588
594
|
proofEntityToJsonLd(proofEntity) {
|
|
589
595
|
const model = {
|
|
590
|
-
"@context": immutableProofModels.ImmutableProofTypes.ContextRoot,
|
|
596
|
+
"@context": [immutableProofModels.ImmutableProofTypes.ContextRoot, immutableProofModels.ImmutableProofTypes.ContextRootCommon],
|
|
591
597
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProof,
|
|
592
598
|
id: proofEntity.id,
|
|
593
599
|
userIdentity: proofEntity.userIdentity,
|
|
@@ -609,6 +615,7 @@ class ImmutableProofService {
|
|
|
609
615
|
// As we are adding the proof to the data we update its context
|
|
610
616
|
immutableProof["@context"] = [
|
|
611
617
|
immutableProofModels.ImmutableProofTypes.ContextRoot,
|
|
618
|
+
immutableProofModels.ImmutableProofTypes.ContextRootCommon,
|
|
612
619
|
standardsW3cDid.DidContexts.ContextVCDataIntegrity
|
|
613
620
|
];
|
|
614
621
|
immutableProof.proof = task.result.proof;
|
|
@@ -690,7 +697,7 @@ class ImmutableProofService {
|
|
|
690
697
|
// We hash the data for the proof without the the proof or immutable receipt for the proof
|
|
691
698
|
// without these objects we can simplify the context
|
|
692
699
|
const object = core.ObjectHelper.omit(immutableProof, ["proof", "immutableReceipt"]);
|
|
693
|
-
object["@context"] = immutableProofModels.ImmutableProofTypes.ContextRoot;
|
|
700
|
+
object["@context"] = [immutableProofModels.ImmutableProofTypes.ContextRoot, immutableProofModels.ImmutableProofTypes.ContextRootCommon];
|
|
694
701
|
const canonicalDocument = core.JsonHelper.canonicalize(object);
|
|
695
702
|
const proofKey = await this._vaultConnector.getKey(`${nodeIdentity}/${this._proofHashKeyId}`);
|
|
696
703
|
const proofHash = crypto.Sha256.sum256(proofKey.privateKey);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -173,7 +173,10 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
173
173
|
id: "immutableProofGetResponseExample",
|
|
174
174
|
response: {
|
|
175
175
|
body: {
|
|
176
|
-
"@context":
|
|
176
|
+
"@context": [
|
|
177
|
+
ImmutableProofTypes.ContextRoot,
|
|
178
|
+
ImmutableProofTypes.ContextRootCommon
|
|
179
|
+
],
|
|
177
180
|
type: ImmutableProofTypes.ImmutableProof,
|
|
178
181
|
id: "ais:1234567890",
|
|
179
182
|
userIdentity: "user-1",
|
|
@@ -203,7 +206,10 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
203
206
|
[HeaderTypes.ContentType]: MimeTypes.JsonLd
|
|
204
207
|
},
|
|
205
208
|
body: {
|
|
206
|
-
"@context":
|
|
209
|
+
"@context": [
|
|
210
|
+
ImmutableProofTypes.ContextRoot,
|
|
211
|
+
ImmutableProofTypes.ContextRootCommon
|
|
212
|
+
],
|
|
207
213
|
type: ImmutableProofTypes.ImmutableProof,
|
|
208
214
|
id: "ais:1234567890",
|
|
209
215
|
userIdentity: "user-1",
|
|
@@ -585,7 +591,7 @@ class ImmutableProofService {
|
|
|
585
591
|
*/
|
|
586
592
|
proofEntityToJsonLd(proofEntity) {
|
|
587
593
|
const model = {
|
|
588
|
-
"@context": ImmutableProofTypes.ContextRoot,
|
|
594
|
+
"@context": [ImmutableProofTypes.ContextRoot, ImmutableProofTypes.ContextRootCommon],
|
|
589
595
|
type: ImmutableProofTypes.ImmutableProof,
|
|
590
596
|
id: proofEntity.id,
|
|
591
597
|
userIdentity: proofEntity.userIdentity,
|
|
@@ -607,6 +613,7 @@ class ImmutableProofService {
|
|
|
607
613
|
// As we are adding the proof to the data we update its context
|
|
608
614
|
immutableProof["@context"] = [
|
|
609
615
|
ImmutableProofTypes.ContextRoot,
|
|
616
|
+
ImmutableProofTypes.ContextRootCommon,
|
|
610
617
|
DidContexts.ContextVCDataIntegrity
|
|
611
618
|
];
|
|
612
619
|
immutableProof.proof = task.result.proof;
|
|
@@ -688,7 +695,7 @@ class ImmutableProofService {
|
|
|
688
695
|
// We hash the data for the proof without the the proof or immutable receipt for the proof
|
|
689
696
|
// without these objects we can simplify the context
|
|
690
697
|
const object = ObjectHelper.omit(immutableProof, ["proof", "immutableReceipt"]);
|
|
691
|
-
object["@context"] = ImmutableProofTypes.ContextRoot;
|
|
698
|
+
object["@context"] = [ImmutableProofTypes.ContextRoot, ImmutableProofTypes.ContextRootCommon];
|
|
692
699
|
const canonicalDocument = JsonHelper.canonicalize(object);
|
|
693
700
|
const proofKey = await this._vaultConnector.getKey(`${nodeIdentity}/${this._proofHashKeyId}`);
|
|
694
701
|
const proofHash = Sha256.sum256(proofKey.privateKey);
|
package/docs/changelog.md
CHANGED
package/docs/open-api/spec.json
CHANGED
|
@@ -194,7 +194,10 @@
|
|
|
194
194
|
"examples": {
|
|
195
195
|
"immutableProofGetResponseExample": {
|
|
196
196
|
"value": {
|
|
197
|
-
"@context":
|
|
197
|
+
"@context": [
|
|
198
|
+
"https://schema.twindev.org/immutable-proof/",
|
|
199
|
+
"https://schema.twindev.org/common/"
|
|
200
|
+
],
|
|
198
201
|
"type": "ImmutableProof",
|
|
199
202
|
"id": "ais:1234567890",
|
|
200
203
|
"userIdentity": "user-1",
|
|
@@ -219,7 +222,10 @@
|
|
|
219
222
|
"examples": {
|
|
220
223
|
"immutableProofJsonLdGetResponseExample": {
|
|
221
224
|
"value": {
|
|
222
|
-
"@context":
|
|
225
|
+
"@context": [
|
|
226
|
+
"https://schema.twindev.org/immutable-proof/",
|
|
227
|
+
"https://schema.twindev.org/common/"
|
|
228
|
+
],
|
|
223
229
|
"type": "ImmutableProof",
|
|
224
230
|
"id": "ais:1234567890",
|
|
225
231
|
"userIdentity": "user-1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-service",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.21",
|
|
4
4
|
"description": "Immutable proof contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"@twin.org/entity-storage-models": "next",
|
|
24
24
|
"@twin.org/event-bus-models": "next",
|
|
25
25
|
"@twin.org/identity-models": "next",
|
|
26
|
-
"@twin.org/immutable-proof-models": "0.0.1-next.
|
|
27
|
-
"@twin.org/immutable-proof-task": "0.0.1-next.
|
|
26
|
+
"@twin.org/immutable-proof-models": "0.0.1-next.21",
|
|
27
|
+
"@twin.org/immutable-proof-task": "0.0.1-next.21",
|
|
28
28
|
"@twin.org/immutable-storage-models": "next",
|
|
29
29
|
"@twin.org/nameof": "next",
|
|
30
30
|
"@twin.org/standards-w3c-did": "next",
|