From 2ec196e4fca267f670da33f4ca6dd0413d8ec37a Mon Sep 17 00:00:00 2001 From: enrique Date: Fri, 15 Dec 2023 09:32:57 +0100 Subject: [PATCH 1/3] fix: search api --- src/nevermined/api/SearchApi.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/nevermined/api/SearchApi.ts b/src/nevermined/api/SearchApi.ts index 8fb482eb5..eb1ba1766 100644 --- a/src/nevermined/api/SearchApi.ts +++ b/src/nevermined/api/SearchApi.ts @@ -674,8 +674,19 @@ export class SearchApi extends Instantiable { }, }, { - match: { - 'service.attributes.main.type': 'dataset', + bool: { + must_not: [ + { + match: { + 'service.attributes.main.type': 'subscription', + }, + }, + { + match: { + 'service.attributes.main.type': 'service', + }, + }, + ], }, }, ], From 5229dcebddda52dd0afa7d3ff32b51309a0225e9 Mon Sep 17 00:00:00 2001 From: enrique Date: Fri, 15 Dec 2023 09:33:29 +0100 Subject: [PATCH 2/3] feat: bumpversion --- integration/external/Datasets.e2e.test.ts | 13 +++++++++++-- package.json | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index b4036cdfa..c46533201 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -8,6 +8,7 @@ import { AssetPrice, NFTAttributes, NeverminedNFT721Type, + NeverminedNFT1155Type, } from '../../src' import { EscrowPaymentCondition, TransferNFT721Condition, Token } from '../../src/keeper' import { config } from '../config' @@ -425,7 +426,11 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should be able to retrieve datasets associated with a subscription filtering by tags', async () => { - const result = await nevermined.search.datasetsBySubscription(subscriptionDDO.id, tagsFilter) + const result = await nevermined.search.datasetsBySubscription( + subscriptionDDO.id, + NeverminedNFT1155Type.nft1155Credit, + tagsFilter, + ) assert.equal(result.totalResults.value, 1) assert.isTrue( @@ -438,7 +443,11 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should not be able to retrieve any datasets associated with a subscription filtering by tags which do not exist', async () => { - const result = await nevermined.search.datasetsBySubscription(subscriptionDDO.id, tagsFilter2) + const result = await nevermined.search.datasetsBySubscription( + subscriptionDDO.id, + NeverminedNFT1155Type.nft1155Credit, + tagsFilter2, + ) assert.equal(result.totalResults.value, 0) }) }) diff --git a/package.json b/package.json index 2ec36b4d9..bcad86491 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.7", + "version": "2.0.8", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", From 9bdfc81d4a3b43def6b4d053d3828daa042f0e29 Mon Sep 17 00:00:00 2001 From: enrique Date: Fri, 15 Dec 2023 09:35:47 +0100 Subject: [PATCH 3/3] fix: test --- integration/external/Datasets.e2e.test.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/integration/external/Datasets.e2e.test.ts b/integration/external/Datasets.e2e.test.ts index c46533201..b4036cdfa 100644 --- a/integration/external/Datasets.e2e.test.ts +++ b/integration/external/Datasets.e2e.test.ts @@ -8,7 +8,6 @@ import { AssetPrice, NFTAttributes, NeverminedNFT721Type, - NeverminedNFT1155Type, } from '../../src' import { EscrowPaymentCondition, TransferNFT721Condition, Token } from '../../src/keeper' import { config } from '../config' @@ -426,11 +425,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should be able to retrieve datasets associated with a subscription filtering by tags', async () => { - const result = await nevermined.search.datasetsBySubscription( - subscriptionDDO.id, - NeverminedNFT1155Type.nft1155Credit, - tagsFilter, - ) + const result = await nevermined.search.datasetsBySubscription(subscriptionDDO.id, tagsFilter) assert.equal(result.totalResults.value, 1) assert.isTrue( @@ -443,11 +438,7 @@ describe('Gate-keeping of Dataset using NFT ERC-721 End-to-End', () => { }) it('should not be able to retrieve any datasets associated with a subscription filtering by tags which do not exist', async () => { - const result = await nevermined.search.datasetsBySubscription( - subscriptionDDO.id, - NeverminedNFT1155Type.nft1155Credit, - tagsFilter2, - ) + const result = await nevermined.search.datasetsBySubscription(subscriptionDDO.id, tagsFilter2) assert.equal(result.totalResults.value, 0) }) })