From b49dd01e5b455bf9eace082289bf9e7f53b57d6f Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 25 Dec 2024 19:49:49 +0100 Subject: [PATCH 1/2] Make contract lowercase everywhere get controler --- src/controllers/http-api/v0/get-http-api-controller-v0.js | 6 ++++-- src/controllers/http-api/v1/get-http-api-controller-v1.js | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/controllers/http-api/v0/get-http-api-controller-v0.js b/src/controllers/http-api/v0/get-http-api-controller-v0.js index 02b66bb6f..12d06b65a 100644 --- a/src/controllers/http-api/v0/get-http-api-controller-v0.js +++ b/src/controllers/http-api/v0/get-http-api-controller-v0.js @@ -54,10 +54,12 @@ class GetController extends BaseController { let knowledgeCollectionId; let knowledgeAssetId; try { - const { id, paranetUAL, includeMetadata, contentType } = req.body; + const { paranetUAL, includeMetadata, contentType } = req.body; + let { id } = req.body; ({ blockchain, contract, knowledgeCollectionId, knowledgeAssetId } = this.ualService.resolveUAL(id)); - + contract = contract.toLowerCase(); + id = this.ualService.deriveUAL(blockchain, contract, knowledgeAssetId); this.logger.info(`Get for ${id} with operation id ${operationId} initiated.`); // Get assertionId - datasetRoot diff --git a/src/controllers/http-api/v1/get-http-api-controller-v1.js b/src/controllers/http-api/v1/get-http-api-controller-v1.js index bace47ba6..064b97416 100644 --- a/src/controllers/http-api/v1/get-http-api-controller-v1.js +++ b/src/controllers/http-api/v1/get-http-api-controller-v1.js @@ -54,9 +54,12 @@ class GetController extends BaseController { let knowledgeCollectionId; let knowledgeAssetId; try { - const { id, paranetUAL, includeMetadata, contentType } = req.body; + const { paranetUAL, includeMetadata, contentType } = req.body; + let { id } = req.body; ({ blockchain, contract, knowledgeCollectionId, knowledgeAssetId } = this.ualService.resolveUAL(id)); + contract = contract.toLowerCase(); + id = this.ualService.deriveUAL(blockchain, contract, knowledgeAssetId); this.logger.info(`Get for ${id} with operation id ${operationId} initiated.`); From 1246df88e130e296c00a3f2c14aa167c41718acd Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 25 Dec 2024 19:58:05 +0100 Subject: [PATCH 2/2] version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6111184b0..378f7329e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "8.0.0-sigma.18", + "version": "8.0.0-sigma.19", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "8.0.0-sigma.18", + "version": "8.0.0-sigma.19", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", diff --git a/package.json b/package.json index 6a5db1480..b017311a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "8.0.0-sigma.18", + "version": "8.0.0-sigma.19", "description": "OTNode V8", "main": "index.js", "type": "module",