@twin.org/immutable-proof-service 0.0.1-next.26 → 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.
- package/dist/cjs/index.cjs +9 -9
- package/dist/esm/index.mjs +10 -10
- package/docs/changelog.md +1 -1
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -175,8 +175,8 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
175
175
|
response: {
|
|
176
176
|
body: {
|
|
177
177
|
"@context": [
|
|
178
|
-
immutableProofModels.
|
|
179
|
-
immutableProofModels.
|
|
178
|
+
immutableProofModels.ImmutableProofContexts.ContextRoot,
|
|
179
|
+
immutableProofModels.ImmutableProofContexts.ContextRootCommon
|
|
180
180
|
],
|
|
181
181
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProof,
|
|
182
182
|
id: "ais:1234567890",
|
|
@@ -209,8 +209,8 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
209
209
|
},
|
|
210
210
|
body: {
|
|
211
211
|
"@context": [
|
|
212
|
-
immutableProofModels.
|
|
213
|
-
immutableProofModels.
|
|
212
|
+
immutableProofModels.ImmutableProofContexts.ContextRoot,
|
|
213
|
+
immutableProofModels.ImmutableProofContexts.ContextRootCommon
|
|
214
214
|
],
|
|
215
215
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProof,
|
|
216
216
|
id: "ais:1234567890",
|
|
@@ -264,7 +264,7 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
264
264
|
id: "immutableProofVerifyResponseExample",
|
|
265
265
|
response: {
|
|
266
266
|
body: {
|
|
267
|
-
"@context": immutableProofModels.
|
|
267
|
+
"@context": immutableProofModels.ImmutableProofContexts.ContextRoot,
|
|
268
268
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProofVerification,
|
|
269
269
|
verified: true
|
|
270
270
|
}
|
|
@@ -279,7 +279,7 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
279
279
|
id: "immutableProofVerifyResponseFailExample",
|
|
280
280
|
response: {
|
|
281
281
|
body: {
|
|
282
|
-
"@context": immutableProofModels.
|
|
282
|
+
"@context": immutableProofModels.ImmutableProofContexts.ContextRoot,
|
|
283
283
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProofVerification,
|
|
284
284
|
verified: false,
|
|
285
285
|
failure: immutableProofModels.ImmutableProofFailure.ProofTypeMismatch
|
|
@@ -517,7 +517,7 @@ class ImmutableProofService {
|
|
|
517
517
|
try {
|
|
518
518
|
const { verified, failure } = await this.internalGet(id, true);
|
|
519
519
|
return {
|
|
520
|
-
"@context": immutableProofModels.
|
|
520
|
+
"@context": immutableProofModels.ImmutableProofContexts.ContextRoot,
|
|
521
521
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProofVerification,
|
|
522
522
|
verified,
|
|
523
523
|
failure
|
|
@@ -577,7 +577,7 @@ class ImmutableProofService {
|
|
|
577
577
|
*/
|
|
578
578
|
proofEntityToJsonLd(proofEntity) {
|
|
579
579
|
const jsonLd = {
|
|
580
|
-
"@context": [immutableProofModels.
|
|
580
|
+
"@context": [immutableProofModels.ImmutableProofContexts.ContextRoot, immutableProofModels.ImmutableProofContexts.ContextRootCommon],
|
|
581
581
|
type: immutableProofModels.ImmutableProofTypes.ImmutableProof,
|
|
582
582
|
id: proofEntity.id,
|
|
583
583
|
nodeIdentity: proofEntity.nodeIdentity,
|
|
@@ -598,7 +598,7 @@ class ImmutableProofService {
|
|
|
598
598
|
if (core.Is.object(proofEntity)) {
|
|
599
599
|
const immutableProof = this.proofEntityToJsonLd(proofEntity);
|
|
600
600
|
// As we are adding the proof to the data we update its context
|
|
601
|
-
immutableProof["@context"] = dataJsonLd.JsonLdProcessor.combineContexts([immutableProofModels.
|
|
601
|
+
immutableProof["@context"] = dataJsonLd.JsonLdProcessor.combineContexts([immutableProofModels.ImmutableProofContexts.ContextRoot, immutableProofModels.ImmutableProofContexts.ContextRootCommon], task.result.proof["@context"]);
|
|
602
602
|
immutableProof.proof = task.result.proof;
|
|
603
603
|
core.ObjectHelper.propertyDelete(immutableProof.proof, "@context");
|
|
604
604
|
if (core.Is.stringValue(immutableProof.proof.created)) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { property, SortDirection, entity, EntitySchemaFactory, EntitySchemaHelper } from '@twin.org/entity';
|
|
2
2
|
import { Guards, ComponentFactory, StringHelper, Is, Validation, Converter, RandomHelper, ObjectHelper, Urn, GeneralError, NotFoundError, JsonHelper } from '@twin.org/core';
|
|
3
|
-
import { ImmutableProofTypes, ImmutableProofFailure, ImmutableProofTopics } from '@twin.org/immutable-proof-models';
|
|
3
|
+
import { ImmutableProofTypes, ImmutableProofContexts, ImmutableProofFailure, ImmutableProofTopics } from '@twin.org/immutable-proof-models';
|
|
4
4
|
import { DidCryptoSuites, ProofTypes, DidContexts } from '@twin.org/standards-w3c-did';
|
|
5
5
|
import { HttpStatusCode, HeaderTypes, MimeTypes } from '@twin.org/web';
|
|
6
6
|
import { BackgroundTaskConnectorFactory, TaskStatus } from '@twin.org/background-task-models';
|
|
@@ -173,8 +173,8 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
173
173
|
response: {
|
|
174
174
|
body: {
|
|
175
175
|
"@context": [
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
ImmutableProofContexts.ContextRoot,
|
|
177
|
+
ImmutableProofContexts.ContextRootCommon
|
|
178
178
|
],
|
|
179
179
|
type: ImmutableProofTypes.ImmutableProof,
|
|
180
180
|
id: "ais:1234567890",
|
|
@@ -207,8 +207,8 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
207
207
|
},
|
|
208
208
|
body: {
|
|
209
209
|
"@context": [
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
ImmutableProofContexts.ContextRoot,
|
|
211
|
+
ImmutableProofContexts.ContextRootCommon
|
|
212
212
|
],
|
|
213
213
|
type: ImmutableProofTypes.ImmutableProof,
|
|
214
214
|
id: "ais:1234567890",
|
|
@@ -262,7 +262,7 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
262
262
|
id: "immutableProofVerifyResponseExample",
|
|
263
263
|
response: {
|
|
264
264
|
body: {
|
|
265
|
-
"@context":
|
|
265
|
+
"@context": ImmutableProofContexts.ContextRoot,
|
|
266
266
|
type: ImmutableProofTypes.ImmutableProofVerification,
|
|
267
267
|
verified: true
|
|
268
268
|
}
|
|
@@ -277,7 +277,7 @@ function generateRestRoutesImmutableProof(baseRouteName, componentName) {
|
|
|
277
277
|
id: "immutableProofVerifyResponseFailExample",
|
|
278
278
|
response: {
|
|
279
279
|
body: {
|
|
280
|
-
"@context":
|
|
280
|
+
"@context": ImmutableProofContexts.ContextRoot,
|
|
281
281
|
type: ImmutableProofTypes.ImmutableProofVerification,
|
|
282
282
|
verified: false,
|
|
283
283
|
failure: ImmutableProofFailure.ProofTypeMismatch
|
|
@@ -515,7 +515,7 @@ class ImmutableProofService {
|
|
|
515
515
|
try {
|
|
516
516
|
const { verified, failure } = await this.internalGet(id, true);
|
|
517
517
|
return {
|
|
518
|
-
"@context":
|
|
518
|
+
"@context": ImmutableProofContexts.ContextRoot,
|
|
519
519
|
type: ImmutableProofTypes.ImmutableProofVerification,
|
|
520
520
|
verified,
|
|
521
521
|
failure
|
|
@@ -575,7 +575,7 @@ class ImmutableProofService {
|
|
|
575
575
|
*/
|
|
576
576
|
proofEntityToJsonLd(proofEntity) {
|
|
577
577
|
const jsonLd = {
|
|
578
|
-
"@context": [
|
|
578
|
+
"@context": [ImmutableProofContexts.ContextRoot, ImmutableProofContexts.ContextRootCommon],
|
|
579
579
|
type: ImmutableProofTypes.ImmutableProof,
|
|
580
580
|
id: proofEntity.id,
|
|
581
581
|
nodeIdentity: proofEntity.nodeIdentity,
|
|
@@ -596,7 +596,7 @@ class ImmutableProofService {
|
|
|
596
596
|
if (Is.object(proofEntity)) {
|
|
597
597
|
const immutableProof = this.proofEntityToJsonLd(proofEntity);
|
|
598
598
|
// As we are adding the proof to the data we update its context
|
|
599
|
-
immutableProof["@context"] = JsonLdProcessor.combineContexts([
|
|
599
|
+
immutableProof["@context"] = JsonLdProcessor.combineContexts([ImmutableProofContexts.ContextRoot, ImmutableProofContexts.ContextRootCommon], task.result.proof["@context"]);
|
|
600
600
|
immutableProof.proof = task.result.proof;
|
|
601
601
|
ObjectHelper.propertyDelete(immutableProof.proof, "@context");
|
|
602
602
|
if (Is.stringValue(immutableProof.proof.created)) {
|
package/docs/changelog.md
CHANGED
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.27",
|
|
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.27",
|
|
27
|
+
"@twin.org/immutable-proof-task": "0.0.1-next.27",
|
|
28
28
|
"@twin.org/immutable-storage-models": "next",
|
|
29
29
|
"@twin.org/nameof": "next",
|
|
30
30
|
"@twin.org/standards-w3c-did": "next",
|